summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorTYM Tsai <tymtsai@google.com>2021-08-04 00:48:55 +0800
committerTYM Tsai <tymtsai@google.com>2021-12-21 22:23:27 +0800
commit9f8d8c01712ba1854b5b321a89d5777824605889 (patch)
treeba97c83993144bd714d773ddb5890638d7928369 /core/java/android
parenteb867fdea92761f199565470e1f266632f02baf1 (diff)
Migrate compat mode allowed list to DeviceConfig
To test, manually played with 'adb shell device_config'. Examples: $ adb shell device_config list autofill $ adb shell device_config delete autofill compat_mode_allowed_packages $ adb shell device_config list autofill compat_mode_allowed_packages: not found $ adb shell device_config put autofill compat_mode_allowed_packages com.android.chrome[url_bar]:com.brave.browser[url_bar] $ adb shell device_config list autofill compat_mode_allowed_packages: found, value is com.android.chrome[url_bar]:com.brave.browser[url_bar] $ adb shell dumpsys autofill see: Autofill Compat State: User: 0 com.android.chrome: maxVersionCode=10000000000, urlBarResourceIds=[url_bar] from device config: com.android.chrome[url_bar]:com.brave.browser[url_bar] Bug: 194967348 Test: atest CtsAutoFillServiceTestCases Test: atest com.android.server.autofill.AutofillManagerServiceTest Change-Id: I775782622adecb42b86de508f502f03039cc34ca
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/provider/Settings.java3
-rw-r--r--core/java/android/view/autofill/AutofillManager.java18
2 files changed, 21 insertions, 0 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index d08475d09faa..9a69d209733f 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -15035,7 +15035,10 @@ public final class Settings {
* {@code p1[url_bar]:p2:p3[url_foo,url_bas]}
*
* @hide
+ * @deprecated Use {@link android.view.autofill.AutofillManager
+ * #DEVICE_CONFIG_AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES} instead.
*/
+ @Deprecated
@SystemApi
@Readable
public static final String AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES =
diff --git a/core/java/android/view/autofill/AutofillManager.java b/core/java/android/view/autofill/AutofillManager.java
index 11220561b00c..bb13c1e78964 100644
--- a/core/java/android/view/autofill/AutofillManager.java
+++ b/core/java/android/view/autofill/AutofillManager.java
@@ -472,6 +472,24 @@ public final class AutofillManager {
public static final String DEVICE_CONFIG_AUGMENTED_SERVICE_REQUEST_TIMEOUT =
"augmented_service_request_timeout";
+ /**
+ * Sets allowed list for the autofill compatibility mode.
+ *
+ * The list of packages is {@code ":"} colon delimited, and each entry has the name of the
+ * package and an optional list of url bar resource ids (the list is delimited by
+ * brackets&mdash{@code [} and {@code ]}&mdash and is also comma delimited).
+ *
+ * <p>For example, a list with 3 packages {@code p1}, {@code p2}, and {@code p3}, where
+ * package {@code p1} have one id ({@code url_bar}, {@code p2} has none, and {@code p3 }
+ * have 2 ids {@code url_foo} and {@code url_bas}) would be
+ * {@code p1[url_bar]:p2:p3[url_foo,url_bas]}
+ *
+ * @hide
+ */
+ @TestApi
+ public static final String DEVICE_CONFIG_AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES =
+ "compat_mode_allowed_packages";
+
/** @hide */
public static final int RESULT_OK = 0;
/** @hide */