Closed Pankovea closed 5 months ago
"The Wi-Fi connection search sensor only works if geolocation is enabled."
You means "Wi-Fi sensor" with "Connection type"="Nearby"? And you have dislabed Loaction in Location system settings?
PPP do not check Location setting in Wi-Fi scanning. If PPP receives broadcast for Wi-Fi scanning, then will be used.
PPP has WifiScanBroadcastReceiver with action WifiManager.SCAN_RESULTS_AVAILABLE_ACTION.
And if is received this broadcast, PPP use data from it.
In it PPP only check Location permission and then gets scanned ssids with:
List
Maybe in your Honor working wi-fi scanning even when Location is disabled.
But by my tests, in some devices _scanResults list is empty when Location is disabled.
Hello, Henrich. I don't really understand what you mean. I'll show you how things are in more detail. I'm trying on another device and the behavior is exactly the same. App version 6.5 (7140) The sensor settings are as follows The result of the work is as follows:
When the sensor cannot receive data about connection or non-connection to the network, it should not be triggered. Now it's triggered.
You do not using Wi-Fi scanning. In "Connection type" is configured "Not connected". This do not use wifi scanner, only check for connect/disconnect from wifi.
And this "Connection type" working only when Loaction is enabled?
EDIT: Your device is Honor? Because SSID name is "Xiaomi...". This ssid is from Xiaomi router? EDIT2: I will testing it in my Huawei P40.
I've tried both ways.: Connected to Wi-Fi and located nearby. It's just that in this case it's more revealing.
My device is Honor X8b (Android 13), Xiaomi_74A6 is my router. My second device in the same behaviour is Redmi 9 pro (Android 12). But my third device works correctly - Redmi Note 5 (Android 9). Moreover, it works correctly even without turning on geolocation. And even in scan mode.
What could be the problem?
Hm yes, if Location is disabled, sensor is passed. OK I must fix it. Tested in my Huawei P40.
Thanks.
Ok, problem is with security in Android.
Result: Location MUST be enabled to get proper connected SSID.
In case when location is turned off, the sensor must not be triggered.
OK, but then configured SSID in sensor will be ignored? Because this is ugly "workaround".
Hm "workaround" implemented. But your wifi sensor will be not passed (green), when Location is dislabled. In both Connection types: "Connected", "Not connected". Is this as you want it?
I think it will be correct behaviour. Because if the sensor does't know about the actual state of the Wi-Fi module, then it should not do anything by default. Perhaps this is my special case. Maybe you can add a setting for this?
Exists parameter notAllowedWifi. If is true, sensor will do nothing, pass status is not changed. By me this not good, because if sensor is passed and you disable Location, sensor pass status do not change. Stays passed.
For this reason I'm impleneted: if Location is disabled, force set pass status to false.
Awesome! I see you've already made a commit. Can I get the apk and test it?
OK. If you want, install and test this beta version: https://drive.google.com/file/d/13V2Zkb5W4VxNdMiXfsRs5iuWflt2xasY/view?usp=drivesdk
I have tested the behaviour and now it doesn't work correctly in this case. In this case you also need to mark that you need access to geolocation like here
No, this is correct. Because if Location is disabled, sensor pass status is forced to false.
Information about disabled Location will be added in next beta.
- No, this is correct. Because if Location is disabled, sensor pass status is forced to false.
I meant that the behavior is expected for us, but not for the user. There were no notes.
Now it works good. But it may be necessary to make the sensor's status red. As well as other parts where the incorrect settings. Thus, it will be clear that the sensor is inoperable.
But if Location is disabled, is not possible to get connected SSID.
Again: Problem is with security in Android.
Result: Location MUST be enabled to get proper connected SSID.
I understand that. that's why I'm saying that the user needs to highlight it in red.
Upd: I'm sorry for my English. translation difficulties.
We have been using your application for many years. and these settings were good for turning on the profile "outdoors". and there were problems with the new device. Thank you for your efforts and for your prompt response.
OK, added also generation of error notificaton + red color, when Location is required, but not enabled. If you want, install this beta: https://drive.google.com/file/d/13V2Zkb5W4VxNdMiXfsRs5iuWflt2xasY/view?usp=drivesdk
Great! Thanks. 🤝
This fix caused Profile to be deactivated in some cases.
This fix caused Profile to be deactivated in some cases.
What do you mean?
The Wi-Fi connection search sensor only works if geolocation is enabled.
I have an Honor X8b Currently configured with a Wi-Fi sensor that is not connected to an access point. But when geolocation is disabled, the sensor still works. Although it should not have worked because he does not have access to this data.