Hello everyone,
I would appreciate any suggestion for a problem I'm struggling with:
I'm developing a privileged system app to scan the network and get identity of all neighboring cells.
I've tried using the new TelephonyManager.requestNetworkScan API in Android P for this task.
After executing the API on Pixel 2, I get scan results, but they don't contain a valid cell identity information. All values, such as mnc, earfcn/uarfcn, bandwidth, etc return either as 0, null or max int.
Traced it through the layers to ril, seems that the modem returns the results this way.
telephonyManager.getAllCellInfo does have valid identity results, but only of 6 specific cells, and cannot be refreshed.
Tried to send AT commands directly to the modem (Snapdragon X16 LTE), and successfully managed to get neighboring cell operators,
but not relevant identity information, and can't find proper documentation anywhere for the right AT command to send.
Ruled out SIM issue - the same error happens with 3 different SIMs, successfully scanning the network form settings app for example.
An extract of the code:
TelephonyManager telephonyManager = (TelephonyManager) getApplicationContext()
.getSystemService(Context.TELEPHONY_SERVICE);
radioAccessSpecifiers = new RadioAccessSpecifier[1];
radioAccessSpecifiers[0] = new RadioAccessSpecifier(
AccessNetworkConstants.AccessNetworkType.EUTRAN,
null,
null);
networkScanRequest = new NetworkScanRequest(
NetworkScanRequest.SCAN_TYPE_ONE_SHOT,
radioAccessSpecifiers,
30,
300,
true,
3,
null);
telephonyManager.requestNetworkScan(networkScanRequest, AsyncTask.SERIAL_EXECUTOR,new RadioCallback());
extract from radio's logcat:
07-24 17:33:15.339 1584 1584 D RILJ : [4548]> RIL_REQUEST_START_NETWORK_SCAN [SUB0]
07-24
17:33:15.347 1584 1708 D RILJ : [4548]<
RIL_REQUEST_START_NETWORK_SCAN
com.android.internal.telephony.NetworkScanResult@1f [SUB0]
07-24 17:33:32.035 938 1233 D RILC : networkScanResultInd
07-24 17:33:32.053 1584 1708 D RILJ : Unsol response received; Sending ack to ril.cpp [SUB0]
07-24 17:33:32.054 1584 1708 W CellIdentityLte: invalid MNC format: 1
07-24 17:33:32.055 1584 1708 W CellIdentityLte: invalid MNC format: 2
07-24 17:33:32.056 1584 1708 W CellIdentityLte: invalid MNC format: 8
07-24 17:33:32.057 1584 1708 W CellIdentityLte: invalid MNC format: 7
07-24 17:33:32.058 1584 1708 W CellIdentityLte: invalid MNC format: 3
07-24 17:33:32.059 1584 1708 W CellIdentityLte: invalid MNC format: 9
07-24
17:33:32.062 1584 1708 D RILJ : [UNSL]<
RIL_UNSOL_NETWORK_SCAN_RESULT
com.android.internal.telephony.NetworkScanResult@a046359e [SUB0]
07-24 17:33:32.080 6254 6342 D TelephonyScanManager: onResults: [Landroid.telephony.CellInfo;@cccc91c
07-24 17:33:32.082 6254 6343 D TelephonyScanManager: onComplete
Would really appreciate any idea!