IllegalStateException - You must call canNotify() before calling notify(ConnectivityChangeEvent)
com.novoda.merlin.service.MerlinService$LocalBinder.notify (SourceFile:81)
com.novoda.merlin.receiver.ConnectivityCallbacks.notifyMerlinService (SourceFile:45)
com.novoda.merlin.receiver.ConnectivityCallbacks.onAvailable (SourceFile:26)
android.net.ConnectivityManager$CallbackHandler.handleMessage (ConnectivityManager.java:2807)
android.os.Handler.dispatchMessage (Handler.java:105)
android.os.Looper.loop (Looper.java:164)
android.os.HandlerThread.run (HandlerThread.java:65)
This should be impossible since the call to notify is guarded with a canNotify however, it appears this was running on a background HandlerThread meaning it's possible the service became unbound during act of notifying
Potential Solution
To force interactions with the service to be via the main thread to ensure the guard and notification are always serial
Impact
Is a client side uncatchable (without uncaught exception handlers) runtime crash
Problem
Have seen a single crash in
crashlytics
withThis should be impossible since the call to
notify
is guarded with acanNotify
however, it appears this was running on a backgroundHandlerThread
meaning it's possible the service became unbound during act of notifyingPotential Solution
To force interactions with the service to be via the
main thread
to ensure the guard and notification are always serialImpact