Loading src/java/com/android/internal/telephony/ServiceStateTracker.java +6 −0 Original line number Diff line number Diff line Loading @@ -239,6 +239,7 @@ public abstract class ServiceStateTracker extends Handler { protected String mCurPlmn = null; protected boolean mCurShowPlmn = false; protected boolean mCurShowSpn = false; protected int mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; private boolean mImsRegistered = false; Loading Loading @@ -303,6 +304,11 @@ public abstract class ServiceStateTracker extends Handler { editor.remove(PhoneBase.NETWORK_SELECTION_SHORT_KEY); editor.commit(); } // Once sub id becomes valid, we need to update the service provider name // displayed on the UI again. The old SPN update intents sent to // MobileSignalController earlier were actually ignored due to invalid sub id. updateSpnDisplay(); } } } Loading src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java +9 −2 Original line number Diff line number Diff line Loading @@ -576,14 +576,20 @@ public class CdmaServiceStateTracker extends ServiceStateTracker { showPlmn = plmn != null; if (!TextUtils.equals(plmn, mCurPlmn)) { int subId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; int[] subIds = SubscriptionManager.getSubId(mPhone.getPhoneId()); if (subIds != null && subIds.length > 0) { subId = subIds[0]; } 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 // null and not blank. But this would cause us to incorrectly display // "No Service". Now showPlmn is set to true for any non null string. if (DBG) { log(String.format("updateSpnDisplay: changed sending intent" + " showPlmn='%b' plmn='%s'", showPlmn, plmn)); " showPlmn='%b' plmn='%s' subId='%d'", showPlmn, plmn, subId)); } Intent intent = new Intent(TelephonyIntents.SPN_STRINGS_UPDATED_ACTION); intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING); Loading @@ -600,6 +606,7 @@ public class CdmaServiceStateTracker extends ServiceStateTracker { } } mSubId = subId; mCurShowSpn = false; mCurShowPlmn = showPlmn; mCurSpn = ""; Loading src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java +11 −3 Original line number Diff line number Diff line Loading @@ -648,8 +648,15 @@ final class GsmServiceStateTracker extends ServiceStateTracker { showSpn = false; } int subId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; int[] subIds = SubscriptionManager.getSubId(mPhone.getPhoneId()); if (subIds != null && subIds.length > 0) { subId = subIds[0]; } // Update SPN_STRINGS_UPDATED_ACTION IFF any value changes if (showPlmn != mCurShowPlmn if (mSubId != subId || showPlmn != mCurShowPlmn || showSpn != mCurShowSpn || !TextUtils.equals(spn, mCurSpn) || !TextUtils.equals(dataSpn, mCurDataSpn) Loading @@ -657,8 +664,8 @@ final class GsmServiceStateTracker extends ServiceStateTracker { if (DBG) { log(String.format("updateSpnDisplay: changed" + " sending intent rule=" + rule + " showPlmn='%b' plmn='%s' showSpn='%b' spn='%s' dataSpn='%s'", showPlmn, plmn, showSpn, spn, dataSpn)); " showPlmn='%b' plmn='%s' showSpn='%b' spn='%s' dataSpn='%s' subId='%d'", showPlmn, plmn, showSpn, spn, dataSpn, subId)); } Intent intent = new Intent(TelephonyIntents.SPN_STRINGS_UPDATED_ACTION); intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING); Loading @@ -676,6 +683,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker { } } mSubId = subId; mCurShowSpn = showSpn; mCurShowPlmn = showPlmn; mCurSpn = spn; Loading Loading
src/java/com/android/internal/telephony/ServiceStateTracker.java +6 −0 Original line number Diff line number Diff line Loading @@ -239,6 +239,7 @@ public abstract class ServiceStateTracker extends Handler { protected String mCurPlmn = null; protected boolean mCurShowPlmn = false; protected boolean mCurShowSpn = false; protected int mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; private boolean mImsRegistered = false; Loading Loading @@ -303,6 +304,11 @@ public abstract class ServiceStateTracker extends Handler { editor.remove(PhoneBase.NETWORK_SELECTION_SHORT_KEY); editor.commit(); } // Once sub id becomes valid, we need to update the service provider name // displayed on the UI again. The old SPN update intents sent to // MobileSignalController earlier were actually ignored due to invalid sub id. updateSpnDisplay(); } } } Loading
src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java +9 −2 Original line number Diff line number Diff line Loading @@ -576,14 +576,20 @@ public class CdmaServiceStateTracker extends ServiceStateTracker { showPlmn = plmn != null; if (!TextUtils.equals(plmn, mCurPlmn)) { int subId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; int[] subIds = SubscriptionManager.getSubId(mPhone.getPhoneId()); if (subIds != null && subIds.length > 0) { subId = subIds[0]; } 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 // null and not blank. But this would cause us to incorrectly display // "No Service". Now showPlmn is set to true for any non null string. if (DBG) { log(String.format("updateSpnDisplay: changed sending intent" + " showPlmn='%b' plmn='%s'", showPlmn, plmn)); " showPlmn='%b' plmn='%s' subId='%d'", showPlmn, plmn, subId)); } Intent intent = new Intent(TelephonyIntents.SPN_STRINGS_UPDATED_ACTION); intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING); Loading @@ -600,6 +606,7 @@ public class CdmaServiceStateTracker extends ServiceStateTracker { } } mSubId = subId; mCurShowSpn = false; mCurShowPlmn = showPlmn; mCurSpn = ""; Loading
src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java +11 −3 Original line number Diff line number Diff line Loading @@ -648,8 +648,15 @@ final class GsmServiceStateTracker extends ServiceStateTracker { showSpn = false; } int subId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; int[] subIds = SubscriptionManager.getSubId(mPhone.getPhoneId()); if (subIds != null && subIds.length > 0) { subId = subIds[0]; } // Update SPN_STRINGS_UPDATED_ACTION IFF any value changes if (showPlmn != mCurShowPlmn if (mSubId != subId || showPlmn != mCurShowPlmn || showSpn != mCurShowSpn || !TextUtils.equals(spn, mCurSpn) || !TextUtils.equals(dataSpn, mCurDataSpn) Loading @@ -657,8 +664,8 @@ final class GsmServiceStateTracker extends ServiceStateTracker { if (DBG) { log(String.format("updateSpnDisplay: changed" + " sending intent rule=" + rule + " showPlmn='%b' plmn='%s' showSpn='%b' spn='%s' dataSpn='%s'", showPlmn, plmn, showSpn, spn, dataSpn)); " showPlmn='%b' plmn='%s' showSpn='%b' spn='%s' dataSpn='%s' subId='%d'", showPlmn, plmn, showSpn, spn, dataSpn, subId)); } Intent intent = new Intent(TelephonyIntents.SPN_STRINGS_UPDATED_ACTION); intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING); Loading @@ -676,6 +683,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker { } } mSubId = subId; mCurShowSpn = showSpn; mCurShowPlmn = showPlmn; mCurSpn = spn; Loading