Replacing ItemInfoMatcher with predicate

This removed unnecessary componentName lookups when it
is not required. Many checks just rely on IDs and
userHandle

Bug: 231153610
Test: Presubmit
Change-Id: Ief93954abc5861062a9f55dc2ef181d3de106c62
This commit is contained in:
Sunny Goyal
2022-05-02 10:00:07 -07:00
parent 34f51fbfc4
commit 32084d49d3
18 changed files with 106 additions and 147 deletions

View File

@@ -47,6 +47,7 @@ import com.android.launcher3.util.MultiValueAlpha;
import com.android.quickstep.AnimatedFloat;
import java.io.PrintWriter;
import java.util.function.Predicate;
/**
* Handles properties/data collection, then passes the results to TaskbarView to render.
@@ -309,8 +310,8 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
* 2) FolderIcon of the Folder containing the given icon
* 3) All Apps button
*/
public View getFirstIconMatch(ItemInfoMatcher matcher) {
ItemInfoMatcher folderMatcher = ItemInfoMatcher.forFolderMatch(matcher);
public View getFirstIconMatch(Predicate<ItemInfo> matcher) {
Predicate<ItemInfo> folderMatcher = ItemInfoMatcher.forFolderMatch(matcher);
return mTaskbarView.getFirstMatch(matcher, folderMatcher);
}