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
This commit is contained in:
Tony Wickham 2020-01-17 15:51:36 -08:00
parent 14bd192275
commit d11fa28df9
1 changed files with 10 additions and 0 deletions

View File

@ -58,10 +58,20 @@ public class ShortcutRequest {
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);