From 5459b66bb631a5fb687e15c26afa423d71ab14c4 Mon Sep 17 00:00:00 2001 From: Mario Bertschler Date: Fri, 25 Aug 2017 12:49:07 -0700 Subject: [PATCH] AppInfo to create launch intent from component name. Change-Id: I11e0645acde57e60cd5596447c2aba62ef5ff1a9 --- src/com/android/launcher3/AppInfo.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/AppInfo.java b/src/com/android/launcher3/AppInfo.java index 9ec26e26a5..3da199635e 100644 --- a/src/com/android/launcher3/AppInfo.java +++ b/src/com/android/launcher3/AppInfo.java @@ -95,10 +95,14 @@ public class AppInfo extends ItemInfoWithIcon { } public static Intent makeLaunchIntent(LauncherActivityInfo info) { + return makeLaunchIntent(info.getComponentName()); + } + + public static Intent makeLaunchIntent(ComponentName cn) { return new Intent(Intent.ACTION_MAIN) - .addCategory(Intent.CATEGORY_LAUNCHER) - .setComponent(info.getComponentName()) - .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); + .addCategory(Intent.CATEGORY_LAUNCHER) + .setComponent(cn) + .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); } @Override