Skip to content

make wifi scanning consistent with WiFi throttling enabled#17

Open
grische wants to merge 3 commits intofreifunk-darmstadt:masterfrom
grische:better-wifi-throttle-handling
Open

make wifi scanning consistent with WiFi throttling enabled#17
grische wants to merge 3 commits intofreifunk-darmstadt:masterfrom
grische:better-wifi-throttle-handling

Conversation

@grische
Copy link
Copy Markdown
Contributor

@grische grische commented Apr 10, 2026

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:

  1. they add an indicator of the last scan time
  2. they slow scanning times if wifi throttling is active
  3. they show an indicator if wifi scan throttling is active

grische added 3 commits April 11, 2026 00:38
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.
@grische grische force-pushed the better-wifi-throttle-handling branch from 608ad62 to 1e4742c Compare April 10, 2026 22:38
@blocktrron
Copy link
Copy Markdown
Member

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.

@grische
Copy link
Copy Markdown
Contributor Author

grische commented Apr 12, 2026

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.

@blocktrron
Copy link
Copy Markdown
Member

My problem is inconsistency in the potential behavior between users.

Middle ground would be to always display a warning to disable throttling on startup.

@grische
Copy link
Copy Markdown
Contributor Author

grische commented Apr 12, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants