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

Commit e5c1edb3 authored by Alex Chau's avatar Alex Chau
Browse files

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
parent 526e1689
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -306,6 +306,7 @@ public class QuickstepModelDelegate extends ModelDelegate {
    }
    }


    private void registerPredictor(PredictorState state, AppPredictor predictor) {
    private void registerPredictor(PredictorState state, AppPredictor predictor) {
        state.setTargets(Collections.emptyList());
        state.predictor = predictor;
        state.predictor = predictor;
        state.predictor.registerPredictionUpdates(
        state.predictor.registerPredictionUpdates(
                MODEL_EXECUTOR, t -> handleUpdate(state, t));
                MODEL_EXECUTOR, t -> handleUpdate(state, t));