Merge "Update error dialog text for SIM switching" into main

This commit is contained in:
SongFerng Wang
2024-09-04 08:39:31 +00:00
committed by Android (Google) Code Review
2 changed files with 8 additions and 23 deletions

View File

@@ -328,20 +328,7 @@ class SimOnboardingActivity : SpaBaseDialogActivity() {
@Composable @Composable
fun ErrorDialogImpl(){ fun ErrorDialogImpl(){
// EuiccSlotSidecar showErrorDialog // EuiccSlotSidecar showErrorDialog
val errorDialogPresenterForEuiccSlotSidecar = rememberAlertDialogPresenter( val errorDialogPresenterForSimSwitching = rememberAlertDialogPresenter(
confirmButton = AlertDialogButton(
stringResource(android.R.string.ok)
) {
finish()
},
title = stringResource(R.string.privileged_action_disable_fail_title),
text = {
Text(stringResource(R.string.privileged_action_disable_fail_text))
},
)
// RemovableSlotSidecar showErrorDialog
val errorDialogPresenterForRemovableSlotSidecar = rememberAlertDialogPresenter(
confirmButton = AlertDialogButton( confirmButton = AlertDialogButton(
stringResource(android.R.string.ok) stringResource(android.R.string.ok)
) { ) {
@@ -368,8 +355,7 @@ class SimOnboardingActivity : SpaBaseDialogActivity() {
// show error // show error
when (showError.value) { when (showError.value) {
ErrorType.ERROR_EUICC_SLOT -> errorDialogPresenterForEuiccSlotSidecar.open() ErrorType.ERROR_SIM_SWITCHING -> errorDialogPresenterForSimSwitching.open()
ErrorType.ERROR_REMOVABLE_SLOT -> errorDialogPresenterForRemovableSlotSidecar.open()
ErrorType.ERROR_ENABLE_DSDS -> errorDialogPresenterForMultiSimSidecar.open() ErrorType.ERROR_ENABLE_DSDS -> errorDialogPresenterForMultiSimSidecar.open()
else -> {} else -> {}
} }
@@ -455,7 +441,7 @@ class SimOnboardingActivity : SpaBaseDialogActivity() {
SidecarFragment.State.ERROR -> { SidecarFragment.State.ERROR -> {
Log.i(TAG, "Failed to enable the eSIM profile.") Log.i(TAG, "Failed to enable the eSIM profile.")
switchToEuiccSubscriptionSidecar!!.reset() switchToEuiccSubscriptionSidecar!!.reset()
showError.value = ErrorType.ERROR_EUICC_SLOT showError.value = ErrorType.ERROR_SIM_SWITCHING
callbackListener(CallbackType.CALLBACK_ERROR) callbackListener(CallbackType.CALLBACK_ERROR)
} }
} }
@@ -475,7 +461,7 @@ class SimOnboardingActivity : SpaBaseDialogActivity() {
SidecarFragment.State.ERROR -> { SidecarFragment.State.ERROR -> {
Log.e(TAG, "Failed switching to removable slot.") Log.e(TAG, "Failed switching to removable slot.")
switchToRemovableSlotSidecar!!.reset() switchToRemovableSlotSidecar!!.reset()
showError.value = ErrorType.ERROR_REMOVABLE_SLOT showError.value = ErrorType.ERROR_SIM_SWITCHING
callbackListener(CallbackType.CALLBACK_ERROR) callbackListener(CallbackType.CALLBACK_ERROR)
} }
} }
@@ -605,9 +591,8 @@ class SimOnboardingActivity : SpaBaseDialogActivity() {
enum class ErrorType(val value:Int){ enum class ErrorType(val value:Int){
ERROR_NONE(-1), ERROR_NONE(-1),
ERROR_EUICC_SLOT(1), ERROR_SIM_SWITCHING(1),
ERROR_REMOVABLE_SLOT(2), ERROR_ENABLE_DSDS(2)
ERROR_ENABLE_DSDS(3)
} }
enum class CallbackType(val value:Int){ enum class CallbackType(val value:Int){

View File

@@ -252,8 +252,8 @@ public class ToggleSubscriptionDialogActivity extends SubscriptionActionDialogAc
mSwitchToEuiccSubscriptionSidecar.reset(); mSwitchToEuiccSubscriptionSidecar.reset();
dismissProgressDialog(); dismissProgressDialog();
showErrorDialog( showErrorDialog(
getString(R.string.privileged_action_disable_fail_title), getString(R.string.sim_action_enable_sim_fail_title),
getString(R.string.privileged_action_disable_fail_text)); getString(R.string.sim_action_enable_sim_fail_text));
break; break;
} }
} }