WifiUtils
WifiUtils copied to clipboard
Many requests to give permissions to change the WiFi connectivity on Xiaomi devices.
Because of the algorithm that disables all other networks, in Xiaomi devices we have an issue because for each network the system will ask the user to consent permissions to change the Wi-Fi connectivity. Unless the user goes to the settings and concedes this permission permanently, Anyone knows a way to lead with this?
I also have a Xiaomi device but I'm not sure I understand what you mean. As long as the WiFi is already turned on, there won't be any further permission restrictions. But yes if the WiFi is off You will be prompted to turn it on. I don't think this can change.
Hey, thanks for the answer. Please, I put a little movie showing the behavior that I tried to explain. Maybe It is a behavior for Xiaomi with Android 9, but I couldn't find a way to fix this problem.
https://drive.google.com/file/d/1_xW15b9PSOzco9RmKtjqgpO0Z0Cqsw9m/view?usp=sharing
Thanks for the video I understand now.
This particular WiFi dialog also shows up on my Redmi Pro running Android 6 but once I grant the permissions it goes away.
Maybe there is an issue in newer Xiaomi devices that use MIUI. I really don't know how to fix it unless I get such a device in my hands but I'm gonna investigate it nonetheless.
I noticed that the problem happens on the method 'disableAllButOne' of ConnectorUtils class, in which the system will ask permissions for each WifiConfiguration that will be modified.
I understand that the best solution would be asking the user to consent this permission permanently, but I couldn't find in Xiaomi documentation something about how to check and ask this permission programmatically.
What do you think about not execute this method if the app is running on a Xiaomi device? Is this method indispensable for the connection algorithm? I tested not run this method and in my initial tests, the connection happened successfully.
@aparecidoSilvano @ThanosFisherman Can refer to this:https://blog.csdn.net/u014632228/article/details/101207983
Hi, I have the same problem, did anybody solve this? If I detect Xiaomi devices in my code, then which method helps me to connect?
Hello, I have the same issue here.
Have you been able to avoid this problem when connecting to a certain Wifi? I am using the react-native-wifi-reborn library.
Hi there! I have the same issue here. I am also using react-native-wifi-reborn. @arangu97 are you solve this problem?
A tester reported a similar problem on an app we're developping.
Referring to the chinese article mentioned above, it seems that miui systems have a private permission (Enable/Disable WIFI) that seems to interfere and causes this behaviour. This is not happening on other Android 9/10/11 systems.
Changing the permission manually solves the problem.
Unfortunately i don't have a phone at hand to try to reproduce and debug the code.
Why disableAllButOne