TelephonyManager.requestNetworkScan - Error 4 modem

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

TelephonyManager.requestNetworkScan - Error 4 modem

Cawottex

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 https://groups.google.com/d/msgid/android-platform/ad399e9b-a784-4858-a004-a9a6515d119an%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: TelephonyManager.requestNetworkScan - Error 4 modem

Notur Business
I would not help you.  The android guidelines say that onyl telephone company providers are allowed that privelage level and can run apps that "freak the telephone companies networks".  They are private networks:  you are not a privelaged member.  There are partial directions for telephone companies to use MODIFY_PHONE_STATE, but the directions also say normal "apps" are not allowed to use it, if I am not mistaken please.

If you purchase your own modem, say a voice/fax/data  USB modem supporting a SIM, that would be a different story, that would be between you, who you purchased the device form, and your carrier as to "what you could do on their network and how to gain trust".

On Thursday, February 11, 2021 at 4:18:52 PM UTC-5 Cawottex wrote:

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 https://groups.google.com/d/msgid/android-platform/73199e8a-f2e4-4983-a5d4-d12725a533fcn%40googlegroups.com.