From 6534317317c1d8e86c5565932bd6b4508f2ad980 Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Mon, 8 Jun 2020 16:11:23 -0400 Subject: [PATCH] Fix shortcut flags Test: view the conversation detail page for a conversation with a posted notification Fixes: 158033229 Change-Id: I3c51d9565201cb39a5d76d8aaca75c026e630e51 --- .../android/settings/notification/NotificationBackend.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/notification/NotificationBackend.java b/src/com/android/settings/notification/NotificationBackend.java index 483e8aaa33e..e23e4a567d7 100644 --- a/src/com/android/settings/notification/NotificationBackend.java +++ b/src/com/android/settings/notification/NotificationBackend.java @@ -17,8 +17,10 @@ package com.android.settings.notification; import static android.app.NotificationManager.IMPORTANCE_NONE; import static android.app.NotificationManager.IMPORTANCE_UNSPECIFIED; +import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_CACHED; import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_DYNAMIC; import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_PINNED; +import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_PINNED_BY_ANY_LAUNCHER; import android.app.INotificationManager; import android.app.NotificationChannel; @@ -544,7 +546,8 @@ public class NotificationBackend { LauncherApps.ShortcutQuery query = new LauncherApps.ShortcutQuery() .setPackage(pkg) - .setQueryFlags(FLAG_MATCH_DYNAMIC | FLAG_MATCH_PINNED) + .setQueryFlags(FLAG_MATCH_DYNAMIC + | FLAG_MATCH_PINNED_BY_ANY_LAUNCHER | FLAG_MATCH_CACHED) .setShortcutIds(Arrays.asList(id)); List shortcuts = la.getShortcuts( query, UserHandle.of(UserHandle.getUserId(uid)));