summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Workspace.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2014-09-19 19:58:07 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-09-19 19:58:07 +0000
commitacefecbff3141b43dc55fe18146cf842d1d4a8ae (patch)
tree04a8869721e76d2963e64f6b4f1ac87276aa013e /src/com/android/launcher3/Workspace.java
parent7e053f8784c886359f911161db5fd8b61333450d (diff)
parenta22666f68151269853e7ab6ab696ee6361bac793 (diff)
downloadandroid_packages_apps_Trebuchet-acefecbff3141b43dc55fe18146cf842d1d4a8ae.tar.gz
android_packages_apps_Trebuchet-acefecbff3141b43dc55fe18146cf842d1d4a8ae.tar.bz2
android_packages_apps_Trebuchet-acefecbff3141b43dc55fe18146cf842d1d4a8ae.zip
Merge "Updating promise icon's bitmap and label when onBadgingChanged is received" into ub-now-porkchop
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 051b0c085..774996e56 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>();