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

Commit f79f08e7 authored by Ravindra's avatar Ravindra Committed by Steve Kondik
Browse files

Fix to enable data for non-dds sub.

When data is enabled\disabled on non-dds sub do not update the data base
directly instead call TelephonyManager api to do the same.

CRs-Fixed: 992072

Change-Id: I53b5ed2f4d6afcb05b09d65fd3d9843829cff995
parent b3906b40
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -1199,14 +1199,7 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
    private void setMobileDataEnabled(int subId, boolean enabled) {
        if (LOGD) Log.d(TAG, "setMobileDataEnabled: subId = " + subId + " enabled = " + enabled);
        int dataSubId = mSubscriptionManager.getDefaultDataSubId();
        if (subId == dataSubId || TelephonyManager.getDefault().getSimCount() == 1) {
        mTelephonyManager.setDataEnabled(subId, enabled);
        } else {
            // Update mobile data status of a non DDS sub in provider
            final Context context = getActivity();
            android.provider.Settings.Global.putInt(context.getContentResolver(),
                    android.provider.Settings.Global.MOBILE_DATA + subId, enabled ? 1 : 0);
        }
        mMobileDataEnabled.put(String.valueOf(subId), enabled);
        updatePolicy(false);
    }