Merge "Persist prediction cache on every update" into ub-launcher3-rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
1cc0010eba
-12
@@ -113,8 +113,6 @@ public class HotseatPredictionController implements DragController.DragListener,
|
|||||||
private AllAppsStore mAllAppsStore;
|
private AllAppsStore mAllAppsStore;
|
||||||
private AnimatorSet mIconRemoveAnimators;
|
private AnimatorSet mIconRemoveAnimators;
|
||||||
private boolean mUIUpdatePaused = false;
|
private boolean mUIUpdatePaused = false;
|
||||||
private boolean mRequiresCacheUpdate = true;
|
|
||||||
private boolean mIsCacheEmpty;
|
|
||||||
private boolean mIsDestroyed = false;
|
private boolean mIsDestroyed = false;
|
||||||
|
|
||||||
|
|
||||||
@@ -350,7 +348,6 @@ public class HotseatPredictionController implements DragController.DragListener,
|
|||||||
fillGapsWithPrediction();
|
fillGapsWithPrediction();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mIsCacheEmpty = apps.isEmpty();
|
|
||||||
int count = Math.min(ranks.size(), apps.size());
|
int count = Math.min(ranks.size(), apps.size());
|
||||||
List<WorkspaceItemInfo> items = new ArrayList<>(count);
|
List<WorkspaceItemInfo> items = new ArrayList<>(count);
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
@@ -393,14 +390,7 @@ public class HotseatPredictionController implements DragController.DragListener,
|
|||||||
}
|
}
|
||||||
updateDependencies();
|
updateDependencies();
|
||||||
fillGapsWithPrediction();
|
fillGapsWithPrediction();
|
||||||
cachePredictionComponentKeysIfNecessary(componentKeys);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void cachePredictionComponentKeysIfNecessary(ArrayList<ComponentKey> componentKeys) {
|
|
||||||
if (!mRequiresCacheUpdate && componentKeys.isEmpty() == mIsCacheEmpty) return;
|
|
||||||
mPredictionModel.cachePredictionComponentKeys(componentKeys);
|
mPredictionModel.cachePredictionComponentKeys(componentKeys);
|
||||||
mIsCacheEmpty = componentKeys.isEmpty();
|
|
||||||
mRequiresCacheUpdate = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateDependencies() {
|
private void updateDependencies() {
|
||||||
@@ -429,7 +419,6 @@ public class HotseatPredictionController implements DragController.DragListener,
|
|||||||
notifyItemAction(mPredictionModel.wrapAppTargetWithLocation(appTarget,
|
notifyItemAction(mPredictionModel.wrapAppTargetWithLocation(appTarget,
|
||||||
AppTargetEvent.ACTION_PIN, workspaceItemInfo));
|
AppTargetEvent.ACTION_PIN, workspaceItemInfo));
|
||||||
}
|
}
|
||||||
mRequiresCacheUpdate = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<WorkspaceItemInfo> mapToWorkspaceItemInfo(
|
private List<WorkspaceItemInfo> mapToWorkspaceItemInfo(
|
||||||
@@ -583,7 +572,6 @@ public class HotseatPredictionController implements DragController.DragListener,
|
|||||||
}
|
}
|
||||||
mDragObject = null;
|
mDragObject = null;
|
||||||
fillGapsWithPrediction(true, this::removeOutlineDrawings);
|
fillGapsWithPrediction(true, this::removeOutlineDrawings);
|
||||||
mRequiresCacheUpdate = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user