summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/ShortcutInfo.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/ShortcutInfo.java')
-rw-r--r--src/com/android/launcher3/ShortcutInfo.java19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/com/android/launcher3/ShortcutInfo.java b/src/com/android/launcher3/ShortcutInfo.java
index c87bc08c9..00ac9bda4 100644
--- a/src/com/android/launcher3/ShortcutInfo.java
+++ b/src/com/android/launcher3/ShortcutInfo.java
@@ -100,22 +100,28 @@ public class ShortcutInfo extends ItemInfo {
/**
* Indicates that the icon is disabled due to safe mode restrictions.
*/
- public static final int FLAG_DISABLED_SAFEMODE = 1;
+ public static final int FLAG_DISABLED_SAFEMODE = 1 << 0;
/**
* Indicates that the icon is disabled as the app is not available.
*/
- public static final int FLAG_DISABLED_NOT_AVAILABLE = 2;
+ public static final int FLAG_DISABLED_NOT_AVAILABLE = 1 << 1;
/**
* Indicates that the icon is disabled as the app is suspended
*/
- public static final int FLAG_DISABLED_SUSPENDED = 4;
+ public static final int FLAG_DISABLED_SUSPENDED = 1 << 2;
/**
* Indicates that the icon is disabled as the user is in quiet mode.
*/
- public static final int FLAG_DISABLED_QUIET_USER = 8;
+ public static final int FLAG_DISABLED_QUIET_USER = 1 << 3;
+
+
+ /**
+ * Indicates that the icon is disabled as the publisher has disabled the actual shortcut.
+ */
+ public static final int FLAG_DISABLED_BY_PUBLISHER = 1 << 4;
/**
* Could be disabled, if the the app is installed but unavailable (eg. in safe mode or when
@@ -293,6 +299,11 @@ public class ShortcutInfo extends ItemInfo {
}
contentDescription = UserManagerCompat.getInstance(context)
.getBadgedLabelForUser(label, user);
+ if (shortcutInfo.isEnabled()) {
+ isDisabled &= ~FLAG_DISABLED_BY_PUBLISHER;
+ } else {
+ isDisabled |= FLAG_DISABLED_BY_PUBLISHER;
+ }
LauncherAppState launcherAppState = LauncherAppState.getInstance();
Drawable unbadgedIcon = launcherAppState.getShortcutManager()