Loading src/com/android/launcher3/Workspace.java +2 −2 Original line number Diff line number Diff line Loading @@ -3987,8 +3987,8 @@ public class Workspace extends PagedView mapOverItems(MAP_RECURSE, new ItemOperator() { @Override public boolean evaluate(ItemInfo info, View v) { if (info instanceof ShortcutInfo && v instanceof BubbleTextView) { packageUserKey.updateFromItemInfo(info); if (info instanceof ShortcutInfo && v instanceof BubbleTextView && packageUserKey.updateFromItemInfo(info)) { if (updatedBadges.contains(packageUserKey)) { ((BubbleTextView) v).applyBadgeState(info); } Loading src/com/android/launcher3/allapps/AllAppsContainerView.java +1 −2 Original line number Diff line number Diff line Loading @@ -478,8 +478,7 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc public void updateIconBadges(Set<PackageUserKey> updatedBadges) { final PackageUserKey packageUserKey = new PackageUserKey(null, null); for (AlphabeticalAppsList.AdapterItem app : mApps.getAdapterItems()) { if (app.appInfo != null) { packageUserKey.updateFromItemInfo(app.appInfo); if (app.appInfo != null && packageUserKey.updateFromItemInfo(app.appInfo)) { if (updatedBadges.contains(packageUserKey)) { mAdapter.notifyItemChanged(app.position); } Loading src/com/android/launcher3/util/PackageUserKey.java +11 −3 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ import android.os.UserHandle; import android.service.notification.StatusBarNotification; import com.android.launcher3.ItemInfo; import com.android.launcher3.shortcuts.DeepShortcutManager; import java.util.Arrays; Loading Loading @@ -32,9 +33,16 @@ public class PackageUserKey { mHashCode = Arrays.hashCode(new Object[] {packageName, user}); } /** This should only be called to avoid new object creations in a loop. */ public void updateFromItemInfo(ItemInfo info) { /** * This should only be called to avoid new object creations in a loop. * @return Whether this PackageUserKey was successfully updated - it shouldn't be used if not. */ public boolean updateFromItemInfo(ItemInfo info) { if (DeepShortcutManager.supportsShortcuts(info)) { update(info.getTargetComponent().getPackageName(), info.user); return true; } return false; } @Override Loading Loading
src/com/android/launcher3/Workspace.java +2 −2 Original line number Diff line number Diff line Loading @@ -3987,8 +3987,8 @@ public class Workspace extends PagedView mapOverItems(MAP_RECURSE, new ItemOperator() { @Override public boolean evaluate(ItemInfo info, View v) { if (info instanceof ShortcutInfo && v instanceof BubbleTextView) { packageUserKey.updateFromItemInfo(info); if (info instanceof ShortcutInfo && v instanceof BubbleTextView && packageUserKey.updateFromItemInfo(info)) { if (updatedBadges.contains(packageUserKey)) { ((BubbleTextView) v).applyBadgeState(info); } Loading
src/com/android/launcher3/allapps/AllAppsContainerView.java +1 −2 Original line number Diff line number Diff line Loading @@ -478,8 +478,7 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc public void updateIconBadges(Set<PackageUserKey> updatedBadges) { final PackageUserKey packageUserKey = new PackageUserKey(null, null); for (AlphabeticalAppsList.AdapterItem app : mApps.getAdapterItems()) { if (app.appInfo != null) { packageUserKey.updateFromItemInfo(app.appInfo); if (app.appInfo != null && packageUserKey.updateFromItemInfo(app.appInfo)) { if (updatedBadges.contains(packageUserKey)) { mAdapter.notifyItemChanged(app.position); } Loading
src/com/android/launcher3/util/PackageUserKey.java +11 −3 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ import android.os.UserHandle; import android.service.notification.StatusBarNotification; import com.android.launcher3.ItemInfo; import com.android.launcher3.shortcuts.DeepShortcutManager; import java.util.Arrays; Loading Loading @@ -32,9 +33,16 @@ public class PackageUserKey { mHashCode = Arrays.hashCode(new Object[] {packageName, user}); } /** This should only be called to avoid new object creations in a loop. */ public void updateFromItemInfo(ItemInfo info) { /** * This should only be called to avoid new object creations in a loop. * @return Whether this PackageUserKey was successfully updated - it shouldn't be used if not. */ public boolean updateFromItemInfo(ItemInfo info) { if (DeepShortcutManager.supportsShortcuts(info)) { update(info.getTargetComponent().getPackageName(), info.user); return true; } return false; } @Override Loading