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

Commit 899e0caf authored by kaiyiz's avatar kaiyiz
Browse files

SystemUI: Fix mobile data will turn on automatically issue

When turn off data service by data switch shortcut, the state of
'Settings.Global.MOBILE_DATA' for each subscription is not updated. As a
result, data service will turn on when click data switch shortcut again.

When change global mobile data state, update 'Settings.Global.MOBILE_DATA'
for each subscription at the same time.

CRs-Fixed: 678603

Change-Id: Ia1ab07e03bedd9faea7ef44f1f00f7a7736245de
parent 98b0186e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -599,6 +599,11 @@ class ExtQuickSettingsModel extends QuickSettingsModel {
        ConnectivityManager cm = (ConnectivityManager)mContext.getSystemService(
                Context.CONNECTIVITY_SERVICE);
        cm.setMobileDataEnabled(!mRSSIState.enabled);
        int phoneCount = MSimTelephonyManager.getDefault().getPhoneCount();
        for (int i = 0; i < phoneCount; i++) {
            Settings.Global.putInt(mContext.getContentResolver(),
                    Settings.Global.MOBILE_DATA + i, (!mRSSIState.enabled) ? 1 : 0);
        }
    }

    private void onRoamingDataStateChanged() {