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
This commit is contained in:
@@ -995,9 +995,9 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
|
|||||||
return isEnable;
|
return isEnable;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setMobileDataEnabled(boolean enabled) {
|
private void setMobileDataEnabled(int subId, boolean enabled) {
|
||||||
if (LOGD) Log.d(TAG, "setMobileDataEnabled()");
|
if (LOGD) Log.d(TAG, "setMobileDataEnabled()");
|
||||||
mTelephonyManager.setDataEnabled(enabled);
|
mTelephonyManager.setDataEnabled(subId, enabled);
|
||||||
mMobileDataEnabled = enabled;
|
mMobileDataEnabled = enabled;
|
||||||
updatePolicy(false);
|
updatePolicy(false);
|
||||||
}
|
}
|
||||||
@@ -1164,12 +1164,12 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
|
|||||||
if (Utils.showSimCardTile(getActivity())) {
|
if (Utils.showSimCardTile(getActivity())) {
|
||||||
handleMultiSimDataDialog();
|
handleMultiSimDataDialog();
|
||||||
} else {
|
} else {
|
||||||
setMobileDataEnabled(true);
|
setMobileDataEnabled(getSubId(currentTab), true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// disabling data; show confirmation dialog which eventually
|
// disabling data; show confirmation dialog which eventually
|
||||||
// calls setMobileDataEnabled() once user confirms.
|
// 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.
|
// the pop-up.
|
||||||
if (!Utils.showSimCardTile(context) ||
|
if (!Utils.showSimCardTile(context) ||
|
||||||
(nextSir != null && currentSir.getSubscriptionId() == nextSir.getSubscriptionId())) {
|
(nextSir != null && currentSir.getSubscriptionId() == nextSir.getSubscriptionId())) {
|
||||||
setMobileDataEnabled(true);
|
setMobileDataEnabled(currentSir.getSubscriptionId(), true);
|
||||||
updateBody();
|
updateBody();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1206,7 +1206,7 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
mSubscriptionManager.setDefaultDataSubId(currentSir.getSubscriptionId());
|
mSubscriptionManager.setDefaultDataSubId(currentSir.getSubscriptionId());
|
||||||
setMobileDataEnabled(true);
|
setMobileDataEnabled(currentSir.getSubscriptionId(), true);
|
||||||
updateBody();
|
updateBody();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -2151,7 +2151,9 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
|
|||||||
* Dialog to request user confirmation before disabling data.
|
* Dialog to request user confirmation before disabling data.
|
||||||
*/
|
*/
|
||||||
public static class ConfirmDataDisableFragment extends DialogFragment {
|
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;
|
if (!parent.isAdded()) return;
|
||||||
|
|
||||||
final ConfirmDataDisableFragment dialog = new ConfirmDataDisableFragment();
|
final ConfirmDataDisableFragment dialog = new ConfirmDataDisableFragment();
|
||||||
@@ -2172,7 +2174,7 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
|
|||||||
final DataUsageSummary target = (DataUsageSummary) getTargetFragment();
|
final DataUsageSummary target = (DataUsageSummary) getTargetFragment();
|
||||||
if (target != null) {
|
if (target != null) {
|
||||||
// TODO: extend to modify policy enabled flag.
|
// TODO: extend to modify policy enabled flag.
|
||||||
target.setMobileDataEnabled(false);
|
target.setMobileDataEnabled(mSubId, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user