make wifi scanning consistent with WiFi throttling enabled#17
make wifi scanning consistent with WiFi throttling enabled#17grische wants to merge 3 commits intofreifunk-darmstadt:masterfrom
Conversation
Detect wifi scan throttling via WifiManager.isScanThrottleEnabled (API 31+, default true on API 30) and slow scans to one every 30 seconds to stay within the 4 scans / 2 minutes limit.
608ad62 to
1e4742c
Compare
|
I don't see the application as viable at all with scan throttling enabled. Much rather display a warning with instructions how to disable throttling instead of trying to accommodate to it. |
|
I've been using the app with WiFi throttling enabled for a day in different setups and a 30s delay between updates is more than helpful for most of the standard analysis. Instructions on how to disable it would still be helpful though, I agree. |
|
My problem is inconsistency in the potential behavior between users. Middle ground would be to always display a warning to disable throttling on startup. |
|
I'm not sure I understand. Each user sees the time of last scan (e.g. "last scan 5s ago") and sees the red message for throttling active. Isn't this enough for users to understand why one scans every 1-2s and one every 30s? Felt very intuitive to me at least. |
I noticed that WiFi scanning was very inconsistent as my phone had wifi scan throttling enabled (can only be disabled via developer options).
So a scan every 1-2s means that it scans 4x times within ~4-8 seconds and then doesn't update the list for another 2 minutes before doing the next scan. The second commit changes to to scan every 30s if scan throttling is enabled, so it's evenly paced across the 2 minute window.
See https://developer.android.com/develop/connectivity/wifi/wifi-scan#wifi-scan-throttling
The commits here help with the problem: