Skip to content
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

Open
gnarea opened this issue Sep 8, 2022 · 1 comment
Open

WiFi hotspot isn't recognised on Android 13 #569

gnarea opened this issue Sep 8, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@gnarea
Copy link
Member

gnarea commented Sep 8, 2022

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.

Screenshot_20220908-180702

@gnarea gnarea added the bug Something isn't working label Sep 8, 2022
@gnarea gnarea changed the title WiFi hotspot isn't recognised WiFi hotspot isn't recognised on Android 13 Sep 8, 2022
kodiakhq bot pushed a commit that referenced this issue Oct 4, 2022
# 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.
@LilianaFaustinoDev
Copy link
Collaborator

LilianaFaustinoDev commented Oct 6, 2022

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:

  • The application can make a request for a hotspot connection and receive its configurations (SSID and credentials)
  • This hotspot is “dedicated” to this application, which means that in order to have a hotspot connection we have to share the configurations received with the user who wants to connect to the hotspot (requires changes in the UI).

In resume, the implemented solution is not the most elegant but the possible solution path does not allow to keep the existing behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

3 participants