summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Chau <alexchau@google.com>2023-01-31 19:23:27 +0000
committerAlex Chau <alexchau@google.com>2023-01-31 19:24:31 +0000
commite5c1edb31bb94c1370bb71dca51a371c1547dbe1 (patch)
treed133a2602872fa297ef753cdefceb07fc5ae60f4
parent526e1689065cef6baa09411219f61fc6b1b0b8f2 (diff)
downloadLauncher3-e5c1edb31bb94c1370bb71dca51a371c1547dbe1.tar.gz
Clear PredictorState targets when it's re-registered
- After SUW, registerPredictor is called for hotseat, and then BaseLauncherBinder will call bindExtraContainerItems with empty items. A subsequent registerPredictor will then be triggered by LoadTask, but handleUpdate will skip the update due to no diff in PredictorState targets. As a result, HotseatPredictionController always have no items after SUW - Clearing PredictorState when it's re-registerted will allow the respective prediction controller to receive new prediction items that comes with the registration. Fix: 265340241 Test: Factory reset, pass SUW, prediction items are in hotseat Test: Reboot, prediction items are in hotseat Change-Id: Ie6e219028e7fde42854459d34806a04052dc41ba
-rw-r--r--quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java b/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java
index 118cfc6620..ad6ce7dbd2 100644
--- a/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java
+++ b/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java
@@ -306,6 +306,7 @@ public class QuickstepModelDelegate extends ModelDelegate {
}
private void registerPredictor(PredictorState state, AppPredictor predictor) {
+ state.setTargets(Collections.emptyList());
state.predictor = predictor;
state.predictor.registerPredictionUpdates(
MODEL_EXECUTOR, t -> handleUpdate(state, t));