pwittchen / ReactiveNetwork

Android library listening network connection state and Internet connectivity with RxJava Observables
http://pwittchen.github.io/ReactiveNetwork/docs/RxJava2.x/
Apache License 2.0
2.53k stars 276 forks source link

fixes in the code and tests according to PR #455 related to utilization of the NetworkState class #469

Open pwittchen opened 1 year ago

pwittchen commented 1 year ago

fixes in the logic of MarshmallowNetworkObservingStrategy and tests according to PR #455 related to utilization of the NetworkState class

pwittchen commented 1 year ago

I also updated code of the sample apps. Unfortunately, In the Android emulator, network changes are not invoked for some reason. They're invoked only when I restart the Activity. On the RxJava2.x branch it works fine on the emulator, so it needs fix.

pwittchen commented 1 year ago

Current analysis: Logic in MarshmallowNetworkObservingStrategy#propagateAnyConnectedState needs to be updated. Probably new strategy QNetworkObservingStrategy needs to be created to handle this on Android Q. In general propagateAnyConnectedState receives 5 notifications and for NetworkState logic is incorrect to propagate state change.

pwittchen commented 1 year ago

I finally fixed handling state in the correct manner, so the last available connected network is propagated to the end of the stream if we lost connectivity with one network while being connected to two networks or more.

Now a few more things needs to be done: