ReactiveNetwork
ReactiveNetwork copied to clipboard
Add new Observables related to NetworkCallback for API 21 (Lollipop) and higher
Reference: https://developer.android.com/reference/android/net/ConnectivityManager.NetworkCallback.html
We can create new observables for the following methods:
-
onCapabilitiesChanged(Network network, NetworkCapabilities networkCapabilities)
-
onLinkPropertiesChanged(Network network, LinkProperties linkProperties)
-
onLosing(Network network, int maxMsToLive)
General thoughts:
- Optionally, we can improve
LollipopNetworkObservingStrategy
in such way, so it will have additional Observable handling all of the use cases mentioned above. - We can consider creating an additional interface for new observables. Adding new observables to
NetworkObservingStrategy
will break ISP (Interface Segregation Principle) because all strategy except forLollipopNetworkObservingStrategy
would have empty method implementations in that case.