mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-18 18:28:20 +00:00
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:
@@ -27,7 +27,6 @@ import com.android.launcher3.model.data.AppInfo;
|
||||
import com.android.launcher3.model.data.ItemInfo;
|
||||
import com.android.launcher3.model.data.WorkspaceItemInfo;
|
||||
import com.android.launcher3.util.ComponentKey;
|
||||
import com.android.launcher3.util.ItemInfoMatcher;
|
||||
import com.android.launcher3.widget.model.WidgetsListBaseEntry;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -35,6 +34,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -128,7 +128,7 @@ public abstract class BaseModelUpdateTask implements ModelUpdateTask {
|
||||
scheduleCallbackTask(c -> c.bindAllWidgets(widgets));
|
||||
}
|
||||
|
||||
public void deleteAndBindComponentsRemoved(final ItemInfoMatcher matcher) {
|
||||
public void deleteAndBindComponentsRemoved(final Predicate<ItemInfo> matcher) {
|
||||
getModelWriter().deleteItemsFromDatabase(matcher);
|
||||
|
||||
// Call the components-removed callback
|
||||
|
||||
Reference in New Issue
Block a user