summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/ShortcutInfo.java
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-09-20 07:45:27 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-09-20 07:45:27 +0000
commit1b60530b9272671b6bddda223aea9dfd95f5d469 (patch)
treeb755c5b64eb096681181d4ddb36c313988309141 /src/com/android/launcher3/ShortcutInfo.java
parentf78db7fa5c485433b362b68a497a80cd728faf19 (diff)
parentfb46415e803a7f20a7d48bf42106f3f40cd769dd (diff)
downloadandroid_packages_apps_Trebuchet-1b60530b9272671b6bddda223aea9dfd95f5d469.tar.gz
android_packages_apps_Trebuchet-1b60530b9272671b6bddda223aea9dfd95f5d469.tar.bz2
android_packages_apps_Trebuchet-1b60530b9272671b6bddda223aea9dfd95f5d469.zip
release-request-42a2a3ad-8c90-4c84-a0ad-5d067beb8e30-for-git_oc-mr1-release-4349323 snap-temp-L16100000104414353
Change-Id: I98e6266bf9b4b187c6ad6f24d06b1f02e8beef97
Diffstat (limited to 'src/com/android/launcher3/ShortcutInfo.java')
-rw-r--r--src/com/android/launcher3/ShortcutInfo.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/com/android/launcher3/ShortcutInfo.java b/src/com/android/launcher3/ShortcutInfo.java
index f0d9367af..adf008bf4 100644
--- a/src/com/android/launcher3/ShortcutInfo.java
+++ b/src/com/android/launcher3/ShortcutInfo.java
@@ -17,6 +17,7 @@
package com.android.launcher3;
import android.annotation.TargetApi;
+import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
@@ -59,6 +60,11 @@ public class ShortcutInfo extends ItemInfoWithIcon {
public static final int FLAG_RESTORE_STARTED = 8; //0B1000;
/**
+ * Web UI supported.
+ */
+ public static final int FLAG_SUPPORTS_WEB_UI = 16; //0B10000;
+
+ /**
* Indicates if it represents a common type mentioned in {@link CommonAppTypeParser}.
* Upto 15 different types supported.
*/
@@ -188,6 +194,10 @@ public class ShortcutInfo extends ItemInfoWithIcon {
return hasStatusFlag(FLAG_RESTORED_ICON | FLAG_AUTOINSTALL_ICON);
}
+ public boolean hasPromiseIconUi() {
+ return isPromise() && !hasStatusFlag(FLAG_SUPPORTS_WEB_UI);
+ }
+
public int getInstallProgress() {
return mInstallProgress;
}
@@ -226,4 +236,18 @@ public class ShortcutInfo extends ItemInfoWithIcon {
public boolean isDisabled() {
return isDisabled != 0;
}
+
+ @Override
+ public ComponentName getTargetComponent() {
+ ComponentName cn = super.getTargetComponent();
+ if (cn == null && (itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT
+ || hasStatusFlag(FLAG_SUPPORTS_WEB_UI))) {
+ // Legacy shortcuts and promise icons with web UI may not have a componentName but just
+ // a packageName. In that case create a dummy componentName instead of adding additional
+ // check everywhere.
+ String pkg = intent.getPackage();
+ return pkg == null ? null : new ComponentName(pkg, IconCache.EMPTY_CLASS_NAME);
+ }
+ return cn;
+ }
}