Originally Posted by androidpiedev
Hi, I am working on an Ionic app where I am using a hotspot plugin to scan available WiFi WAPs around me. My app runs the scan every second. After scanning for first few seconds, the app doesn't seem to detect any WAPs. Leaving the app for a few seconds makes it detect WAPs again but this time also for a few seconds before it dies again until next time. This has been tested on different devices with Android Pie and the behaviour is same. However, when I test it on any Android version other than Android Pie, it works fine; i.e. it keeps updating the scan every second. My question is: Is there anything in Android Pie that is stopping my app to scan available WAPs every second?
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 and later:
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.
Source: Android Developer Guide > Topic: Wifi Scan throttling