[Settings] Additional route for dismiss activity dialog

Previous design dismiss an activity dialog through Intent would lead to a pair of creating and finishing activity. The task switch during the creating and finishing may introduce some side effect to the other apps.

This change tried to add additional route to avoid from dismiss through Intent
but sending an async close request to that specific dialog (if available).

Bug: 236956105
Test: local, auto testing
Change-Id: I0a7e0e9826a301f2aa0ca34f40b5570f0e384b4f
This commit is contained in:
Bonian Chen
2022-08-17 14:10:17 +00:00
parent c6e9ba1100
commit 188ccde75b
4 changed files with 114 additions and 18 deletions

View File

@@ -164,10 +164,7 @@ public class SimSelectNotification extends BroadcastReceiver {
// If the dialog type is to dismiss.
if (dialogType == EXTRA_DEFAULT_SUBSCRIPTION_SELECT_TYPE_DISMISS) {
Intent newIntent = new Intent(context, SimDialogActivity.class);
newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
newIntent.putExtra(SimDialogActivity.DIALOG_TYPE_KEY, PICK_DISMISS);
context.startActivity(newIntent);
SimDialogProhibitService.dismissDialog(context);
return;
}