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

Commit 2d40c2b0 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Telephony(MSIM): Store defaultSubId in shared pref"

parents 0fc022a0 b00a001d
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1143,7 +1143,8 @@ public class SubscriptionController extends ISub.Stub {
    @Deprecated
    public long getDefaultSubId() {
        //FIXME: Make this smarter, need to handle data only and voice devices
        long subId = mDefaultVoiceSubId;
        long subId = Settings.Global.getLong(mContext.getContentResolver(),
                 Settings.Global.MULTI_SIM_DEFAULT_SUBSCRIPTION, DUMMY_SUB_ID);
        if (VDBG) logv("[getDefaultSubId] value = " + subId);
        return subId;
    }
@@ -1317,6 +1318,8 @@ public class SubscriptionController extends ISub.Stub {
                    || TelephonyManager.getDefault().getSimCount() == 1)) {
                logdl("[setDefaultSubId] set mDefaultVoiceSubId=" + subId);
                mDefaultVoiceSubId = subId;
                Settings.Global.putLong(mContext.getContentResolver(),
                         Settings.Global.MULTI_SIM_DEFAULT_SUBSCRIPTION, subId);
                // Update MCC MNC device configuration information
                String defaultMccMnc = TelephonyManager.getDefault().getSimOperator(phoneId);
                MccTable.updateMccMncConfiguration(mContext, defaultMccMnc, false);
@@ -1659,6 +1662,7 @@ public class SubscriptionController extends ISub.Stub {
        //if there are no activated subs available, no need to update. EXIT.
        if (mNextActivatedSub == null) return;

        //if current default sub is not active, fallback to next active sub.
        if (getSubState(getDefaultSubId()) == SubscriptionManager.INACTIVE) {
            setDefaultSubId(mNextActivatedSub.subId);
        }