My application has carrier privileges on one SIM slot/subscription id.
TelephonyManager slotTelephonyManager =
telephonyManager.createForSubscriptionId(subscriptionInfo.getSubscriptionId());
boolean cp = slotTelephonyManager.hasCarrierPrivileges(); // cp == true
I try to request network scan using
slotTelephonyManager.requestNetworkScan(
new NetworkScanRequest(
SCAN_TYPE_ONE_SHOT, null, 1, 60, false, 1, null),
AsyncTask.SERIAL_EXECUTOR,
new ScanCallback());
searchPeriodicity & incrementalResultsPeriodicity set to 1 (not 0) as in answer above said. But always gets error 2 in onError method callback. I tried to use different parameters for NetworkScanRequest, but nothing helps.
According documentation carrier privileges and ACCESS_FINE_LOCATION permission should be enough to request scan, but error always is 2. logcat doesn't show any errors, just request of scanning.
Is it possible to use this method from user application with carrier privileges or application should be more privileged, for example, system-wide, stored in ROM or something else?