Merge "Fixing itemInfoMatcher not working for folders" into sc-v2-dev am: 8d9eaf0c7d

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15786950

Change-Id: Ic48f15846d22e018042bc8d5e4a43ffbd37d374f
This commit is contained in:
TreeHugger Robot
2021-09-08 19:19:36 +00:00
committed by Automerger Merge Worker
@@ -32,6 +32,11 @@ import java.util.Set;
*/
public interface ItemInfoMatcher {
/**
* Empty component used for match testing
*/
ComponentName EMPTY_COMPONENT = new ComponentName("", "");
boolean matches(ItemInfo info, ComponentName cn);
/**
@@ -40,7 +45,7 @@ public interface ItemInfoMatcher {
default boolean matchesInfo(ItemInfo info) {
if (info != null) {
ComponentName cn = info.getTargetComponent();
return cn != null && matches(info, cn);
return matches(info, cn != null ? cn : EMPTY_COMPONENT);
} else {
return false;
}