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

Commit 648ef041 authored by Nagendra Prasad Nagarle Basavaraju's avatar Nagendra Prasad Nagarle Basavaraju Committed by Android (Google) Code Review
Browse files

Merge "[Telephony]Fix ACTION_SERVICE_PROVIDERS_UPDATED posting issue @...

Merge "[Telephony]Fix ACTION_SERVICE_PROVIDERS_UPDATED posting issue @ ServiceStateTracker" into udc-dev
parents d4fb4d07 d86ed7b6
Loading
Loading
Loading
Loading
+51 −56
Original line number Diff line number Diff line
@@ -384,7 +384,6 @@ public class ServiceStateTracker extends Handler {
            // If not, then the subId has changed, so we need to remember the old subId,
            // even if the new subId is invalid (likely).
            mPrevSubId = mSubId;
            mSubId = curSubId;

            // Update voicemail count and notify message waiting changed regardless of
            // whether the new subId is valid. This is an exception to the general logic
@@ -393,18 +392,14 @@ public class ServiceStateTracker extends Handler {
            // which seems desirable.
            mPhone.updateVoiceMail();

            if (!SubscriptionManager.isValidSubscriptionId(mSubId)) {
            if (!SubscriptionManager.isValidSubscriptionId(curSubId)) {
                if (SubscriptionManager.isValidSubscriptionId(mPrevSubId)) {
                    // just went from valid to invalid subId, so notify phone state listeners
                    // with final broadcast
                    mPhone.notifyServiceStateChangedForSubId(mOutOfServiceSS,
                            ServiceStateTracker.this.mPrevSubId);
                }
                // If the new subscription ID isn't valid, then we don't need to do all the
                // UI updating, so we're done.
                return;
            }

            } else {
                Context context = mPhone.getContext();

                mPhone.notifyPhoneStateChanged();
@@ -443,11 +438,11 @@ public class ServiceStateTracker extends Handler {
                        || !TextUtils.isEmpty(oldNetworkSelectionName)
                        || !TextUtils.isEmpty(oldNetworkSelectionShort)) {
                    SharedPreferences.Editor editor = sp.edit();
                editor.putString(Phone.NETWORK_SELECTION_KEY + mSubId,
                    editor.putString(Phone.NETWORK_SELECTION_KEY + curSubId,
                            oldNetworkSelection);
                editor.putString(Phone.NETWORK_SELECTION_NAME_KEY + mSubId,
                    editor.putString(Phone.NETWORK_SELECTION_NAME_KEY + curSubId,
                            oldNetworkSelectionName);
                editor.putString(Phone.NETWORK_SELECTION_SHORT_KEY + mSubId,
                    editor.putString(Phone.NETWORK_SELECTION_SHORT_KEY + curSubId,
                            oldNetworkSelectionShort);
                    editor.remove(Phone.NETWORK_SELECTION_KEY);
                    editor.remove(Phone.NETWORK_SELECTION_NAME_KEY);
@@ -460,6 +455,8 @@ public class ServiceStateTracker extends Handler {
                // MobileSignalController earlier were actually ignored due to invalid sub id.
                updateSpnDisplay();
            }
            mSubId = curSubId;
        }
    };

    //Common
@@ -2771,7 +2768,7 @@ public class ServiceStateTracker extends Handler {

    private void notifySpnDisplayUpdate(CarrierDisplayNameData data) {
        int subId = mPhone.getSubId();
        // Update ACTION_SERVICE_PROVIDERS_UPDATED IFF any value changes
        // Update ACTION_SERVICE_PROVIDERS_UPDATED if any value changes
        if (mSubId != subId
                || data.shouldShowPlmn() != mCurShowPlmn
                || data.shouldShowSpn() != mCurShowSpn
@@ -2815,8 +2812,6 @@ public class ServiceStateTracker extends Handler {
                }
            }
        }

        mSubId = subId;
        mCurShowSpn = data.shouldShowSpn();
        mCurShowPlmn = data.shouldShowPlmn();
        mCurSpn = data.getSpn();