TelephonyManager.requestNetworkScan - Error 4 modem

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

TelephonyManager.requestNetworkScan - Error 4 modem


I'm developing a privileged system app to scan the network. I have granted the app MODIFY_PHONE_STATE permission.

I try on A10-105F and OnePlus 6.

But when I run the code, the API returns the error "The modem does not support the request scan." (4) from requestNetworkScan callback. 

public void launchScan() int ranLte = AccessNetworkConstants.AccessNetworkType.GERAN; int[] lteBands = {AccessNetworkConstants.GeranBand.BAND_850}; int[] lteChannels = {1}; RadioAccessSpecifier lte = new RadioAccessSpecifier(ranLte, lteBands, lteChannels); RadioAccessSpecifier[] ras = new RadioAccessSpecifier[]{ lte}; int searchPeriodicity = 70; int maxSearchTime = 200; boolean incrementalResults = true; int incrementalResultsPeriodicity = 7; NetworkScanRequest networkScanRequest = new NetworkScanRequest(NetworkScanRequest.SCAN_TYPE_ONE_SHOT, ras, searchPeriodicity, maxSearchTime, incrementalResults,incrementalResultsPeriodicity, null); telephonyManager.requestNetworkScan(networkScanRequest,AsyncTask.SERIAL_EXECUTOR,new MobileNetworkCallBack()); }

Does anyone have any idea how the phone's modem can't scan when it can connect to different networks? I'm trying with different frequency bands/channels

Thanks you 

You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit