From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: fgei <fgei@gmail.com>
Date: Mon, 13 Mar 2023 10:29:53 +0000
Subject: [PATCH] Utility class for adding shared preference keys

---
 base/BUILD.gn                                 |   3 +
 .../shared_preferences/SharedPrefsUtils.java  | 136 ++++++++++++++++++
 .../StrictPreferenceKeyChecker.java           |   4 +
 3 files changed, 143 insertions(+)
 create mode 100644 base/android/java/src/org/chromium/base/shared_preferences/SharedPrefsUtils.java

diff --git a/base/BUILD.gn b/base/BUILD.gn
index 55479f4187323..7caa859940f59 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -4500,6 +4500,9 @@ if (is_android) {
       "android/java/src/org/chromium/base/shared_preferences/SharedPreferencesManager.java",
       "android/java/src/org/chromium/base/shared_preferences/StrictPreferenceKeyChecker.java",
     ]
+    sources += [
+      "android/java/src/org/chromium/base/shared_preferences/SharedPrefsUtils.java",
+    ]
   }
 
   android_aidl("process_launcher_aidl") {
diff --git a/base/android/java/src/org/chromium/base/shared_preferences/SharedPrefsUtils.java b/base/android/java/src/org/chromium/base/shared_preferences/SharedPrefsUtils.java
new file mode 100644
index 0000000000000..d482be2d6cc06
--- /dev/null
+++ b/base/android/java/src/org/chromium/base/shared_preferences/SharedPrefsUtils.java
@@ -0,0 +1,136 @@
+package org.chromium.base.shared_preferences;
+
+import org.chromium.build.annotations.CheckDiscard;
+
+import java.util.Arrays;
+
+/**
+ * Wrapper utility class for both (Base)ChromePreferenceKeys and SharedPreferencesManager,
+ * which also serves as storage of added PreferenceKeys.
+ */
+public final class SharedPrefsUtils {
+
+    public static class BoolSharedPref {
+        private final String key;
+        private boolean defValue;
+
+        BoolSharedPref(String key, boolean defValue) {
+            this.key = key;
+            this.defValue = defValue;
+        }
+
+        public String getKey() { return key; }
+
+        public boolean get() {
+            return getSharedPrefManager().readBoolean(key, defValue);
+        }
+
+        public void put(boolean newValue) {
+            getSharedPrefManager().writeBoolean(key, newValue);
+        }
+
+        public boolean putSync(boolean newValue) {
+            return getSharedPrefManager().writeBooleanSync(key, newValue);
+        }
+    }
+
+    public static class IntSharedPref {
+        private final String key;
+        private int defValue;
+        private int[] validValues;
+
+        IntSharedPref(String key, int defValue) {
+            this.key = key;
+            this.defValue = defValue;
+        }
+
+        IntSharedPref(String key, int defValue, int[] validValues) {
+            this.key = key;
+            this.defValue = defValue;
+            this.validValues = validValues;
+        }
+
+        public String getKey() { return key; }
+
+        public int get() {
+            return getSharedPrefManager().readInt(key, defValue);
+        }
+
+        public boolean validateValue(int val) {
+            if (validValues == null) {
+                return true;
+            }
+            // don't do sort() + bsearch() of validValues array, it's expected to have a small number of entries
+            for (int validValue : validValues) {
+                if (val == validValue) {
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public void put(int newValue) {
+            if (!validateValue(newValue)) {
+                return;
+            }
+            getSharedPrefManager().writeInt(key, newValue);
+        }
+
+        public boolean putSync(int newValue) {
+            if (!validateValue(newValue)) {
+                return false;
+            }
+            return getSharedPrefManager().writeIntSync(key, newValue);
+        }
+    }
+
+    public static class StringSharedPref {
+        private final String key;
+        private String defValue;
+
+        StringSharedPref(String key, String defValue) {
+            this.key = key;
+            this.defValue = defValue;
+        }
+
+        public String getKey() { return key; }
+
+        public String get() {
+            return getSharedPrefManager().readString(key, defValue);
+        }
+
+        public boolean validateValue(String val) {
+            return true;
+        }
+
+        public void put(String newValue) {
+            if (!validateValue(newValue)) {
+                return;
+            }
+            getSharedPrefManager().writeString(key, newValue);
+        }
+
+        public boolean putSync(String newValue) {
+            if (!validateValue(newValue)) {
+                return false;
+            }
+            return getSharedPrefManager().writeStringSync(key, newValue);
+        }
+    }
+
+    // Stores SharedPreferences keys and its default value
+    public static class SharedPrefsExt {
+    }
+
+    static SharedPreferencesManager getSharedPrefManager() {
+        return SharedPreferencesManager.getInstanceForRegistry(null);
+    }
+
+    @CheckDiscard("Validation is performed in tests and in debug builds.")
+    static boolean isKeyInUse(String key) {
+        // clang-format off
+        return Arrays.asList(
+        ).contains(key);
+        // clang-format on
+    }
+}
diff --git a/base/android/java/src/org/chromium/base/shared_preferences/StrictPreferenceKeyChecker.java b/base/android/java/src/org/chromium/base/shared_preferences/StrictPreferenceKeyChecker.java
index 3b84739c58cf0..adc0048c97f0f 100644
--- a/base/android/java/src/org/chromium/base/shared_preferences/StrictPreferenceKeyChecker.java
+++ b/base/android/java/src/org/chromium/base/shared_preferences/StrictPreferenceKeyChecker.java
@@ -50,6 +50,10 @@ class StrictPreferenceKeyChecker implements PreferenceKeyChecker {
      * @return Whether |key| is in use.
      */
     private boolean isKeyInUse(String key) {
+        if (SharedPrefsUtils.isKeyInUse(key)) {
+            return true;
+        }
+
         // For non-dynamic legacy keys, a simple map check is enough.
         if (mRegistry.mLegacyFormatKeys.contains(key)) {
             return true;
