diff options
Diffstat (limited to 'quickstep/src/com/android/launcher3/model/PredictionUpdateTask.java')
-rw-r--r-- | quickstep/src/com/android/launcher3/model/PredictionUpdateTask.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/quickstep/src/com/android/launcher3/model/PredictionUpdateTask.java b/quickstep/src/com/android/launcher3/model/PredictionUpdateTask.java index e504141024..2fcbe4e0fe 100644 --- a/quickstep/src/com/android/launcher3/model/PredictionUpdateTask.java +++ b/quickstep/src/com/android/launcher3/model/PredictionUpdateTask.java @@ -15,8 +15,9 @@ */ package com.android.launcher3.model; +import static com.android.launcher3.LauncherPrefs.nonRestorableItem; +import static com.android.launcher3.EncryptionType.ENCRYPTED; import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT; -import static com.android.launcher3.model.QuickstepModelDelegate.LAST_PREDICTION_ENABLED_STATE; import static com.android.quickstep.InstantAppResolverImpl.COMPONENT_CLASS_MARKER; import android.app.prediction.AppTarget; @@ -29,6 +30,7 @@ import android.os.UserHandle; import androidx.annotation.NonNull; +import com.android.launcher3.ConstantItem; import com.android.launcher3.LauncherAppState; import com.android.launcher3.LauncherPrefs; import com.android.launcher3.model.BgDataModel.FixedContainerItems; @@ -47,6 +49,9 @@ import java.util.stream.Collectors; */ public class PredictionUpdateTask extends BaseModelUpdateTask { + public static final ConstantItem<Boolean> LAST_PREDICTION_ENABLED = + nonRestorableItem("last_prediction_enabled_state", true, ENCRYPTED); + private final List<AppTarget> mTargets; private final PredictorState mPredictorState; @@ -61,8 +66,7 @@ public class PredictionUpdateTask extends BaseModelUpdateTask { Context context = app.getContext(); // TODO: remove this - LauncherPrefs.getDevicePrefs(context).edit() - .putBoolean(LAST_PREDICTION_ENABLED_STATE, !mTargets.isEmpty()).apply(); + LauncherPrefs.get(context).put(LAST_PREDICTION_ENABLED, !mTargets.isEmpty()); Set<UserHandle> usersForChangedShortcuts = dataModel.extraItems.get(mPredictorState.containerId).items.stream() |