Description[Android] Introduce RegistrationPolicy for NetworkChangeNotifier.
Currently the NetworkChangeNotifier.setAutoDetectConnectivityState(true) uses
ApplicationState to determine when to listen to network changes. However the
ApplicationStatus class does not work as such in the context of WebView. To make
the NetworkChangeNotifier more flexible this patch introduces a RegistrationPolicy
class which can be passed to the overloaded setAutoDetectConnectivityState method.
We make sure to keep the overall API compatible, such that existing users of the
NetworkChangeNotifier do not have to provide a policy, which is set behind the
screens instead. To this end this patch includes two concrete implementations of
the RegistrationPolicy.
BUG=520088
Committed: https://crrev.com/97997f341e5e7205b5311a5f1ed66f8cd0d66454
Cr-Commit-Position: refs/heads/master@{#353071}
Patch Set 1 #Patch Set 2 : clean-up and rebase #
Total comments: 16
Patch Set 3 : address comments #
Total comments: 6
Patch Set 4 : rebase + address comments #Patch Set 5 : rebase #Patch Set 6 : rebase once more #Patch Set 7 : fix compile of tests #
Messages
Total messages: 19 (3 generated)
|