in packages/@fbcmobile-signalscan/android/src/main/java/com/fbc/signalscan/CellScanResultsModule.java [159:191]
public void getCellScanResults(Promise promise) {
this.mPromise = promise;
Context context = reactContext.getApplicationContext();
if (ContextCompat.checkSelfPermission(context, Manifest.permission.READ_PHONE_STATE)
!= PackageManager.PERMISSION_GRANTED) {
WritableMap map = Arguments.createMap();
map.putString(ERROR_KEY, ERROR_CODE_PERMISSION);
Log.d(TAG, ERROR_PERMISSION);
this.mPromise.resolve(map);
return;
}
TelephonyManager teleManager =
(TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
if (teleManager == null) {
WritableMap map = Arguments.createMap();
map.putString(ERROR_KEY, ERROR_CODE_TELEPHONY_MANAGER);
Log.d(TAG, ERROR_TELEPHONY_MANAGER);
this.mPromise.resolve(map);
return;
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P
&& (teleManager.hasCarrierPrivileges()
|| ContextCompat.checkSelfPermission(context, Manifest.permission.MODIFY_PHONE_STATE)
== PackageManager.PERMISSION_GRANTED)) {
scanAllNetworks(teleManager);
} else {
scanRegisteredNetwork(teleManager);
}
}