summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ted Bauer <tedbauer@google.com> 2024-09-27 16:02:36 +0000
committer Ted Bauer <tedbauer@google.com> 2024-09-27 16:02:36 +0000
commitfec50966daeb71a61553fa5e52fde1c2cbab54d2 (patch)
tree85e41a71a39f855e944724c968d1e21ef2383474
parent0d840015d48f426923f404e9a3058be06d9dc3c4 (diff)
Reland "Make override immediately override aconfigd"
This reverts commit 0d840015d48f426923f404e9a3058be06d9dc3c4. Reason for revert: guard the change with a flag Change-Id: If279c8cafb020367203f85695b60dcec4b52b168
-rw-r--r--services/core/java/com/android/server/am/SettingsToPropertiesMapper.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java b/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java
index a13ce654bb95..bae9a670c438 100644
--- a/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java
+++ b/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java
@@ -40,6 +40,7 @@ import android.aconfigd.Aconfigd.StorageRequestMessages;
import android.aconfigd.Aconfigd.StorageReturnMessage;
import android.aconfigd.Aconfigd.StorageReturnMessages;
import static com.android.aconfig_new_storage.Flags.enableAconfigStorageDaemon;
+import static com.android.aconfig_new_storage.Flags.supportImmediateLocalOverrides;
import java.io.DataInputStream;
import java.io.DataOutputStream;
@@ -491,14 +492,18 @@ public class SettingsToPropertiesMapper {
static void writeFlagOverrideRequest(
ProtoOutputStream proto, String packageName, String flagName, String flagValue,
boolean isLocal) {
+ int localOverrideTag = supportImmediateLocalOverrides()
+ ? StorageRequestMessage.LOCAL_IMMEDIATE
+ : StorageRequestMessage.LOCAL_ON_REBOOT;
+
long msgsToken = proto.start(StorageRequestMessages.MSGS);
long msgToken = proto.start(StorageRequestMessage.FLAG_OVERRIDE_MESSAGE);
proto.write(StorageRequestMessage.FlagOverrideMessage.PACKAGE_NAME, packageName);
proto.write(StorageRequestMessage.FlagOverrideMessage.FLAG_NAME, flagName);
proto.write(StorageRequestMessage.FlagOverrideMessage.FLAG_VALUE, flagValue);
proto.write(StorageRequestMessage.FlagOverrideMessage.OVERRIDE_TYPE, isLocal
- ? StorageRequestMessage.LOCAL_ON_REBOOT
- : StorageRequestMessage.SERVER_ON_REBOOT);
+ ? localOverrideTag
+ : StorageRequestMessage.SERVER_ON_REBOOT);
proto.end(msgToken);
proto.end(msgsToken);
}