Force shortcuts to launch as the root of a new task

Otherwise it will try to find a existing task affinity, which can be
stale.

Test: manual
Change-Id: If2982612bf8789e726757e9fda1f70af47274a9e
Fixes: 73710228
This commit is contained in:
Fan Zhang
2018-02-28 11:12:05 -08:00
parent 6a6cc310cf
commit a85dd50842

View File

@@ -71,7 +71,7 @@ public class CreateShortcut extends LauncherActivity {
@VisibleForTesting
Intent createResultIntent(Intent shortcutIntent, ResolveInfo resolveInfo,
CharSequence label) {
shortcutIntent.setFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
shortcutIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
ShortcutManager sm = getSystemService(ShortcutManager.class);
ActivityInfo activityInfo = resolveInfo.activityInfo;