diff options
author | Kenny Guy <kennyguy@google.com> | 2016-01-21 19:50:02 +0000 |
---|---|---|
committer | Rubin Xu <rubinxu@google.com> | 2016-01-25 11:28:06 +0000 |
commit | 44cba696386b44f9115cad13ec9ecf67a0ac9119 (patch) | |
tree | bc8b35320ed88f134708c85b107680152c199b33 /src/com/android/launcher3/AppInfo.java | |
parent | f076eae0cab10f035f7b187c72a680cd220acf1b (diff) | |
download | android_packages_apps_Trebuchet-44cba696386b44f9115cad13ec9ecf67a0ac9119.tar.gz android_packages_apps_Trebuchet-44cba696386b44f9115cad13ec9ecf67a0ac9119.tar.bz2 android_packages_apps_Trebuchet-44cba696386b44f9115cad13ec9ecf67a0ac9119.zip |
Grey out suspended applications.
Grey out application shortcuts and all apps entries
for packages that are suspended.
Bug: 22776761
Change-Id: I1b63da1816aca1de52b9f9bee62d1b162d0cdf4d
Diffstat (limited to 'src/com/android/launcher3/AppInfo.java')
-rw-r--r-- | src/com/android/launcher3/AppInfo.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/com/android/launcher3/AppInfo.java b/src/com/android/launcher3/AppInfo.java index 1923df76a..32be12f01 100644 --- a/src/com/android/launcher3/AppInfo.java +++ b/src/com/android/launcher3/AppInfo.java @@ -56,6 +56,11 @@ public class AppInfo extends ItemInfo { int flags = 0; + /** + * {@see ShortcutInfo#isDisabled} + */ + int isDisabled = ShortcutInfo.DEFAULT; + AppInfo() { itemType = LauncherSettings.BaseLauncherColumns.ITEM_TYPE_SHORTCUT; } @@ -75,8 +80,10 @@ public class AppInfo extends ItemInfo { IconCache iconCache) { this.componentName = info.getComponentName(); this.container = ItemInfo.NO_ID; - flags = initFlags(info); + if ((info.getApplicationInfo().flags & LauncherActivityInfoCompat.FLAG_SUSPENDED) != 0) { + isDisabled |= ShortcutInfo.FLAG_DISABLED_SUSPENDED; + } iconCache.getTitleAndIcon(this, info, true /* useLowResIcon */); intent = makeLaunchIntent(context, info, user); this.user = user; @@ -101,6 +108,7 @@ public class AppInfo extends ItemInfo { title = Utilities.trim(info.title); intent = new Intent(info.intent); flags = info.flags; + isDisabled = info.isDisabled; iconBitmap = info.iconBitmap; } @@ -140,4 +148,9 @@ public class AppInfo extends ItemInfo { .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED) .putExtra(EXTRA_PROFILE, serialNumber); } + + @Override + public boolean isDisabled() { + return isDisabled != 0; + } } |