Merge "Fixing itemInfoMatcher not working for folders" into sc-v2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
8d9eaf0c7d
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user