Android 9 (Pie) introduces wifi RTT ranging for the purpose of wifi-based gelolocation.
In versions up until Android 8 (Oreo), applications would periodically request wifi scans. This functionality is being massively throttled in Android 9: a foreground app can now request a maximum of 4 scans in a 2-minute window; background apps are restricted to one scan per 30 minutes for all background apps combined. The only way to avoid this throttling is the NETWORK_SETTINGS
permission, which, however, is a signature permission (I take that to mean it needs to be signed with the same key as the OS build, regardless of whether it’s a system app) and thus not available to third-party apps.
I understand that wifi RTT ranging can only be initiated with a ScanResult
, thus I’d need to run a wifi scan first. However, I could presumably bypass the throttle by reusing the same scan result for a couple of RTT ranging requests, at the expense of not getting new wifis for some time.
However, the docs also mention throttling for wifi RTT ranging, however, without specifying what the limits are.
Finally, WifiManager.startScan()
is deprecated and apps may no longer be able to start scans in future releases.
Questions:
- What are the limits for requesting wifi RTT ranging?
- What is the correct way to obtain a
ScanResult
, which I need to start an RTT ranging request?