From 13517070d87495bccc8abda1393986236714efad Mon Sep 17 00:00:00 2001 From: Anushree Ganjam Date: Wed, 4 Oct 2023 11:29:23 -0700 Subject: [PATCH] Developer options should reflect the correct DeviceConfig value for ReleaseFlag. Before this change : When a ReleaseFlag is turned on from server side or set in DeviceConfig, developer options shows the flag is off. After this change : When a ReleaseFlag is turned on from server side or set in DeviceConfig, developer options shows the flag is on. This change doesn't reflect the DeviceConfig value changes done using `adb shell device_config put` unless launcher is restarted. Bug: 297202824 Test: Manual Flag: NA Change-Id: I5d83207cf454c60278fd02e59199207e855d51a8 Merged-In: I5d83207cf454c60278fd02e59199207e855d51a8 (cherry picked from commit 9eb68bb7cff97904144ef8593349c8311aff0ffe) --- .../android/launcher3/uioverrides/flags/FlagsFactory.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/flags/FlagsFactory.java b/quickstep/src/com/android/launcher3/uioverrides/flags/FlagsFactory.java index a68e753589..6279f634d6 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/flags/FlagsFactory.java +++ b/quickstep/src/com/android/launcher3/uioverrides/flags/FlagsFactory.java @@ -116,8 +116,9 @@ public class FlagsFactory { boolean defaultValue = DeviceConfig.getBoolean(NAMESPACE_LAUNCHER, key, defaultValueInCode); if (IS_DEBUG_DEVICE) { boolean currentValue = getSharedPreferences().getBoolean(key, defaultValue); - DebugFlag flag = new DeviceFlag(key, description, flagState, currentValue, - defaultValueInCode); + DebugFlag flag = new DeviceFlag(key, description, + (defaultValue == defaultValueInCode) ? flagState + : defaultValue ? ENABLED : DISABLED, currentValue, defaultValueInCode); sDebugFlags.add(flag); return flag; } else {