Loading src/java/com/android/internal/telephony/ServiceStateTracker.java +1 −1 Original line number Diff line number Diff line Loading @@ -2251,7 +2251,7 @@ public class ServiceStateTracker extends Handler { IccRecords iccRecords = mIccRecords; String plmn = null; boolean showPlmn = false; int rule = (iccRecords != null) ? iccRecords.getDisplayRule(mSS.getOperatorNumeric()) : 0; int rule = (iccRecords != null) ? iccRecords.getDisplayRule(mSS) : 0; if (combinedRegState == ServiceState.STATE_OUT_OF_SERVICE || combinedRegState == ServiceState.STATE_EMERGENCY_ONLY) { showPlmn = true; Loading src/java/com/android/internal/telephony/uicc/IccRecords.java +10 −3 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.os.Message; import android.os.Registrant; import android.os.RegistrantList; import android.telephony.Rlog; import android.telephony.ServiceState; import android.telephony.SubscriptionInfo; import android.telephony.TelephonyManager; import android.text.TextUtils; Loading Loading @@ -666,13 +667,19 @@ public abstract class IccRecords extends Handler implements IccConstants { /** * Returns the SpnDisplayRule based on settings on the SIM and the * specified plmn (currently-registered PLMN). See TS 22.101 Annex A * and TS 51.011 10.3.11 for details. * current service state. See TS 22.101 Annex A and TS 51.011 10.3.11 * for details. * * If the SPN is not found on the SIM, the rule is always PLMN_ONLY. * Generally used for GSM/UMTS and the like SIMs. * * @param serviceState Service state * @return the display rule * * @see #SPN_RULE_SHOW_SPN * @see #SPN_RULE_SHOW_PLMN */ public abstract int getDisplayRule(String plmn); public abstract int getDisplayRule(ServiceState serviceState); /** * Return true if "Restriction of menu options for manual PLMN selection" Loading src/java/com/android/internal/telephony/uicc/IsimUiccRecords.java +2 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.content.Intent; import android.os.AsyncResult; import android.os.Message; import android.telephony.Rlog; import android.telephony.ServiceState; import android.text.TextUtils; import com.android.internal.telephony.CommandsInterface; Loading Loading @@ -457,7 +458,7 @@ public class IsimUiccRecords extends IccRecords implements IsimRecords { } @Override public int getDisplayRule(String plmn) { public int getDisplayRule(ServiceState serviceState) { // Not applicable to Isim return 0; } Loading src/java/com/android/internal/telephony/uicc/RuimRecords.java +2 −1 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.os.AsyncResult; import android.os.Message; import android.os.SystemProperties; import android.telephony.Rlog; import android.telephony.ServiceState; import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionManager; import android.text.TextUtils; Loading Loading @@ -868,7 +869,7 @@ public class RuimRecords extends IccRecords { * No Display rule for RUIMs yet. */ @Override public int getDisplayRule(String plmn) { public int getDisplayRule(ServiceState serviceState) { // TODO together with spn return 0; } Loading src/java/com/android/internal/telephony/uicc/SIMRecords.java +28 −4 Original line number Diff line number Diff line Loading @@ -23,9 +23,11 @@ import android.content.IntentFilter; import android.content.res.Resources; import android.os.AsyncResult; import android.os.Message; import android.os.PersistableBundle; import android.telephony.CarrierConfigManager; import android.telephony.PhoneNumberUtils; import android.telephony.Rlog; import android.telephony.ServiceState; import android.telephony.SmsMessage; import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionManager; Loading Loading @@ -1844,14 +1846,20 @@ public class SIMRecords extends IccRecords { /** * Returns the SpnDisplayRule based on settings on the SIM and the * specified plmn (currently-registered PLMN). See TS 22.101 Annex A * and TS 51.011 10.3.11 for details. * current service state. See TS 22.101 Annex A and TS 51.011 10.3.11 * for details. * * If the SPN is not found on the SIM or is empty, the rule is * always PLMN_ONLY. * * @param serviceState Service state * @return the display rule * * @see #SPN_RULE_SHOW_SPN * @see #SPN_RULE_SHOW_PLMN */ @Override public int getDisplayRule(String plmn) { public int getDisplayRule(ServiceState serviceState) { int rule; if (mParentApp != null && mParentApp.getUiccCard() != null && Loading @@ -1861,7 +1869,8 @@ public class SIMRecords extends IccRecords { } else if (TextUtils.isEmpty(getServiceProviderName()) || mSpnDisplayCondition == -1) { // No EF_SPN content was found on the SIM, or not yet loaded. Just show ONS. rule = SPN_RULE_SHOW_PLMN; } else if (isOnMatchingPlmn(plmn)) { } else if (useRoamingFromServiceState() ? !serviceState.getRoaming() : isOnMatchingPlmn(serviceState.getOperatorNumeric())) { rule = SPN_RULE_SHOW_SPN; if ((mSpnDisplayCondition & 0x01) == 0x01) { // ONS required when registered to HPLMN or PLMN in EF_SPDI Loading @@ -1877,6 +1886,21 @@ public class SIMRecords extends IccRecords { return rule; } private boolean useRoamingFromServiceState() { CarrierConfigManager configManager = (CarrierConfigManager) mContext.getSystemService(Context.CARRIER_CONFIG_SERVICE); if (configManager != null) { PersistableBundle b = configManager.getConfigForSubId( SubscriptionController.getInstance().getSubIdUsingPhoneId( mParentApp.getPhoneId())); if (b != null && b.getBoolean(CarrierConfigManager .KEY_SPN_DISPLAY_RULE_USE_ROAMING_FROM_SERVICE_STATE_BOOL)) { return true; } } return false; } /** * Checks if plmn is HPLMN or on the spdiNetworks list. */ Loading Loading
src/java/com/android/internal/telephony/ServiceStateTracker.java +1 −1 Original line number Diff line number Diff line Loading @@ -2251,7 +2251,7 @@ public class ServiceStateTracker extends Handler { IccRecords iccRecords = mIccRecords; String plmn = null; boolean showPlmn = false; int rule = (iccRecords != null) ? iccRecords.getDisplayRule(mSS.getOperatorNumeric()) : 0; int rule = (iccRecords != null) ? iccRecords.getDisplayRule(mSS) : 0; if (combinedRegState == ServiceState.STATE_OUT_OF_SERVICE || combinedRegState == ServiceState.STATE_EMERGENCY_ONLY) { showPlmn = true; Loading
src/java/com/android/internal/telephony/uicc/IccRecords.java +10 −3 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.os.Message; import android.os.Registrant; import android.os.RegistrantList; import android.telephony.Rlog; import android.telephony.ServiceState; import android.telephony.SubscriptionInfo; import android.telephony.TelephonyManager; import android.text.TextUtils; Loading Loading @@ -666,13 +667,19 @@ public abstract class IccRecords extends Handler implements IccConstants { /** * Returns the SpnDisplayRule based on settings on the SIM and the * specified plmn (currently-registered PLMN). See TS 22.101 Annex A * and TS 51.011 10.3.11 for details. * current service state. See TS 22.101 Annex A and TS 51.011 10.3.11 * for details. * * If the SPN is not found on the SIM, the rule is always PLMN_ONLY. * Generally used for GSM/UMTS and the like SIMs. * * @param serviceState Service state * @return the display rule * * @see #SPN_RULE_SHOW_SPN * @see #SPN_RULE_SHOW_PLMN */ public abstract int getDisplayRule(String plmn); public abstract int getDisplayRule(ServiceState serviceState); /** * Return true if "Restriction of menu options for manual PLMN selection" Loading
src/java/com/android/internal/telephony/uicc/IsimUiccRecords.java +2 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.content.Intent; import android.os.AsyncResult; import android.os.Message; import android.telephony.Rlog; import android.telephony.ServiceState; import android.text.TextUtils; import com.android.internal.telephony.CommandsInterface; Loading Loading @@ -457,7 +458,7 @@ public class IsimUiccRecords extends IccRecords implements IsimRecords { } @Override public int getDisplayRule(String plmn) { public int getDisplayRule(ServiceState serviceState) { // Not applicable to Isim return 0; } Loading
src/java/com/android/internal/telephony/uicc/RuimRecords.java +2 −1 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.os.AsyncResult; import android.os.Message; import android.os.SystemProperties; import android.telephony.Rlog; import android.telephony.ServiceState; import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionManager; import android.text.TextUtils; Loading Loading @@ -868,7 +869,7 @@ public class RuimRecords extends IccRecords { * No Display rule for RUIMs yet. */ @Override public int getDisplayRule(String plmn) { public int getDisplayRule(ServiceState serviceState) { // TODO together with spn return 0; } Loading
src/java/com/android/internal/telephony/uicc/SIMRecords.java +28 −4 Original line number Diff line number Diff line Loading @@ -23,9 +23,11 @@ import android.content.IntentFilter; import android.content.res.Resources; import android.os.AsyncResult; import android.os.Message; import android.os.PersistableBundle; import android.telephony.CarrierConfigManager; import android.telephony.PhoneNumberUtils; import android.telephony.Rlog; import android.telephony.ServiceState; import android.telephony.SmsMessage; import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionManager; Loading Loading @@ -1844,14 +1846,20 @@ public class SIMRecords extends IccRecords { /** * Returns the SpnDisplayRule based on settings on the SIM and the * specified plmn (currently-registered PLMN). See TS 22.101 Annex A * and TS 51.011 10.3.11 for details. * current service state. See TS 22.101 Annex A and TS 51.011 10.3.11 * for details. * * If the SPN is not found on the SIM or is empty, the rule is * always PLMN_ONLY. * * @param serviceState Service state * @return the display rule * * @see #SPN_RULE_SHOW_SPN * @see #SPN_RULE_SHOW_PLMN */ @Override public int getDisplayRule(String plmn) { public int getDisplayRule(ServiceState serviceState) { int rule; if (mParentApp != null && mParentApp.getUiccCard() != null && Loading @@ -1861,7 +1869,8 @@ public class SIMRecords extends IccRecords { } else if (TextUtils.isEmpty(getServiceProviderName()) || mSpnDisplayCondition == -1) { // No EF_SPN content was found on the SIM, or not yet loaded. Just show ONS. rule = SPN_RULE_SHOW_PLMN; } else if (isOnMatchingPlmn(plmn)) { } else if (useRoamingFromServiceState() ? !serviceState.getRoaming() : isOnMatchingPlmn(serviceState.getOperatorNumeric())) { rule = SPN_RULE_SHOW_SPN; if ((mSpnDisplayCondition & 0x01) == 0x01) { // ONS required when registered to HPLMN or PLMN in EF_SPDI Loading @@ -1877,6 +1886,21 @@ public class SIMRecords extends IccRecords { return rule; } private boolean useRoamingFromServiceState() { CarrierConfigManager configManager = (CarrierConfigManager) mContext.getSystemService(Context.CARRIER_CONFIG_SERVICE); if (configManager != null) { PersistableBundle b = configManager.getConfigForSubId( SubscriptionController.getInstance().getSubIdUsingPhoneId( mParentApp.getPhoneId())); if (b != null && b.getBoolean(CarrierConfigManager .KEY_SPN_DISPLAY_RULE_USE_ROAMING_FROM_SERVICE_STATE_BOOL)) { return true; } } return false; } /** * Checks if plmn is HPLMN or on the spdiNetworks list. */ Loading