-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WiFi hotspot isn't recognised on Android 13 #569
Comments
# What kind of change does this PR introduce? Fixes the hotspot state detection on Android 13. # What is the current behavior? This is a temporary fix for [#569 ](#569) but a long-term solution is still needed. # What is the new behavior (if this is a feature change)? On Android 13, we are looking to the gateway addresses request results to infer if hotspot is available. In previous versions of Android, there is no behavior change.
The solution implemented in this PR is relying on the exception occurrence: We noticed that when the hotspot is off, the request for local IP addresses would throw an exception, and with this result, we know if the hotspot is on/off. This is not the most elegant solution because instead of an exception, we should return a state (if an IP list is returned or not). Also, this is not ideal because we are relying on a behavior that is not documented, so we can not trust that this is a stable solution (as we can't test in all devices/scenarios). And, above all, this solution is not in line with what is done up to API 32: the system reporting hotspot state changes. In my investigation, I found that in API 33 there were changes in the way an application interacts with the hotspot. With the information collected so far (which needs confirmation) I realized that we will have to change the flow of the app:
In resume, the implemented solution is not the most elegant but the possible solution path does not allow to keep the existing behavior. |
It works fine on Android 11, and I don't have an Android 12 phone but I'm sure it worked fine there too before the Android 13 upgrade.
Note that the WiFi hotspot is on as can be seen at the top.
The text was updated successfully, but these errors were encountered: