From 968795679be0a3f0118d5a6e2e1580808da5716d Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Thu, 22 Mar 2012 05:54:33 -0700 Subject: Set FLAG_ACTIVITY_RESET_TASK_IF_NEEDED for all app shortcuts Change-Id: I3a5cc205c24b1ec33f428e8d341a995e864f6a1d --- src/com/android/launcher2/LauncherModel.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/com/android/launcher2/LauncherModel.java') diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java index 37235e960..8f6ca4fd1 100644 --- a/src/com/android/launcher2/LauncherModel.java +++ b/src/com/android/launcher2/LauncherModel.java @@ -1070,6 +1070,15 @@ public class LauncherModel extends BroadcastReceiver { info = getShortcutInfo(c, context, iconTypeIndex, iconPackageIndex, iconResourceIndex, iconIndex, titleIndex); + + // App shortcuts that used to be automatically added to Launcher + // didn't always have the correct intent flags set, so do that here + if (intent.getAction().equals(Intent.ACTION_MAIN) && + intent.getCategories().contains(Intent.CATEGORY_LAUNCHER)) { + intent.addFlags( + Intent.FLAG_ACTIVITY_NEW_TASK | + Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); + } } if (info != null) { -- cgit v1.2.3