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

Commit 8591f26f authored by Sanket Padawe's avatar Sanket Padawe
Browse files

Fix multi-sim popup issue in data usage.

+ Avoid sending popup dialog when data is enabled on currently active
data sim.

Bug: 31736014
Change-Id: I60e9e049f546cb176283bc4c4e20cb2d3e7ac386
parent 1146d637
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -111,11 +111,10 @@ public class CellDataPreference extends CustomDialogPreference implements Templa
    @Override
    protected void performClick(View view) {
        MetricsLogger.action(getContext(), MetricsEvent.ACTION_CELL_DATA_TOGGLE, !mChecked);
        if (mChecked) {
        final SubscriptionInfo currentSir = mSubscriptionManager.getActiveSubscriptionInfo(
                mSubId);
        final SubscriptionInfo nextSir = mSubscriptionManager.getDefaultDataSubscriptionInfo();

        if (mChecked) {
            // If the device is single SIM or is enabling data on the active data SIM then forgo
            // the pop-up.
            if (!Utils.showSimCardTile(getContext()) ||
@@ -136,6 +135,12 @@ public class CellDataPreference extends CustomDialogPreference implements Templa
            // If we are showing the Sim Card tile then we are a Multi-Sim device.
            if (Utils.showSimCardTile(getContext())) {
                mMultiSimDialog = true;
                if (nextSir != null && currentSir != null &&
                        currentSir.getSubscriptionId() == nextSir.getSubscriptionId()) {
                    setMobileDataEnabled(true);
                    disableDataForOtherSubscriptions(mSubId);
                    return;
                }
                super.performClick(view);
            } else {
                setMobileDataEnabled(true);