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

Commit 584b9fa4 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix ToggleableGlobalSettingsFlag on user builds" into ub-launcher3-master

parents 9752705e 776c7e63
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -17,13 +17,16 @@
package com.android.launcher3.config;

import static androidx.core.util.Preconditions.checkNotNull;

import android.content.ContentResolver;
import android.content.Context;
import android.content.SharedPreferences;
import android.provider.Settings;

import androidx.annotation.GuardedBy;
import androidx.annotation.Keep;
import androidx.annotation.VisibleForTesting;

import com.android.launcher3.Utilities;

import java.util.ArrayList;
@@ -95,8 +98,9 @@ abstract class BaseFlags {
    public static final TogglableFlag APPLY_CONFIG_AT_RUNTIME = new TogglableFlag(
            "APPLY_CONFIG_AT_RUNTIME", true, "Apply display changes dynamically");

    public static final TogglableFlag ENABLE_TASK_STABILIZER = new TogglableFlag(
            "ENABLE_TASK_STABILIZER", false, "Stable task list across fast task switches");
    public static final ToggleableGlobalSettingsFlag ENABLE_TASK_STABILIZER
            = new ToggleableGlobalSettingsFlag("ENABLE_TASK_STABILIZER", false,
            "Stable task list across fast task switches");

    public static final TogglableFlag QUICKSTEP_SPRINGS = new TogglableFlag("QUICKSTEP_SPRINGS",
            false, "Enable springs for quickstep animations");
@@ -249,11 +253,17 @@ abstract class BaseFlags {

        @Override
        void updateStorage(Context context, boolean value) {
            if (contentResolver == null) {
                return;
            }
            Settings.Global.putInt(contentResolver, getKey(), value ? 1 : 0);
        }

        @Override
        boolean getFromStorage(Context context, boolean defaultValue) {
            if (contentResolver == null) {
                return defaultValue;
            }
            return Settings.Global.getInt(contentResolver, getKey(), defaultValue ? 1 : 0) == 1;
        }