diff options
author | Sanket Padawe <sanketpadawe@google.com> | 2015-01-08 23:25:19 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2015-01-08 23:25:19 +0000 |
commit | 4e4860bbcbfafd2b59f1ecec9c9b895ca7943cb0 (patch) | |
tree | f5c2a06e639b1cd3e24198e6033bab60659a63f0 /src/com | |
parent | 2c47e6f823ba98b8fc59c790a65e8d9632620060 (diff) | |
parent | c7e5b42ac493f7f06fd8d90f87a4e7eb23acc54c (diff) | |
download | packages_apps_Settings-4e4860bbcbfafd2b59f1ecec9c9b895ca7943cb0.zip packages_apps_Settings-4e4860bbcbfafd2b59f1ecec9c9b895ca7943cb0.tar.gz packages_apps_Settings-4e4860bbcbfafd2b59f1ecec9c9b895ca7943cb0.tar.bz2 |
am 0c3b1371: am f5a4abc2: Merge "Fixed Cellular data toggling issue in settings for multisim" into lmp-mr1-dev
automerge: c7e5b42
* commit 'c7e5b42ac493f7f06fd8d90f87a4e7eb23acc54c':
Fixed Cellular data toggling issue in settings for multisim
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/settings/DataUsageSummary.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/com/android/settings/DataUsageSummary.java b/src/com/android/settings/DataUsageSummary.java index 152298c..9a20882 100644 --- a/src/com/android/settings/DataUsageSummary.java +++ b/src/com/android/settings/DataUsageSummary.java @@ -995,9 +995,9 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable return isEnable; } - private void setMobileDataEnabled(boolean enabled) { + private void setMobileDataEnabled(int subId, boolean enabled) { if (LOGD) Log.d(TAG, "setMobileDataEnabled()"); - mTelephonyManager.setDataEnabled(enabled); + mTelephonyManager.setDataEnabled(subId, enabled); mMobileDataEnabled = enabled; updatePolicy(false); } @@ -1164,12 +1164,12 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable if (Utils.showSimCardTile(getActivity())) { handleMultiSimDataDialog(); } else { - setMobileDataEnabled(true); + setMobileDataEnabled(getSubId(currentTab), true); } } else { // disabling data; show confirmation dialog which eventually // calls setMobileDataEnabled() once user confirms. - ConfirmDataDisableFragment.show(DataUsageSummary.this); + ConfirmDataDisableFragment.show(DataUsageSummary.this, getSubId(mCurrentTab)); } } @@ -1187,7 +1187,7 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable // the pop-up. if (!Utils.showSimCardTile(context) || (nextSir != null && currentSir.getSubscriptionId() == nextSir.getSubscriptionId())) { - setMobileDataEnabled(true); + setMobileDataEnabled(currentSir.getSubscriptionId(), true); updateBody(); return; } @@ -1206,7 +1206,7 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable @Override public void onClick(DialogInterface dialog, int id) { mSubscriptionManager.setDefaultDataSubId(currentSir.getSubscriptionId()); - setMobileDataEnabled(true); + setMobileDataEnabled(currentSir.getSubscriptionId(), true); updateBody(); } }); @@ -2151,7 +2151,9 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable * Dialog to request user confirmation before disabling data. */ public static class ConfirmDataDisableFragment extends DialogFragment { - public static void show(DataUsageSummary parent) { + static int mSubId; + public static void show(DataUsageSummary parent, int subId) { + mSubId = subId; if (!parent.isAdded()) return; final ConfirmDataDisableFragment dialog = new ConfirmDataDisableFragment(); @@ -2172,7 +2174,7 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable final DataUsageSummary target = (DataUsageSummary) getTargetFragment(); if (target != null) { // TODO: extend to modify policy enabled flag. - target.setMobileDataEnabled(false); + target.setMobileDataEnabled(mSubId, false); } } }); |