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

Commit 31849a00 authored by Nazanin Bakhshi's avatar Nazanin Bakhshi Committed by Gerrit Code Review
Browse files

Merge "update data and roaming setting for each subscription when subscriptionGrouping is created"

parents f9e1128b 1c6493f0
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -159,20 +159,28 @@ public class MultiSimSettingController {
        }
        if (DBG) log("refSubId is " + refSubId);

        boolean enable = false;
        try {
            boolean enable = GlobalSettingsHelper.getBoolean(
            enable = GlobalSettingsHelper.getBoolean(
                    mContext, Settings.Global.MOBILE_DATA, refSubId);
            onUserDataEnabled(refSubId, enable);
        } catch (SettingNotFoundException exception) {
            // Do nothing if it's never set.
            //pass invalid refSubId to fetch the single-sim setting
            enable = GlobalSettingsHelper.getBoolean(
                    mContext, Settings.Global.MOBILE_DATA, INVALID_SUBSCRIPTION_ID, enable);
            onUserDataEnabled(refSubId, enable);
        }

        enable = false;
        try {
            boolean enable = GlobalSettingsHelper.getBoolean(
            enable = GlobalSettingsHelper.getBoolean(
                    mContext, Settings.Global.DATA_ROAMING, refSubId);
            onRoamingDataEnabled(refSubId, enable);
        } catch (SettingNotFoundException exception) {
            // Do nothing if it's never set.
            //pass invalid refSubId to fetch the single-sim setting
            enable = GlobalSettingsHelper.getBoolean(
                    mContext, Settings.Global.DATA_ROAMING, INVALID_SUBSCRIPTION_ID, enable);
            onRoamingDataEnabled(refSubId, enable);
        }
    }

@@ -308,7 +316,6 @@ public class MultiSimSettingController {

        for (SubscriptionInfo info : infoList) {
            int currentSubId = info.getSubscriptionId();
            if (currentSubId == subId) continue;
            // TODO: simplify when setUserDataEnabled becomes singleton
            if (mSubController.isActiveSubId(currentSubId)) {
                // If we end up enabling two active primary subscriptions, don't enable the