Loading quickstep/src/com/android/launcher3/uioverrides/flags/FlagsFactory.java +15 −1 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ public class FlagsFactory { public static final String NAMESPACE_LAUNCHER = "launcher"; private static final List<DebugFlag> sDebugFlags = new ArrayList<>(); private static final List<IntFlag> sIntFlags = new ArrayList<>(); private static SharedPreferences sSharedPreferences; static final BooleanFlag TEAMFOOD_FLAG = getReleaseFlag( Loading Loading @@ -132,7 +133,14 @@ public class FlagsFactory { public static IntFlag getIntFlag( int bugId, String key, int defaultValueInCode, String description) { INSTANCE.mKeySet.add(key); return new IntFlag(DeviceConfig.getInt(NAMESPACE_LAUNCHER, key, defaultValueInCode)); int defaultValue = DeviceConfig.getInt(NAMESPACE_LAUNCHER, key, defaultValueInCode); if (IS_DEBUG_DEVICE) { IntDeviceFlag flag = new IntDeviceFlag(key, defaultValue, defaultValueInCode); sIntFlags.add(flag); return flag; } else { return new IntFlag(defaultValue); } } static List<DebugFlag> getDebugFlags() { Loading Loading @@ -178,6 +186,12 @@ public class FlagsFactory { } } } pw.println("IntFlags:"); synchronized (sIntFlags) { for (IntFlag flag : sIntFlags) { pw.println(" " + flag); } } } private void onPropertiesChanged(Properties properties) { Loading quickstep/src/com/android/launcher3/uioverrides/flags/IntDeviceFlag.java 0 → 100644 +34 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.launcher3.uioverrides.flags; import com.android.launcher3.config.FeatureFlags.IntFlag; public class IntDeviceFlag extends IntFlag { public final String key; private final int mDefaultValueInCode; public IntDeviceFlag(String key, int currentValue, int defaultValueInCode) { super(currentValue); this.key = key; mDefaultValueInCode = defaultValueInCode; } @Override public String toString() { return key + ": mCurrentValue=" + get() + ", defaultValueInCode=" + mDefaultValueInCode; } } Loading
quickstep/src/com/android/launcher3/uioverrides/flags/FlagsFactory.java +15 −1 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ public class FlagsFactory { public static final String NAMESPACE_LAUNCHER = "launcher"; private static final List<DebugFlag> sDebugFlags = new ArrayList<>(); private static final List<IntFlag> sIntFlags = new ArrayList<>(); private static SharedPreferences sSharedPreferences; static final BooleanFlag TEAMFOOD_FLAG = getReleaseFlag( Loading Loading @@ -132,7 +133,14 @@ public class FlagsFactory { public static IntFlag getIntFlag( int bugId, String key, int defaultValueInCode, String description) { INSTANCE.mKeySet.add(key); return new IntFlag(DeviceConfig.getInt(NAMESPACE_LAUNCHER, key, defaultValueInCode)); int defaultValue = DeviceConfig.getInt(NAMESPACE_LAUNCHER, key, defaultValueInCode); if (IS_DEBUG_DEVICE) { IntDeviceFlag flag = new IntDeviceFlag(key, defaultValue, defaultValueInCode); sIntFlags.add(flag); return flag; } else { return new IntFlag(defaultValue); } } static List<DebugFlag> getDebugFlags() { Loading Loading @@ -178,6 +186,12 @@ public class FlagsFactory { } } } pw.println("IntFlags:"); synchronized (sIntFlags) { for (IntFlag flag : sIntFlags) { pw.println(" " + flag); } } } private void onPropertiesChanged(Properties properties) { Loading
quickstep/src/com/android/launcher3/uioverrides/flags/IntDeviceFlag.java 0 → 100644 +34 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.launcher3.uioverrides.flags; import com.android.launcher3.config.FeatureFlags.IntFlag; public class IntDeviceFlag extends IntFlag { public final String key; private final int mDefaultValueInCode; public IntDeviceFlag(String key, int currentValue, int defaultValueInCode) { super(currentValue); this.key = key; mDefaultValueInCode = defaultValueInCode; } @Override public String toString() { return key + ": mCurrentValue=" + get() + ", defaultValueInCode=" + mDefaultValueInCode; } }