summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Workspace.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2014-09-18 13:25:15 -0700
committerSunny Goyal <sunnygoyal@google.com>2014-09-19 12:16:52 -0700
commita22666f68151269853e7ab6ab696ee6361bac793 (patch)
tree1ce68e4e4bea07383e7584e3349319d6058b77d0 /src/com/android/launcher3/Workspace.java
parent136882c1950da1e5f0a24a8b6807b186a3297d8e (diff)
downloadandroid_packages_apps_Trebuchet-a22666f68151269853e7ab6ab696ee6361bac793.tar.gz
android_packages_apps_Trebuchet-a22666f68151269853e7ab6ab696ee6361bac793.tar.bz2
android_packages_apps_Trebuchet-a22666f68151269853e7ab6ab696ee6361bac793.zip
Updating promise icon's bitmap and label when onBadgingChanged is received
Bug: 17583799 Change-Id: I68b4f9d4086c43bd949ad8b46b574ec78edb32db
Diffstat (limited to 'src/com/android/launcher3/Workspace.java')
-rw-r--r--src/com/android/launcher3/Workspace.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 909cf5f8c..7b4e432d3 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -4921,6 +4921,38 @@ public class Workspace extends SmoothPagedView
removeItemsByPackageName(packages, user);
}
+ public void updatePackageBadge(final String packageName, final UserHandleCompat user) {
+ mapOverItems(MAP_RECURSE, new ItemOperator() {
+ @Override
+ public boolean evaluate(ItemInfo info, View v, View parent) {
+ if (info instanceof ShortcutInfo && v instanceof BubbleTextView) {
+ ShortcutInfo shortcutInfo = (ShortcutInfo) info;
+ ComponentName cn = shortcutInfo.getTargetComponent();
+ if (user.equals(shortcutInfo.user) && cn != null
+ && shortcutInfo.isPromise()
+ && packageName.equals(cn.getPackageName())) {
+ if (shortcutInfo.hasStatusFlag(ShortcutInfo.FLAG_AUTOINTALL_ICON)) {
+ // For auto install apps update the icon as well as label.
+ mIconCache.getTitleAndIcon(shortcutInfo,
+ shortcutInfo.promisedIntent, user, true);
+ } else {
+ // Only update the icon for restored apps.
+ shortcutInfo.updateIcon(mIconCache);
+ }
+ BubbleTextView shortcut = (BubbleTextView) v;
+ shortcut.applyFromShortcutInfo(shortcutInfo, mIconCache, true, false);
+
+ if (parent != null) {
+ parent.invalidate();
+ }
+ }
+ }
+ // process all the shortcuts
+ return false;
+ }
+ });
+ }
+
public void updatePackageState(ArrayList<PackageInstallInfo> installInfos) {
HashSet<String> completedPackages = new HashSet<String>();