mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 17:06:49 +00:00
Remove some direct usage of getDevicePrefs()
Bug: 261635315 Test: Manually did testing on device. Change-Id: I47c88bdc031d330f6efa573411ab5dbf154ec8a2
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user