Allow ShortcutPackage#findAll to return cached shortcuts.

Previously cached shortcuts are filtered from the result when it isn't
pinned, which prevents them from being used by other system services.

Bug: 175051424
Test: atest com.android.server.pm.ShortcutManagerTest1
            com.android.server.pm.ShortcutManagerTest2
            com.android.server.pm.ShortcutManagerTest3
            com.android.server.pm.ShortcutManagerTest4
            com.android.server.pm.ShortcutManagerTest5
            com.android.server.pm.ShortcutManagerTest6
            com.android.server.pm.ShortcutManagerTest7
            com.android.server.pm.ShortcutManagerTest8
            com.android.server.pm.ShortcutManagerTest9
            com.android.server.pm.ShortcutManagerTest10
            com.android.server.pm.ShortcutManagerTest11
Change-Id: I59b9f867da6291f98ed1d05899fcc9080f47455e
This commit is contained in:
Pinyao Ting
2020-12-11 16:45:47 -08:00
parent e0baa92030
commit 547c4f70c3

View File

@@ -737,7 +737,7 @@ class ShortcutPackage extends ShortcutPackageItem {
|| ((pinnedByCallerSet != null) && pinnedByCallerSet.contains(si.getId()));
if (!getPinnedByAnyLauncher) {
if (si.isFloating()) {
if (si.isFloating() && !si.isCached()) {
if (!isPinnedByCaller) {
continue;
}