Use NEW_TASK|CLEAR_TOP when launching emergency app

This flag combination will attempt to go to the existing emergency app
task stack instead of creating duplicate ones.

Fix: 193108390
Test: manual
Change-Id: Ia9c9ead4e8b1d27582cdaff3e4d42c762e80709a
This commit is contained in:
Fan Zhang
2021-08-09 22:48:32 +00:00
parent f05653b4cb
commit 2a3920e44d

View File

@@ -115,7 +115,7 @@ public class MoreSettingsPreferenceController extends BasePreferenceController i
.logClickedPreference(mPreference, getMetricsCategory()); .logClickedPreference(mPreference, getMetricsCategory());
final Intent intent = new Intent(mIntent) final Intent intent = new Intent(mIntent)
.addCategory(Intent.CATEGORY_LAUNCHER) .addCategory(Intent.CATEGORY_LAUNCHER)
.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putString(EXTRA_KEY_ATTRIBUTION, mContext.getPackageName()); bundle.putString(EXTRA_KEY_ATTRIBUTION, mContext.getPackageName());
mContext.startActivity(intent, bundle); mContext.startActivity(intent, bundle);