summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Bertschler <bmario@google.com>2017-08-25 19:49:07 (GMT)
committerMario Bertschler <bmario@google.com>2017-08-29 16:04:39 (GMT)
commit5459b66bb631a5fb687e15c26afa423d71ab14c4 (patch)
treee7ad5ca9056767d7e5c96b79cb669c910b238ea5
parentff58fe239ab70de53e8e2c473a1e2458800e69f7 (diff)
downloadandroid_packages_apps_Trebuchet-5459b66bb631a5fb687e15c26afa423d71ab14c4.zip
android_packages_apps_Trebuchet-5459b66bb631a5fb687e15c26afa423d71ab14c4.tar.gz
android_packages_apps_Trebuchet-5459b66bb631a5fb687e15c26afa423d71ab14c4.tar.bz2
AppInfo to create launch intent from component name.
Change-Id: I11e0645acde57e60cd5596447c2aba62ef5ff1a9
-rw-r--r--src/com/android/launcher3/AppInfo.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/com/android/launcher3/AppInfo.java b/src/com/android/launcher3/AppInfo.java
index 9ec26e2..3da1996 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