Merge "[MEP] show the DSDS mode selection dialog for user when user insert esim" into tm-dev am: 1bc142776c

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17904395

Change-Id: Ib83808167690f7b67cef48ef53764a1f7e500897
Ignore-AOSP-First: this is an automerge
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
SongFerng Wang
2022-04-26 08:02:48 +00:00
committed by Automerger Merge Worker

View File

@@ -326,7 +326,7 @@ public class ToggleSubscriptionDialogActivity extends SubscriptionActionDialogAc
/* Handles the enabling SIM action. */ /* Handles the enabling SIM action. */
private void showEnableSubDialog() { private void showEnableSubDialog() {
Log.i(TAG, "Handle subscription enabling."); Log.d(TAG, "Handle subscription enabling.");
if (isDsdsConditionSatisfied()) { if (isDsdsConditionSatisfied()) {
showEnableDsdsConfirmDialog(); showEnableDsdsConfirmDialog();
return; return;
@@ -452,7 +452,7 @@ public class ToggleSubscriptionDialogActivity extends SubscriptionActionDialogAc
} }
private void showMepSwitchSimConfirmDialog() { private void showMepSwitchSimConfirmDialog() {
Log.i(TAG, "showMepSwitchSimConfirmDialog"); Log.d(TAG, "showMepSwitchSimConfirmDialog");
final CharSequence displayName = SubscriptionUtil.getUniqueSubscriptionDisplayName( final CharSequence displayName = SubscriptionUtil.getUniqueSubscriptionDisplayName(
mSubInfo, this); mSubInfo, this);
String title = getString(R.string.sim_action_switch_sub_dialog_mep_title, displayName); String title = getString(R.string.sim_action_switch_sub_dialog_mep_title, displayName);
@@ -556,27 +556,35 @@ public class ToggleSubscriptionDialogActivity extends SubscriptionActionDialogAc
private boolean isDsdsConditionSatisfied() { private boolean isDsdsConditionSatisfied() {
if (mTelMgr.isMultiSimEnabled()) { if (mTelMgr.isMultiSimEnabled()) {
Log.i(TAG, "DSDS is already enabled. Condition not satisfied."); Log.d(TAG, "DSDS is already enabled. Condition not satisfied.");
return false; return false;
} }
if (mTelMgr.isMultiSimSupported() != TelephonyManager.MULTISIM_ALLOWED) { if (mTelMgr.isMultiSimSupported() != TelephonyManager.MULTISIM_ALLOWED) {
Log.i(TAG, "Hardware does not support DSDS."); Log.d(TAG, "Hardware does not support DSDS.");
return false; return false;
} }
boolean isActiveSim = SubscriptionUtil.getActiveSubscriptions(
mSubscriptionManager).size() > 0;
if (isMultipleEnabledProfilesSupported() && isActiveSim) {
Log.d(TAG,
"Device supports MEP and eSIM operation and eSIM profile is enabled."
+ " DSDS condition satisfied.");
return true;
}
boolean isRemovableSimEnabled = isRemovableSimEnabled(); boolean isRemovableSimEnabled = isRemovableSimEnabled();
if (mIsEsimOperation && isRemovableSimEnabled) { if (mIsEsimOperation && isRemovableSimEnabled) {
Log.i(TAG, "eSIM operation and removable SIM is enabled. DSDS condition satisfied."); Log.d(TAG, "eSIM operation and removable SIM is enabled. DSDS condition satisfied.");
return true; return true;
} }
boolean isEsimProfileEnabled = boolean isEsimProfileEnabled =
SubscriptionUtil.getActiveSubscriptions(mSubscriptionManager).stream() SubscriptionUtil.getActiveSubscriptions(mSubscriptionManager).stream()
.anyMatch(SubscriptionInfo::isEmbedded); .anyMatch(SubscriptionInfo::isEmbedded);
if (!mIsEsimOperation && isEsimProfileEnabled) { if (!mIsEsimOperation && isEsimProfileEnabled) {
Log.i(TAG, "Removable SIM operation and eSIM profile is enabled. DSDS condition" Log.d(TAG, "Removable SIM operation and eSIM profile is enabled. DSDS condition"
+ " satisfied."); + " satisfied.");
return true; return true;
} }
Log.i(TAG, "DSDS condition not satisfied."); Log.d(TAG, "DSDS condition not satisfied.");
return false; return false;
} }