Using Android 10, it is difficult to scan Wifi Access Point with no internet access.
I use the following code to scan Wifi networks:
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION);
registerReceiver(wifiNetworkScanner, intentFilter);
WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(WIFI_SERVICE);
wifiManager.startScan();
with wifiNetworkScanner extending BroadcastReceiver and using wifiManager.getScanResults();
The scan results properly include Wifi Access Point with internet access, but most of the time, Access Point without internet access are not scanned on Android 10.
Is it a bug on Android 10 ? Any workaround ?