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 9eb68bb7cf)
This commit is contained in:
Anushree Ganjam
2023-10-04 11:29:23 -07:00
parent 6105891d36
commit 13517070d8

View File

@@ -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 {