From a85dd50842621dd65179b3f7cd15fe8afcac2c05 Mon Sep 17 00:00:00 2001 From: Fan Zhang Date: Wed, 28 Feb 2018 11:12:05 -0800 Subject: [PATCH] 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 --- src/com/android/settings/shortcut/CreateShortcut.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/settings/shortcut/CreateShortcut.java b/src/com/android/settings/shortcut/CreateShortcut.java index 2bd9b761255..b0787401f7b 100644 --- a/src/com/android/settings/shortcut/CreateShortcut.java +++ b/src/com/android/settings/shortcut/CreateShortcut.java @@ -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;