Fix regression where ShortcutRequest returns no results
There was a subtle bug introduced by ag/9898176 where we now accept
String... shortcutIds. There are a couple calls that don't pass any
id's, which means the shortcut query is doomed to return an empty list.
Instead, we should pass null to match all shortcuts for that package.
Bug: 147831521
Change-Id: I928b6ed23b7e0ad01d95749cabf88ada053bcdd3
diff --git a/src/com/android/launcher3/shortcuts/ShortcutRequest.java b/src/com/android/launcher3/shortcuts/ShortcutRequest.java
index e6203b4..5291ce4 100644
--- a/src/com/android/launcher3/shortcuts/ShortcutRequest.java
+++ b/src/com/android/launcher3/shortcuts/ShortcutRequest.java
@@ -58,10 +58,20 @@
mUserHandle = userHandle;
}
+ /** @see #forPackage(String, List) */
+ public ShortcutRequest forPackage(String packageName) {
+ return forPackage(packageName, (List<String>) null);
+ }
+
+ /** @see #forPackage(String, List) */
public ShortcutRequest forPackage(String packageName, String... shortcutIds) {
return forPackage(packageName, Arrays.asList(shortcutIds));
}
+ /**
+ * @param shortcutIds If null, match all shortcuts, otherwise only match the given id's.
+ * @return A list of ShortcutInfo's associated with the given package.
+ */
public ShortcutRequest forPackage(String packageName, @Nullable List<String> shortcutIds) {
if (!GO_DISABLE_WIDGETS && packageName != null) {
mQuery.setPackage(packageName);