Loading src/java/com/android/internal/telephony/ServiceStateTracker.java +27 −4 Original line number Diff line number Diff line Loading @@ -2144,6 +2144,7 @@ public class ServiceStateTracker extends Handler { wfcDataSpnFormat = wfcSpnFormats[dataIdx]; } int combinedRegState = getCombinedRegState(); if (mPhone.isPhoneTypeGsm()) { // The values of plmn/showPlmn change in different scenarios. // 1) No service but emergency call allowed -> expected Loading @@ -2167,8 +2168,8 @@ public class ServiceStateTracker extends Handler { String plmn = null; boolean showPlmn = false; int rule = (iccRecords != null) ? iccRecords.getDisplayRule(mSS.getOperatorNumeric()) : 0; if (mSS.getVoiceRegState() == ServiceState.STATE_OUT_OF_SERVICE || mSS.getVoiceRegState() == ServiceState.STATE_EMERGENCY_ONLY) { if (combinedRegState == ServiceState.STATE_OUT_OF_SERVICE || combinedRegState == ServiceState.STATE_EMERGENCY_ONLY) { showPlmn = true; if (mEmergencyOnly) { // No service but emergency call allowed Loading @@ -2181,7 +2182,7 @@ public class ServiceStateTracker extends Handler { } if (DBG) log("updateSpnDisplay: radio is on but out " + "of service, set plmn='" + plmn + "'"); } else if (mSS.getVoiceRegState() == ServiceState.STATE_IN_SERVICE) { } else if (combinedRegState == ServiceState.STATE_IN_SERVICE) { // In either home or roaming service plmn = mSS.getOperatorAlpha(); showPlmn = !TextUtils.isEmpty(plmn) && Loading Loading @@ -2288,6 +2289,14 @@ public class ServiceStateTracker extends Handler { plmn = null; } if (combinedRegState == ServiceState.STATE_OUT_OF_SERVICE) { plmn = Resources.getSystem().getText(com.android.internal.R.string .lockscreen_carrier_default).toString(); if (DBG) { log("updateSpnDisplay: radio is on but out of svc, set plmn='" + plmn + "'"); } } if (mSubId != subId || !TextUtils.equals(plmn, mCurPlmn)) { // Allow A blank plmn, "" to set showPlmn to true. Previously, we // would set showPlmn to true only if plmn was not empty, i.e. was not Loading Loading @@ -3312,7 +3321,7 @@ public class ServiceStateTracker extends Handler { } if (mUiccApplcation != null && mUiccApplcation.getState() == AppState.APPSTATE_READY && mIccRecords != null && (mSS.getVoiceRegState() == ServiceState.STATE_IN_SERVICE) mIccRecords != null && getCombinedRegState() == ServiceState.STATE_IN_SERVICE && !ServiceState.isLte(mSS.getRilVoiceRadioTechnology())) { // SIM is found on the device. If ERI roaming is OFF, and SID/NID matches // one configured in SIM, use operator name from CSIM record. Note that ERI, SID, Loading Loading @@ -5013,4 +5022,18 @@ public class ServiceStateTracker extends Handler { public boolean isDeviceShuttingDown() { return mDeviceShuttingDown; } /** * Consider dataRegState if voiceRegState is OOS to determine SPN to be displayed */ protected int getCombinedRegState() { int regState = mSS.getVoiceRegState(); int dataRegState = mSS.getDataRegState(); if ((regState == ServiceState.STATE_OUT_OF_SERVICE) && (dataRegState == ServiceState.STATE_IN_SERVICE)) { log("getCombinedRegState: return STATE_IN_SERVICE as Data is in service"); regState = dataRegState; } return regState; } } Loading
src/java/com/android/internal/telephony/ServiceStateTracker.java +27 −4 Original line number Diff line number Diff line Loading @@ -2144,6 +2144,7 @@ public class ServiceStateTracker extends Handler { wfcDataSpnFormat = wfcSpnFormats[dataIdx]; } int combinedRegState = getCombinedRegState(); if (mPhone.isPhoneTypeGsm()) { // The values of plmn/showPlmn change in different scenarios. // 1) No service but emergency call allowed -> expected Loading @@ -2167,8 +2168,8 @@ public class ServiceStateTracker extends Handler { String plmn = null; boolean showPlmn = false; int rule = (iccRecords != null) ? iccRecords.getDisplayRule(mSS.getOperatorNumeric()) : 0; if (mSS.getVoiceRegState() == ServiceState.STATE_OUT_OF_SERVICE || mSS.getVoiceRegState() == ServiceState.STATE_EMERGENCY_ONLY) { if (combinedRegState == ServiceState.STATE_OUT_OF_SERVICE || combinedRegState == ServiceState.STATE_EMERGENCY_ONLY) { showPlmn = true; if (mEmergencyOnly) { // No service but emergency call allowed Loading @@ -2181,7 +2182,7 @@ public class ServiceStateTracker extends Handler { } if (DBG) log("updateSpnDisplay: radio is on but out " + "of service, set plmn='" + plmn + "'"); } else if (mSS.getVoiceRegState() == ServiceState.STATE_IN_SERVICE) { } else if (combinedRegState == ServiceState.STATE_IN_SERVICE) { // In either home or roaming service plmn = mSS.getOperatorAlpha(); showPlmn = !TextUtils.isEmpty(plmn) && Loading Loading @@ -2288,6 +2289,14 @@ public class ServiceStateTracker extends Handler { plmn = null; } if (combinedRegState == ServiceState.STATE_OUT_OF_SERVICE) { plmn = Resources.getSystem().getText(com.android.internal.R.string .lockscreen_carrier_default).toString(); if (DBG) { log("updateSpnDisplay: radio is on but out of svc, set plmn='" + plmn + "'"); } } if (mSubId != subId || !TextUtils.equals(plmn, mCurPlmn)) { // Allow A blank plmn, "" to set showPlmn to true. Previously, we // would set showPlmn to true only if plmn was not empty, i.e. was not Loading Loading @@ -3312,7 +3321,7 @@ public class ServiceStateTracker extends Handler { } if (mUiccApplcation != null && mUiccApplcation.getState() == AppState.APPSTATE_READY && mIccRecords != null && (mSS.getVoiceRegState() == ServiceState.STATE_IN_SERVICE) mIccRecords != null && getCombinedRegState() == ServiceState.STATE_IN_SERVICE && !ServiceState.isLte(mSS.getRilVoiceRadioTechnology())) { // SIM is found on the device. If ERI roaming is OFF, and SID/NID matches // one configured in SIM, use operator name from CSIM record. Note that ERI, SID, Loading Loading @@ -5013,4 +5022,18 @@ public class ServiceStateTracker extends Handler { public boolean isDeviceShuttingDown() { return mDeviceShuttingDown; } /** * Consider dataRegState if voiceRegState is OOS to determine SPN to be displayed */ protected int getCombinedRegState() { int regState = mSS.getVoiceRegState(); int dataRegState = mSS.getDataRegState(); if ((regState == ServiceState.STATE_OUT_OF_SERVICE) && (dataRegState == ServiceState.STATE_IN_SERVICE)) { log("getCombinedRegState: return STATE_IN_SERVICE as Data is in service"); regState = dataRegState; } return regState; } }