diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2017-10-30 13:52:20 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2017-10-31 11:00:28 -0700 |
commit | 076839c321e26f055387346d594f20c88b54dfa7 (patch) | |
tree | df562ee477300f430ca73949d09e1a8aa86a3e25 /src/com/android/launcher3/ShortcutInfo.java | |
parent | 9d341964a0527391daa07dc112c5579b55edbb96 (diff) | |
download | android_packages_apps_Trebuchet-076839c321e26f055387346d594f20c88b54dfa7.tar.gz android_packages_apps_Trebuchet-076839c321e26f055387346d594f20c88b54dfa7.tar.bz2 android_packages_apps_Trebuchet-076839c321e26f055387346d594f20c88b54dfa7.zip |
Moving various runtime flags into the common base class.
Caching the ststemApp status for workspace shortcuts.
Change-Id: I25663e1f04a9768afcca000294adcbb00ea1db7b
Diffstat (limited to 'src/com/android/launcher3/ShortcutInfo.java')
-rw-r--r-- | src/com/android/launcher3/ShortcutInfo.java | 54 |
1 files changed, 2 insertions, 52 deletions
diff --git a/src/com/android/launcher3/ShortcutInfo.java b/src/com/android/launcher3/ShortcutInfo.java index adf008bf4..ec608ca8d 100644 --- a/src/com/android/launcher3/ShortcutInfo.java +++ b/src/com/android/launcher3/ShortcutInfo.java @@ -65,13 +65,6 @@ public class ShortcutInfo extends ItemInfoWithIcon { 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. - */ - @Deprecated - public static final int FLAG_RESTORED_APP_TYPE = 0B0011110000; - - /** * The intent used to start the application. */ public Intent intent; @@ -83,42 +76,6 @@ public class ShortcutInfo extends ItemInfoWithIcon { public Intent.ShortcutIconResource iconResource; /** - * Indicates that the icon is disabled due to safe mode restrictions. - */ - 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 = 1 << 1; - - /** - * Indicates that the icon is disabled as the app is suspended - */ - 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 = 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; - - /** - * Indicates that the icon is disabled as the user partition is currently locked. - */ - public static final int FLAG_DISABLED_LOCKED_USER = 1 << 5; - - /** - * Could be disabled, if the the app is installed but unavailable (eg. in safe mode or when - * sd-card is not available). - */ - public int isDisabled = DEFAULT; - - /** * A message to display when the user tries to start a disabled shortcut. * This is currently only used for deep shortcuts. */ @@ -142,7 +99,6 @@ public class ShortcutInfo extends ItemInfoWithIcon { iconResource = info.iconResource; status = info.status; mInstallProgress = info.mInstallProgress; - isDisabled = info.isDisabled; } /** TODO: Remove this. It's only called by ApplicationInfo.makeShortcut. */ @@ -150,7 +106,6 @@ public class ShortcutInfo extends ItemInfoWithIcon { super(info); title = Utilities.trim(info.title); intent = new Intent(info.intent); - isDisabled = info.isDisabled; } /** @@ -219,9 +174,9 @@ public class ShortcutInfo extends ItemInfoWithIcon { contentDescription = UserManagerCompat.getInstance(context) .getBadgedLabelForUser(label, user); if (shortcutInfo.isEnabled()) { - isDisabled &= ~FLAG_DISABLED_BY_PUBLISHER; + runtimeStatusFlags &= ~FLAG_DISABLED_BY_PUBLISHER; } else { - isDisabled |= FLAG_DISABLED_BY_PUBLISHER; + runtimeStatusFlags |= FLAG_DISABLED_BY_PUBLISHER; } disabledMessage = shortcutInfo.getDisabledMessage(); } @@ -233,11 +188,6 @@ public class ShortcutInfo extends ItemInfoWithIcon { } @Override - public boolean isDisabled() { - return isDisabled != 0; - } - - @Override public ComponentName getTargetComponent() { ComponentName cn = super.getTargetComponent(); if (cn == null && (itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT |