diff options
author | Pinyao Ting <pinyaoting@google.com> | 2019-07-25 20:26:54 -0700 |
---|---|---|
committer | Pinyao Ting <pinyaoting@google.com> | 2019-07-30 19:39:10 +0000 |
commit | 4d1a0e2a7b859672a6aac52e9fd909d42a12b895 (patch) | |
tree | 7d7e8866f80fa05a47a2aab3c7058e4ec173dfc5 /src | |
parent | c0974870e4a700e43a33e3a205f0dde46828f338 (diff) | |
download | android_packages_apps_Trebuchet-4d1a0e2a7b859672a6aac52e9fd909d42a12b895.tar.gz android_packages_apps_Trebuchet-4d1a0e2a7b859672a6aac52e9fd909d42a12b895.tar.bz2 android_packages_apps_Trebuchet-4d1a0e2a7b859672a6aac52e9fd909d42a12b895.zip |
show dot on shortcut when incoming notification contains exactly the
same shortcut id
Bug: 132336512
Change-Id: Iddf4cfe8ad60c12e8de8b171bed392f1bb0a6761
Merged-In: Iddf4cfe8ad60c12e8de8b171bed392f1bb0a6761
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/popup/PopupDataProvider.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/com/android/launcher3/popup/PopupDataProvider.java b/src/com/android/launcher3/popup/PopupDataProvider.java index 2d301ac00..dd496b02b 100644 --- a/src/com/android/launcher3/popup/PopupDataProvider.java +++ b/src/com/android/launcher3/popup/PopupDataProvider.java @@ -40,6 +40,7 @@ import java.util.Map; import java.util.function.Predicate; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; /** * Provides data for the popup menu that appears after long-clicking on apps. @@ -167,12 +168,14 @@ public class PopupDataProvider implements NotificationListener.NotificationsChan return count == null ? 0 : count; } - public DotInfo getDotInfoForItem(ItemInfo info) { - if (!DeepShortcutManager.supportsShortcuts(info)) { + public @Nullable DotInfo getDotInfoForItem(@NonNull ItemInfo info) { + DotInfo dotInfo = mPackageUserToDotInfos.get(PackageUserKey.fromItemInfo(info)); + List<NotificationKeyData> notifications = + dotInfo == null ? Collections.EMPTY_LIST : dotInfo.getNotificationKeys(); + if (!DeepShortcutManager.supportsNotificationDots(info, notifications)) { return null; } - - return mPackageUserToDotInfos.get(PackageUserKey.fromItemInfo(info)); + return dotInfo; } public @NonNull List<NotificationKeyData> getNotificationKeysForItem(ItemInfo info) { |