schollz / find3-android-scanner

An android app that scans Bluetooth and WiFi for FIND3
https://www.internalpositioning.com/doc/tracking_your_phone.md
MIT License
124 stars 56 forks source link

WiFi scan throttling limitations #24

Open daniele-athome opened 4 years ago

daniele-athome commented 4 years ago

https://developer.android.com/guide/topics/connectivity/wifi-scan#wifi-scan-throttling

The following limitations apply to the frequency of scans using WifiManager.startScan(). Android 8.0 and Android 8.1: Each background app can scan one time in a 30-minute period. Android 9: Each foreground app can scan four times in a 2-minute period. This allows for a burst of scans in a short time. All background apps combined can scan one time in a 30-minute period. Android 10 and higher: The same throttling limits from Android 9 apply. There is a new developer option to toggle the throttling off for local testing (under Developer Options > Networking > Wi-Fi scan throttling).

On Android 9 having a foreground service is not enough. This is going to be tough. I'll investigate alternatives (even strong one, such as something with root :skull_and_crossbones: ).

daniele-athome commented 4 years ago

So far I couldn't find anything useful. It seems the only ways are patching the OS or keep the screen on as the app does right now. :sob:

IoTThinks commented 4 years ago

Hi, I disabled WiFi scan throttling in my Samsung A10 (Android 10) already. The screen is ON. The app is slow to push the learning data. Few data (5 datasets?) every five minutes.

If I use the ESPClient, I can submit every 5 seconds. Is it normal and expected?

Thanks a lot.