Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Fix networkstate update behavior (DEV) #3767

Merged
merged 9 commits into from
Jul 28, 2021

Conversation

d4rken
Copy link
Member

@d4rken d4rken commented Jul 21, 2021

The network callback for onUnavailable() is not reliable.
Solution: Just force a refresh on any state change.

Also see:
https://issuetracker.google.com/issues/144891976
According to that ticket, it's fixed in a "future release", but on my Pixel 3a@Android11, it's not 馃し.

@BMItr noticed this during debugging.

@d4rken d4rken added bug Something isn't working maintainers Tag pull requests created by maintainers labels Jul 21, 2021
@d4rken d4rken added this to the 2.7.0 milestone Jul 21, 2021
@d4rken d4rken marked this pull request as ready for review July 21, 2021 10:08
@d4rken d4rken requested a review from a team July 21, 2021 10:08
@BMItr BMItr self-assigned this Jul 21, 2021
@BMItr
Copy link
Contributor

BMItr commented Jul 22, 2021

@d4rken its much better than before.
Unfortunally its not as reliable..
e.g. Wifi OFF->ON is detected
Wifi ON->OFF is not detected.
Maybe you have an idea..

@d4rken
Copy link
Member Author

d4rken commented Jul 26, 2021

e.g. Wifi OFF->ON is detected

This was also working for me before.

Wifi ON->OFF is not detected.

This should be fixed by this PR, on which devices does it happen, and how did you test it?

@BMItr
Copy link
Contributor

BMItr commented Jul 26, 2021

e.g. Wifi OFF->ON is detected

This was also working for me before.

Wifi ON->OFF is not detected.

This should be fixed by this PR, on which devices does it happen, and how did you test it?

Tested on Pixel 3xl.
Wlan OFF -> App start -> Wlan On (detected) -> Wlan Off (not detected)

There might be no 100%reliable solution...

Copy link
Contributor

@chiljamgossow chiljamgossow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be an improvement

@chiljamgossow chiljamgossow self-assigned this Jul 28, 2021
@sonarcloud
Copy link

sonarcloud bot commented Jul 28, 2021

Kudos, SonarCloud Quality Gate passed!聽 聽 Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

28.6% 28.6% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@BMItr BMItr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@BMItr BMItr merged commit f10bad2 into release/2.7.x Jul 28, 2021
@BMItr BMItr deleted the fix/DEV-networkstate-callbacks branch July 28, 2021 12:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working maintainers Tag pull requests created by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants