Fix multi-sim popup issue in data usage. am: 8591f26fa3
am: d8fc77122b
Change-Id: Idbe5e19e8ce5660e4a056b28917fccca5477cc9e
This commit is contained in:
@@ -111,11 +111,10 @@ public class CellDataPreference extends CustomDialogPreference implements Templa
|
|||||||
@Override
|
@Override
|
||||||
protected void performClick(View view) {
|
protected void performClick(View view) {
|
||||||
MetricsLogger.action(getContext(), MetricsEvent.ACTION_CELL_DATA_TOGGLE, !mChecked);
|
MetricsLogger.action(getContext(), MetricsEvent.ACTION_CELL_DATA_TOGGLE, !mChecked);
|
||||||
if (mChecked) {
|
|
||||||
final SubscriptionInfo currentSir = mSubscriptionManager.getActiveSubscriptionInfo(
|
final SubscriptionInfo currentSir = mSubscriptionManager.getActiveSubscriptionInfo(
|
||||||
mSubId);
|
mSubId);
|
||||||
final SubscriptionInfo nextSir = mSubscriptionManager.getDefaultDataSubscriptionInfo();
|
final SubscriptionInfo nextSir = mSubscriptionManager.getDefaultDataSubscriptionInfo();
|
||||||
|
if (mChecked) {
|
||||||
// If the device is single SIM or is enabling data on the active data SIM then forgo
|
// If the device is single SIM or is enabling data on the active data SIM then forgo
|
||||||
// the pop-up.
|
// the pop-up.
|
||||||
if (!Utils.showSimCardTile(getContext()) ||
|
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 we are showing the Sim Card tile then we are a Multi-Sim device.
|
||||||
if (Utils.showSimCardTile(getContext())) {
|
if (Utils.showSimCardTile(getContext())) {
|
||||||
mMultiSimDialog = true;
|
mMultiSimDialog = true;
|
||||||
|
if (nextSir != null && currentSir != null &&
|
||||||
|
currentSir.getSubscriptionId() == nextSir.getSubscriptionId()) {
|
||||||
|
setMobileDataEnabled(true);
|
||||||
|
disableDataForOtherSubscriptions(mSubId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
super.performClick(view);
|
super.performClick(view);
|
||||||
} else {
|
} else {
|
||||||
setMobileDataEnabled(true);
|
setMobileDataEnabled(true);
|
||||||
|
Reference in New Issue
Block a user