ReactiveNetwork icon indicating copy to clipboard operation
ReactiveNetwork copied to clipboard

Add new Observables related to NetworkCallback for API 21 (Lollipop) and higher

Open pwittchen opened this issue 7 years ago • 0 comments

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 for LollipopNetworkObservingStrategy would have empty method implementations in that case.

pwittchen avatar Mar 06 '17 11:03 pwittchen