Loading src/java/com/android/internal/telephony/DefaultPhoneNotifier.java +2 −1 Original line number Diff line number Diff line Loading @@ -246,9 +246,10 @@ public class DefaultPhoneNotifier implements PhoneNotifier { public void notifyPhysicalChannelConfiguration(Phone sender, List<PhysicalChannelConfig> configs) { int subId = sender.getSubId(); int phoneId = sender.getPhoneId(); try { if (mRegistry != null) { mRegistry.notifyPhysicalChannelConfigurationForSubscriber(subId, configs); mRegistry.notifyPhysicalChannelConfigurationForSubscriber(phoneId, subId, configs); } } catch (RemoteException ex) { // system process is dead Loading src/java/com/android/internal/telephony/LocaleTracker.java +1 −1 Original line number Diff line number Diff line Loading @@ -116,7 +116,7 @@ public class LocaleTracker extends Handler { /** Count of invalid cell info we've got so far. Will reset once we get a successful one */ private int mFailCellInfoCount; /** The ISO-3166 code of device's current country */ /** The ISO-3166 two-letter code of device's current country */ @Nullable private String mCurrentCountryIso; Loading src/java/com/android/internal/telephony/ServiceStateTracker.java +33 −4 Original line number Diff line number Diff line Loading @@ -570,6 +570,7 @@ public class ServiceStateTracker extends Handler { private String mPrlVersion; private boolean mIsMinInfoReady = false; private boolean mIsEriTextLoaded = false; private String mEriText; @UnsupportedAppUsage private boolean mIsSubscriptionFromRuim = false; private CdmaSubscriptionSourceManager mCdmaSSM; Loading Loading @@ -2657,9 +2658,7 @@ public class ServiceStateTracker extends Handler { showPlmn = true; // Force display no service final boolean forceDisplayNoService = mPhone.getContext().getResources().getBoolean( com.android.internal.R.bool.config_display_no_service_when_sim_unready) && !mIsSimReady; final boolean forceDisplayNoService = shouldForceDisplayNoService() && !mIsSimReady; if (!forceDisplayNoService && Phone.isEmergencyCallOnly()) { // No service but emergency call allowed plmn = Resources.getSystem(). Loading Loading @@ -2770,6 +2769,28 @@ public class ServiceStateTracker extends Handler { log("updateSpnDisplayLegacy-"); } /** * Checks whether force to display "no service" to the user based on the current country. * * This method should only be used when SIM is unready. * * @return {@code True} if "no service" should be displayed. */ public boolean shouldForceDisplayNoService() { String[] countriesWithNoService = mPhone.getContext().getResources().getStringArray( com.android.internal.R.array.config_display_no_service_when_sim_unready); if (ArrayUtils.isEmpty(countriesWithNoService)) { return false; } String currentCountry = mLocaleTracker.getCurrentCountry(); for (String country : countriesWithNoService) { if (country.equalsIgnoreCase(currentCountry)) { return true; } } return false; } protected void setPowerStateToDesired() { if (DBG) { String tmpLog = "mDeviceShuttingDown=" + mDeviceShuttingDown + Loading Loading @@ -3304,9 +3325,17 @@ public class ServiceStateTracker extends Handler { setNotification(CS_REJECT_CAUSE_ENABLED); } if (hasChanged) { String eriText = mPhone.getCdmaEriText(); boolean hasEriChanged = !TextUtils.equals(mEriText, eriText); mEriText = eriText; // Trigger updateSpnDisplay when // 1. Service state is changed. // 2. phone type is Cdma or CdmaLte and ERI text has changed. if (hasChanged || (!mPhone.isPhoneTypeGsm() && hasEriChanged)) { updateSpnDisplay(); } if (hasChanged) { tm.setNetworkOperatorNameForPhone(mPhone.getPhoneId(), mSS.getOperatorAlpha()); String operatorNumeric = mSS.getOperatorNumeric(); Loading src/java/com/android/internal/telephony/cdnr/CarrierDisplayNameResolver.java +2 −3 Original line number Diff line number Diff line Loading @@ -377,9 +377,8 @@ public class CarrierDisplayNameResolver { String plmn = null; boolean isSimReady = mPhone.getUiccCardApplication() != null && mPhone.getUiccCardApplication().getState() == AppState.APPSTATE_READY; boolean forceDisplayNoService = mContext.getResources().getBoolean( com.android.internal.R.bool.config_display_no_service_when_sim_unready) && !isSimReady; boolean forceDisplayNoService = mPhone.getServiceStateTracker().shouldForceDisplayNoService() && !isSimReady; ServiceState ss = getServiceState(); if (ss.getVoiceRegState() == ServiceState.STATE_POWER_OFF || forceDisplayNoService || !Phone.isEmergencyCallOnly()) { Loading src/java/com/android/internal/telephony/dataconnection/DataConnection.java +8 −1 Original line number Diff line number Diff line Loading @@ -1861,6 +1861,14 @@ public class DataConnection extends StateMachine { mApnSetting != null ? mApnSetting.canHandleType(ApnSetting.TYPE_DEFAULT) : false); setHandoverState(HANDOVER_STATE_IDLE); // restricted evaluation depends on network requests from apnContext. The evaluation // should happen once entering connecting state rather than active state because it's // possible that restricted network request can be released during the connecting window // and if we wait for connection established, then we might mistakenly // consider it as un-restricted. ConnectivityService then will immediately // tear down the connection through networkAgent unwanted callback if all requests for // this connection are going away. mRestrictedNetworkOverride = shouldRestrictNetwork(); } @Override public boolean processMessage(Message msg) { Loading Loading @@ -2009,7 +2017,6 @@ public class DataConnection extends StateMachine { // set skip464xlat if it is not default otherwise misc.skip464xlat = shouldSkip464Xlat(); mRestrictedNetworkOverride = shouldRestrictNetwork(); mUnmeteredUseOnly = isUnmeteredUseOnly(); if (DBG) { Loading Loading
src/java/com/android/internal/telephony/DefaultPhoneNotifier.java +2 −1 Original line number Diff line number Diff line Loading @@ -246,9 +246,10 @@ public class DefaultPhoneNotifier implements PhoneNotifier { public void notifyPhysicalChannelConfiguration(Phone sender, List<PhysicalChannelConfig> configs) { int subId = sender.getSubId(); int phoneId = sender.getPhoneId(); try { if (mRegistry != null) { mRegistry.notifyPhysicalChannelConfigurationForSubscriber(subId, configs); mRegistry.notifyPhysicalChannelConfigurationForSubscriber(phoneId, subId, configs); } } catch (RemoteException ex) { // system process is dead Loading
src/java/com/android/internal/telephony/LocaleTracker.java +1 −1 Original line number Diff line number Diff line Loading @@ -116,7 +116,7 @@ public class LocaleTracker extends Handler { /** Count of invalid cell info we've got so far. Will reset once we get a successful one */ private int mFailCellInfoCount; /** The ISO-3166 code of device's current country */ /** The ISO-3166 two-letter code of device's current country */ @Nullable private String mCurrentCountryIso; Loading
src/java/com/android/internal/telephony/ServiceStateTracker.java +33 −4 Original line number Diff line number Diff line Loading @@ -570,6 +570,7 @@ public class ServiceStateTracker extends Handler { private String mPrlVersion; private boolean mIsMinInfoReady = false; private boolean mIsEriTextLoaded = false; private String mEriText; @UnsupportedAppUsage private boolean mIsSubscriptionFromRuim = false; private CdmaSubscriptionSourceManager mCdmaSSM; Loading Loading @@ -2657,9 +2658,7 @@ public class ServiceStateTracker extends Handler { showPlmn = true; // Force display no service final boolean forceDisplayNoService = mPhone.getContext().getResources().getBoolean( com.android.internal.R.bool.config_display_no_service_when_sim_unready) && !mIsSimReady; final boolean forceDisplayNoService = shouldForceDisplayNoService() && !mIsSimReady; if (!forceDisplayNoService && Phone.isEmergencyCallOnly()) { // No service but emergency call allowed plmn = Resources.getSystem(). Loading Loading @@ -2770,6 +2769,28 @@ public class ServiceStateTracker extends Handler { log("updateSpnDisplayLegacy-"); } /** * Checks whether force to display "no service" to the user based on the current country. * * This method should only be used when SIM is unready. * * @return {@code True} if "no service" should be displayed. */ public boolean shouldForceDisplayNoService() { String[] countriesWithNoService = mPhone.getContext().getResources().getStringArray( com.android.internal.R.array.config_display_no_service_when_sim_unready); if (ArrayUtils.isEmpty(countriesWithNoService)) { return false; } String currentCountry = mLocaleTracker.getCurrentCountry(); for (String country : countriesWithNoService) { if (country.equalsIgnoreCase(currentCountry)) { return true; } } return false; } protected void setPowerStateToDesired() { if (DBG) { String tmpLog = "mDeviceShuttingDown=" + mDeviceShuttingDown + Loading Loading @@ -3304,9 +3325,17 @@ public class ServiceStateTracker extends Handler { setNotification(CS_REJECT_CAUSE_ENABLED); } if (hasChanged) { String eriText = mPhone.getCdmaEriText(); boolean hasEriChanged = !TextUtils.equals(mEriText, eriText); mEriText = eriText; // Trigger updateSpnDisplay when // 1. Service state is changed. // 2. phone type is Cdma or CdmaLte and ERI text has changed. if (hasChanged || (!mPhone.isPhoneTypeGsm() && hasEriChanged)) { updateSpnDisplay(); } if (hasChanged) { tm.setNetworkOperatorNameForPhone(mPhone.getPhoneId(), mSS.getOperatorAlpha()); String operatorNumeric = mSS.getOperatorNumeric(); Loading
src/java/com/android/internal/telephony/cdnr/CarrierDisplayNameResolver.java +2 −3 Original line number Diff line number Diff line Loading @@ -377,9 +377,8 @@ public class CarrierDisplayNameResolver { String plmn = null; boolean isSimReady = mPhone.getUiccCardApplication() != null && mPhone.getUiccCardApplication().getState() == AppState.APPSTATE_READY; boolean forceDisplayNoService = mContext.getResources().getBoolean( com.android.internal.R.bool.config_display_no_service_when_sim_unready) && !isSimReady; boolean forceDisplayNoService = mPhone.getServiceStateTracker().shouldForceDisplayNoService() && !isSimReady; ServiceState ss = getServiceState(); if (ss.getVoiceRegState() == ServiceState.STATE_POWER_OFF || forceDisplayNoService || !Phone.isEmergencyCallOnly()) { Loading
src/java/com/android/internal/telephony/dataconnection/DataConnection.java +8 −1 Original line number Diff line number Diff line Loading @@ -1861,6 +1861,14 @@ public class DataConnection extends StateMachine { mApnSetting != null ? mApnSetting.canHandleType(ApnSetting.TYPE_DEFAULT) : false); setHandoverState(HANDOVER_STATE_IDLE); // restricted evaluation depends on network requests from apnContext. The evaluation // should happen once entering connecting state rather than active state because it's // possible that restricted network request can be released during the connecting window // and if we wait for connection established, then we might mistakenly // consider it as un-restricted. ConnectivityService then will immediately // tear down the connection through networkAgent unwanted callback if all requests for // this connection are going away. mRestrictedNetworkOverride = shouldRestrictNetwork(); } @Override public boolean processMessage(Message msg) { Loading Loading @@ -2009,7 +2017,6 @@ public class DataConnection extends StateMachine { // set skip464xlat if it is not default otherwise misc.skip464xlat = shouldSkip464Xlat(); mRestrictedNetworkOverride = shouldRestrictNetwork(); mUnmeteredUseOnly = isUnmeteredUseOnly(); if (DBG) { Loading