From 05df2843ee8fcec539363a84b253e28b09c07e47 Mon Sep 17 00:00:00 2001 From: Steven Ng Date: Mon, 22 Mar 2021 20:22:21 +0000 Subject: [PATCH] Increase the number of prediction for widgets model Test: launch all widgets tray and observes widgets predicted. Bug: 179797520 Change-Id: Id231cde5015a2a79b7532a39343b3340c27e09c9 --- .../com/android/launcher3/model/QuickstepModelDelegate.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java b/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java index b1b4d70152..df3657d01d 100644 --- a/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java +++ b/quickstep/src/com/android/launcher3/model/QuickstepModelDelegate.java @@ -73,6 +73,7 @@ public class QuickstepModelDelegate extends ModelDelegate implements OnIDPChange public static final String LAST_PREDICTION_ENABLED_STATE = "last_prediction_enabled_state"; private static final String LAST_SNAPSHOT_TIME_MILLIS = "LAST_SNAPSHOT_TIME_MILLIS"; + private static final int NUM_OF_RECOMMENDED_WIDGETS_PREDICATION = 20; private static final boolean IS_DEBUG = false; private static final String TAG = "QuickstepModelDelegate"; @@ -217,7 +218,7 @@ public class QuickstepModelDelegate extends ModelDelegate implements OnIDPChange registerWidgetsPredictor(apm.createAppPredictionSession( new AppPredictionContext.Builder(context) .setUiSurface("widgets") - .setPredictedTargetCount(mIDP.numColumns) + .setPredictedTargetCount(NUM_OF_RECOMMENDED_WIDGETS_PREDICATION) .build())); }