Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 44b7b638 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Persist prediction cache on every update" into ub-launcher3-rvc-dev am:...

Merge "Persist prediction cache on every update" into ub-launcher3-rvc-dev am: 1cc0010e am: 21ff5c4f

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

Change-Id: I92f9793aefc493d61b10622402339ac5f85acdd7
parents 2985c058 21ff5c4f
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -113,8 +113,6 @@ public class HotseatPredictionController implements DragController.DragListener,
    private AllAppsStore mAllAppsStore;
    private AnimatorSet mIconRemoveAnimators;
    private boolean mUIUpdatePaused = false;
    private boolean mRequiresCacheUpdate = true;
    private boolean mIsCacheEmpty;
    private boolean mIsDestroyed = false;


@@ -350,7 +348,6 @@ public class HotseatPredictionController implements DragController.DragListener,
            fillGapsWithPrediction();
            return;
        }
        mIsCacheEmpty = apps.isEmpty();
        int count = Math.min(ranks.size(), apps.size());
        List<WorkspaceItemInfo> items = new ArrayList<>(count);
        for (int i = 0; i < count; i++) {
@@ -393,14 +390,7 @@ public class HotseatPredictionController implements DragController.DragListener,
        }
        updateDependencies();
        fillGapsWithPrediction();
        cachePredictionComponentKeysIfNecessary(componentKeys);
    }

    private void cachePredictionComponentKeysIfNecessary(ArrayList<ComponentKey> componentKeys) {
        if (!mRequiresCacheUpdate && componentKeys.isEmpty() == mIsCacheEmpty) return;
        mPredictionModel.cachePredictionComponentKeys(componentKeys);
        mIsCacheEmpty = componentKeys.isEmpty();
        mRequiresCacheUpdate = false;
    }

    private void updateDependencies() {
@@ -429,7 +419,6 @@ public class HotseatPredictionController implements DragController.DragListener,
            notifyItemAction(mPredictionModel.wrapAppTargetWithLocation(appTarget,
                    AppTargetEvent.ACTION_PIN, workspaceItemInfo));
        }
        mRequiresCacheUpdate = true;
    }

    private List<WorkspaceItemInfo> mapToWorkspaceItemInfo(
@@ -583,7 +572,6 @@ public class HotseatPredictionController implements DragController.DragListener,
        }
        mDragObject = null;
        fillGapsWithPrediction(true, this::removeOutlineDrawings);
        mRequiresCacheUpdate = true;
    }