From b6cc40bc15ef97ba7d677295c9a3870f18eadbe2 Mon Sep 17 00:00:00 2001 From: Kenny Guy Date: Tue, 13 May 2014 15:58:58 +0100 Subject: [PATCH] Don't clear flags in startActivity Move setting flags for starting apps back to AppInfo from Launcher.startActivity. Bug: 14839470 Change-Id: I1dc928e9ebce9ce4d411678f94b5ca4284c1255f --- src/com/android/launcher3/AppInfo.java | 1 + src/com/android/launcher3/Launcher.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/AppInfo.java b/src/com/android/launcher3/AppInfo.java index 40e8e6d0e6..c85626b106 100644 --- a/src/com/android/launcher3/AppInfo.java +++ b/src/com/android/launcher3/AppInfo.java @@ -87,6 +87,7 @@ public class AppInfo extends ItemInfo { intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_LAUNCHER); intent.setComponent(info.getComponentName()); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); long serialNumber = UserManagerCompat.getInstance(context).getSerialNumberForUser(user); intent.putExtra(EXTRA_PROFILE, serialNumber); this.user = user; diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index b97ced7023..3636107c27 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -2629,7 +2629,7 @@ public class Launcher extends Activity } boolean startActivity(View v, Intent intent, Object tag) { - intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); try { // Only launch using the new animation if the shortcut has not opted out (this is a // private contract between launcher and may be ignored in the future).