From 34dac9cb7394b5bea864b23e28621296fdaf7f9b Mon Sep 17 00:00:00 2001 From: SongFerngWang Date: Thu, 7 Jul 2022 06:21:50 +0800 Subject: [PATCH] [MEP] Hide the preferred SIM dialog when the user has replaced the SIM Since there is the race condition and it causes UI hides the preferred SIM dialog. Therefore, to hide the preferred SIM dialog under the specific condition which the user has replaced the SIM during the SIM switching. Bug: 238061853 Test: Manually testing. Device has the psim+esim and the esim's mobile data on. The tester disables the esim and then UI shows the preferred SIM dialog. Change-Id: I01e7d60170c5053730fd3113abd914fb5c0d11c9 (cherry picked from commit 286dce6b6ed8f06d8599c2a3de34c36ddd4445dd) Merged-In: I01e7d60170c5053730fd3113abd914fb5c0d11c9 --- .../SubscriptionActionDialogActivity.java | 14 +++++++++++++- .../ToggleSubscriptionDialogActivity.java | 4 ++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/com/android/settings/network/telephony/SubscriptionActionDialogActivity.java b/src/com/android/settings/network/telephony/SubscriptionActionDialogActivity.java index c509bac575c..391158f065b 100644 --- a/src/com/android/settings/network/telephony/SubscriptionActionDialogActivity.java +++ b/src/com/android/settings/network/telephony/SubscriptionActionDialogActivity.java @@ -60,8 +60,20 @@ public class SubscriptionActionDialogActivity extends FragmentActivity { * @param message The string content should be displayed in the progress dialog. */ protected void showProgressDialog(String message) { + showProgressDialog(message,false); + } + + /** + * Displays a loading dialog. + * + * @param message The string content should be displayed in the progress dialog. + * @param updateIfNeeded is whether to update the progress state in the SharedPreferences. + */ + protected void showProgressDialog(String message, boolean updateIfNeeded) { ProgressDialogFragment.show(getFragmentManager(), message, null); - setProgressState(PROGRESS_IS_SHOWING); + if (updateIfNeeded) { + setProgressState(PROGRESS_IS_SHOWING); + } } /** Dismisses the loading dialog. */ diff --git a/src/com/android/settings/network/telephony/ToggleSubscriptionDialogActivity.java b/src/com/android/settings/network/telephony/ToggleSubscriptionDialogActivity.java index f5f18b4b9ee..a878cb3ebd3 100644 --- a/src/com/android/settings/network/telephony/ToggleSubscriptionDialogActivity.java +++ b/src/com/android/settings/network/telephony/ToggleSubscriptionDialogActivity.java @@ -220,8 +220,8 @@ public class ToggleSubscriptionDialogActivity extends SubscriptionActionDialogAc showProgressDialog( getString( R.string.sim_action_switch_sub_dialog_progress, - SubscriptionUtil.getUniqueSubscriptionDisplayName( - mSubInfo, this))); + SubscriptionUtil.getUniqueSubscriptionDisplayName(mSubInfo, this)), + removedSubInfo != null ? true : false); if (mIsEsimOperation) { mSwitchToEuiccSubscriptionSidecar.run(mSubInfo.getSubscriptionId(), UiccSlotUtil.INVALID_PORT_ID,