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

Commit 32b83d4b authored by Nazanin Bakhshi's avatar Nazanin Bakhshi
Browse files

update data and roaming setting for each subscription when subscriptionGrouping

is created

Bug: b/129765463
Test: app test
Change-Id: I0c9606d362b12b591224dd4a3a5d9fb1bb38cbee
Merged-In: I0c9606d362b12b591224dd4a3a5d9fb1bb38cbee
(cherry picked from commit c378ebec)
parent db8d2e7f
Loading
Loading
Loading
Loading
+12 −5
Original line number Original line Diff line number Diff line
@@ -163,20 +163,28 @@ public class MultiSimSettingController {
        }
        }
        if (DBG) log("refSubId is " + refSubId);
        if (DBG) log("refSubId is " + refSubId);


        boolean enable = false;
        try {
        try {
            boolean enable = GlobalSettingsHelper.getBoolean(
            enable = GlobalSettingsHelper.getBoolean(
                    mContext, Settings.Global.MOBILE_DATA, refSubId);
                    mContext, Settings.Global.MOBILE_DATA, refSubId);
            onUserDataEnabled(refSubId, enable);
            onUserDataEnabled(refSubId, enable);
        } catch (SettingNotFoundException exception) {
        } 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 {
        try {
            boolean enable = GlobalSettingsHelper.getBoolean(
            enable = GlobalSettingsHelper.getBoolean(
                    mContext, Settings.Global.DATA_ROAMING, refSubId);
                    mContext, Settings.Global.DATA_ROAMING, refSubId);
            onRoamingDataEnabled(refSubId, enable);
            onRoamingDataEnabled(refSubId, enable);
        } catch (SettingNotFoundException exception) {
        } 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);
        }
        }
    }
    }


@@ -312,7 +320,6 @@ public class MultiSimSettingController {


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