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

Commit 8974f993 authored by Tom Hsu's avatar Tom Hsu Committed by Android (Google) Code Review
Browse files

Merge "[Settings] Resolves unsynced infomation between status bar and settings" into sc-dev

parents 0a111093 4f3ac2fc
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import android.telephony.TelephonyDisplayInfo;
import android.telephony.TelephonyManager;
import android.text.Html;
import android.util.ArraySet;
import android.util.Log;

import androidx.annotation.VisibleForTesting;
import androidx.collection.ArrayMap;
@@ -196,6 +197,7 @@ public class SubscriptionsPreferenceController extends AbstractPreferenceControl
        mSignalStrengthListener.pause();
        mTelephonyDisplayInfoListener.pause();
        unRegisterReceiver();
        resetProviderPreferenceSummary();
    }

    @Override
@@ -275,6 +277,7 @@ public class SubscriptionsPreferenceController extends AbstractPreferenceControl
        String result = mSubsPrefCtrlInjector.getNetworkType(
                mContext, mConfig, mTelephonyDisplayInfo, subId, isActiveCarrierNetwork);
        if (mSubsPrefCtrlInjector.isActiveCellularNetwork(mContext) || isActiveCarrierNetwork) {
            Log.i(TAG, "Active cellular network or active carrier network.");
            result = mContext.getString(R.string.preference_summary_default_combination,
                    mContext.getString(R.string.mobile_data_connection_active), result);
        } else if (!isDataInService) {
@@ -316,6 +319,13 @@ public class SubscriptionsPreferenceController extends AbstractPreferenceControl
        return icon;
    }

    private void resetProviderPreferenceSummary() {
        if (mSubsGearPref == null) {
            return;
        }
        mSubsGearPref.setSummary("");
    }

    private void updateForBase() {
        final Map<Integer, Preference> existingPrefs = mSubscriptionPreferences;
        mSubscriptionPreferences = new ArrayMap<>();