Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3631b5cc authored by Jack Yu's avatar Jack Yu Committed by Android Git Automerger
Browse files

am ca474793: Merge "Fixed that no service was shown after boot up" into mnc-dev

* commit 'ca474793':
  Fixed that no service was shown after boot up
parents 4eeb288c ca474793
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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;

@@ -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();
                }
            }
        }
+9 −2
Original line number Diff line number Diff line
@@ -572,7 +572,13 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
        String plmn = mSS.getOperatorAlphaLong();
        boolean showPlmn = false;

        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
@@ -580,7 +586,7 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
            showPlmn = plmn != null;
            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);
@@ -597,6 +603,7 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
            }
        }

        mSubId = subId;
        mCurShowSpn = false;
        mCurShowPlmn = showPlmn;
        mCurSpn = "";
+11 −3
Original line number Diff line number Diff line
@@ -645,8 +645,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)
@@ -654,8 +661,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);
@@ -673,6 +680,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
            }
        }

        mSubId = subId;
        mCurShowSpn = showSpn;
        mCurShowPlmn = showPlmn;
        mCurSpn = spn;