Add missed callback unregister in NetworkConnectivityChecker
Avoid ConnectivityManager$TooManyRequestsException Change-Id: Ie2a80576940fd9f91d475a2d1b4626d6d4cfd02d
This commit is contained in:
parent
884568cbeb
commit
5726c769ec
|
@ -88,6 +88,9 @@ internal class DefaultNetworkConnectivityChecker @Inject constructor(
|
|||
listeners.remove(listener)
|
||||
if (listeners.isEmpty()) {
|
||||
backgroundDetectionObserver.unregister(backgroundDetectionObserverListener)
|
||||
if (!backgroundDetectionObserver.isInBackground) {
|
||||
unbind()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue