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

Commit f468757d authored by cretin45's avatar cretin45 Committed by Ed Carrigan
Browse files

Settings: Only show mobile data switch on preferred data sub

Change-Id: I7f997c82556d719cc39d5f6b95b5122375d6e585
(cherry picked from commit fb36cd7d)
parent 472b90df
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -747,9 +747,18 @@ public class DataUsageSummary extends Fragment {
            mTemplate = buildTemplateMobileAll(getActiveSubscriberId(context));

        } else if (currentTab.startsWith(TAB_SIM)) {
            for (int i = 0; i < MSimTelephonyManager.getDefault()
                    .getPhoneCount(); i++) {
            MSimTelephonyManager mSimTelephonyManager = MSimTelephonyManager.getDefault();
            for (int i = 0; i < mSimTelephonyManager.getPhoneCount(); i++) {
                if (currentTab.equals(getSubTag(i+1))) {
                    if (mSimTelephonyManager.getMultiSimConfiguration()
                            == MSimTelephonyManager.MultiSimVariants.DSDS) {
                        int dataSub = mSimTelephonyManager.getPreferredDataSubscription();
                        if (dataSub == multiSimGetCurrentSub()) {
                            mDataEnabledView.setVisibility(View.VISIBLE);
                        } else {
                            mDataEnabledView.setVisibility(View.GONE);
                        }
                    }
                    setPreferenceTitle(mDataEnabledView,
                            R.string.data_usage_enable_mobile);
                    setPreferenceTitle(mDisableAtLimitView,