Loading src/java/com/android/internal/telephony/GsmCdmaPhone.java +30 −1 Original line number Diff line number Diff line Loading @@ -2087,7 +2087,8 @@ public class GsmCdmaPhone extends Phone { @Override public void getAvailableNetworks(Message response) { if (isPhoneTypeGsm() || isPhoneTypeCdmaLte()) { mCi.getAvailableNetworks(response); Message msg = obtainMessage(EVENT_GET_AVAILABLE_NETWORKS_DONE, response); mCi.getAvailableNetworks(msg); } else { loge("getAvailableNetworks: not possible in CDMA"); } Loading Loading @@ -2747,6 +2748,34 @@ public class GsmCdmaPhone extends Phone { case EVENT_DEVICE_PROVISIONING_DATA_SETTING_CHANGE: mDataEnabledSettings.updateProvisioningDataEnabled(); break; case EVENT_GET_AVAILABLE_NETWORKS_DONE: ar = (AsyncResult) msg.obj; if (ar.exception == null && ar.result != null && mSST != null) { List<OperatorInfo> operatorInfoList = (List<OperatorInfo>) ar.result; List<OperatorInfo> filteredInfoList = new ArrayList<>(); for (OperatorInfo operatorInfo : operatorInfoList) { if (OperatorInfo.State.CURRENT == operatorInfo.getState()) { filteredInfoList.add(new OperatorInfo( mSST.filterOperatorNameByPattern( operatorInfo.getOperatorAlphaLong()), mSST.filterOperatorNameByPattern( operatorInfo.getOperatorAlphaShort()), operatorInfo.getOperatorNumeric(), operatorInfo.getState() )); } else { filteredInfoList.add(operatorInfo); } } ar.result = filteredInfoList; } onComplete = (Message) ar.userObj; if (onComplete != null) { AsyncResult.forMessage(onComplete, ar.result, ar.exception); onComplete.sendToTarget(); } break; default: super.handleMessage(msg); } Loading src/java/com/android/internal/telephony/NetworkScanRequestTracker.java +5 −0 Original line number Diff line number Diff line Loading @@ -437,6 +437,11 @@ public final class NetworkScanRequestTracker { ? TelephonyScanManager.CALLBACK_SCAN_RESULTS : TelephonyScanManager.CALLBACK_RESTRICTED_SCAN_RESULTS; if (nsr.scanError == NetworkScan.SUCCESS) { if (nsri.mPhone.getServiceStateTracker() != null) { nsri.mPhone.getServiceStateTracker().updateOperatorNameForCellInfo( nsr.networkInfos); } notifyMessenger(nsri, notifyMsg, rilErrorToScanError(nsr.scanError), nsr.networkInfos); if (nsr.scanStatus == NetworkScanResult.SCAN_STATUS_COMPLETE) { Loading src/java/com/android/internal/telephony/Phone.java +2 −1 Original line number Diff line number Diff line Loading @@ -223,8 +223,9 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { protected static final int EVENT_SET_CARRIER_DATA_ENABLED = 48; protected static final int EVENT_DEVICE_PROVISIONED_CHANGE = 49; protected static final int EVENT_DEVICE_PROVISIONING_DATA_SETTING_CHANGE = 50; protected static final int EVENT_GET_AVAILABLE_NETWORKS_DONE = 51; protected static final int EVENT_LAST = EVENT_DEVICE_PROVISIONING_DATA_SETTING_CHANGE; protected static final int EVENT_LAST = EVENT_GET_AVAILABLE_NETWORKS_DONE; // For shared prefs. private static final String GSM_ROAMING_LIST_OVERRIDE_PREFIX = "gsm_roaming_list_"; Loading src/java/com/android/internal/telephony/ServiceStateTracker.java +29 −9 Original line number Diff line number Diff line Loading @@ -4589,11 +4589,7 @@ public class ServiceStateTracker extends Handler { if (config != null) { updateLteEarfcnLists(config); updateReportingCriteria(config); String operatorNamePattern = config.getString( CarrierConfigManager.KEY_OPERATOR_NAME_FILTER_PATTERN_STRING); if (!TextUtils.isEmpty(operatorNamePattern)) { mOperatorNameStringPattern = Pattern.compile(operatorNamePattern); } updateOperatorNamePattern(config); } // Sometimes the network registration information comes before carrier config is ready. Loading Loading @@ -5319,6 +5315,17 @@ public class ServiceStateTracker extends Handler { return mEriManager.getCdmaEriText(roamInd, defRoamInd); } private void updateOperatorNamePattern(PersistableBundle config) { String operatorNamePattern = config.getString( CarrierConfigManager.KEY_OPERATOR_NAME_FILTER_PATTERN_STRING); if (!TextUtils.isEmpty(operatorNamePattern)) { mOperatorNameStringPattern = Pattern.compile(operatorNamePattern); if (DBG) { log("mOperatorNameStringPattern: " + mOperatorNameStringPattern.toString()); } } } private void updateOperatorNameForServiceState(ServiceState servicestate) { if (servicestate == null) { return; Loading Loading @@ -5350,16 +5357,29 @@ public class ServiceStateTracker extends Handler { filterOperatorNameByPattern((String) cellIdentity.getOperatorAlphaShort())); } private void updateOperatorNameForCellInfo(List<CellInfo> cellInfos) { /** * To modify the operator name of CellInfo by pattern. * * @param cellInfos List of CellInfo{@link CellInfo}. */ public void updateOperatorNameForCellInfo(List<CellInfo> cellInfos) { if (cellInfos == null || cellInfos.isEmpty()) { return; } for (int i = 0; i < cellInfos.size(); i++) { updateOperatorNameForCellIdentity(cellInfos.get(i).getCellIdentity()); for (CellInfo cellInfo : cellInfos) { if (cellInfo.isRegistered()) { updateOperatorNameForCellIdentity(cellInfo.getCellIdentity()); } } } private String filterOperatorNameByPattern(String operatorName) { /** * To modify the operator name by pattern. * * @param operatorName Registered operator name * @return An operator name. */ public String filterOperatorNameByPattern(String operatorName) { if (mOperatorNameStringPattern == null || TextUtils.isEmpty(operatorName)) { return operatorName; } Loading Loading
src/java/com/android/internal/telephony/GsmCdmaPhone.java +30 −1 Original line number Diff line number Diff line Loading @@ -2087,7 +2087,8 @@ public class GsmCdmaPhone extends Phone { @Override public void getAvailableNetworks(Message response) { if (isPhoneTypeGsm() || isPhoneTypeCdmaLte()) { mCi.getAvailableNetworks(response); Message msg = obtainMessage(EVENT_GET_AVAILABLE_NETWORKS_DONE, response); mCi.getAvailableNetworks(msg); } else { loge("getAvailableNetworks: not possible in CDMA"); } Loading Loading @@ -2747,6 +2748,34 @@ public class GsmCdmaPhone extends Phone { case EVENT_DEVICE_PROVISIONING_DATA_SETTING_CHANGE: mDataEnabledSettings.updateProvisioningDataEnabled(); break; case EVENT_GET_AVAILABLE_NETWORKS_DONE: ar = (AsyncResult) msg.obj; if (ar.exception == null && ar.result != null && mSST != null) { List<OperatorInfo> operatorInfoList = (List<OperatorInfo>) ar.result; List<OperatorInfo> filteredInfoList = new ArrayList<>(); for (OperatorInfo operatorInfo : operatorInfoList) { if (OperatorInfo.State.CURRENT == operatorInfo.getState()) { filteredInfoList.add(new OperatorInfo( mSST.filterOperatorNameByPattern( operatorInfo.getOperatorAlphaLong()), mSST.filterOperatorNameByPattern( operatorInfo.getOperatorAlphaShort()), operatorInfo.getOperatorNumeric(), operatorInfo.getState() )); } else { filteredInfoList.add(operatorInfo); } } ar.result = filteredInfoList; } onComplete = (Message) ar.userObj; if (onComplete != null) { AsyncResult.forMessage(onComplete, ar.result, ar.exception); onComplete.sendToTarget(); } break; default: super.handleMessage(msg); } Loading
src/java/com/android/internal/telephony/NetworkScanRequestTracker.java +5 −0 Original line number Diff line number Diff line Loading @@ -437,6 +437,11 @@ public final class NetworkScanRequestTracker { ? TelephonyScanManager.CALLBACK_SCAN_RESULTS : TelephonyScanManager.CALLBACK_RESTRICTED_SCAN_RESULTS; if (nsr.scanError == NetworkScan.SUCCESS) { if (nsri.mPhone.getServiceStateTracker() != null) { nsri.mPhone.getServiceStateTracker().updateOperatorNameForCellInfo( nsr.networkInfos); } notifyMessenger(nsri, notifyMsg, rilErrorToScanError(nsr.scanError), nsr.networkInfos); if (nsr.scanStatus == NetworkScanResult.SCAN_STATUS_COMPLETE) { Loading
src/java/com/android/internal/telephony/Phone.java +2 −1 Original line number Diff line number Diff line Loading @@ -223,8 +223,9 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { protected static final int EVENT_SET_CARRIER_DATA_ENABLED = 48; protected static final int EVENT_DEVICE_PROVISIONED_CHANGE = 49; protected static final int EVENT_DEVICE_PROVISIONING_DATA_SETTING_CHANGE = 50; protected static final int EVENT_GET_AVAILABLE_NETWORKS_DONE = 51; protected static final int EVENT_LAST = EVENT_DEVICE_PROVISIONING_DATA_SETTING_CHANGE; protected static final int EVENT_LAST = EVENT_GET_AVAILABLE_NETWORKS_DONE; // For shared prefs. private static final String GSM_ROAMING_LIST_OVERRIDE_PREFIX = "gsm_roaming_list_"; Loading
src/java/com/android/internal/telephony/ServiceStateTracker.java +29 −9 Original line number Diff line number Diff line Loading @@ -4589,11 +4589,7 @@ public class ServiceStateTracker extends Handler { if (config != null) { updateLteEarfcnLists(config); updateReportingCriteria(config); String operatorNamePattern = config.getString( CarrierConfigManager.KEY_OPERATOR_NAME_FILTER_PATTERN_STRING); if (!TextUtils.isEmpty(operatorNamePattern)) { mOperatorNameStringPattern = Pattern.compile(operatorNamePattern); } updateOperatorNamePattern(config); } // Sometimes the network registration information comes before carrier config is ready. Loading Loading @@ -5319,6 +5315,17 @@ public class ServiceStateTracker extends Handler { return mEriManager.getCdmaEriText(roamInd, defRoamInd); } private void updateOperatorNamePattern(PersistableBundle config) { String operatorNamePattern = config.getString( CarrierConfigManager.KEY_OPERATOR_NAME_FILTER_PATTERN_STRING); if (!TextUtils.isEmpty(operatorNamePattern)) { mOperatorNameStringPattern = Pattern.compile(operatorNamePattern); if (DBG) { log("mOperatorNameStringPattern: " + mOperatorNameStringPattern.toString()); } } } private void updateOperatorNameForServiceState(ServiceState servicestate) { if (servicestate == null) { return; Loading Loading @@ -5350,16 +5357,29 @@ public class ServiceStateTracker extends Handler { filterOperatorNameByPattern((String) cellIdentity.getOperatorAlphaShort())); } private void updateOperatorNameForCellInfo(List<CellInfo> cellInfos) { /** * To modify the operator name of CellInfo by pattern. * * @param cellInfos List of CellInfo{@link CellInfo}. */ public void updateOperatorNameForCellInfo(List<CellInfo> cellInfos) { if (cellInfos == null || cellInfos.isEmpty()) { return; } for (int i = 0; i < cellInfos.size(); i++) { updateOperatorNameForCellIdentity(cellInfos.get(i).getCellIdentity()); for (CellInfo cellInfo : cellInfos) { if (cellInfo.isRegistered()) { updateOperatorNameForCellIdentity(cellInfo.getCellIdentity()); } } } private String filterOperatorNameByPattern(String operatorName) { /** * To modify the operator name by pattern. * * @param operatorName Registered operator name * @return An operator name. */ public String filterOperatorNameByPattern(String operatorName) { if (mOperatorNameStringPattern == null || TextUtils.isEmpty(operatorName)) { return operatorName; } Loading