summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Simranjit Kohli <simranjit@google.com> 2024-11-08 14:41:51 -0800
committer Simranjit Kohli <simranjit@google.com> 2024-11-08 15:58:42 -0800
commit8fce13604e684d81165f628ac63c1fa310083cc5 (patch)
tree1898bcc01a68d3c777bb5e990e36dbb91c4bfe4b
parent7ae3519a5c24beb1c6a7be40a3bdb44db80a4154 (diff)
[IMPROVE FILL DIALOG] Setup DeviceConfig flags
Setting up flags to use in feature cl's. Flag: EXEMPT DeviceConfig flag usage Bug: 377868687 Test: na, flag definition only Change-Id: I721c114e0a4e3b34c3cef394a763d25ab6fc3cb8
-rw-r--r--core/java/android/view/autofill/AutofillFeatureFlags.java84
1 files changed, 84 insertions, 0 deletions
diff --git a/core/java/android/view/autofill/AutofillFeatureFlags.java b/core/java/android/view/autofill/AutofillFeatureFlags.java
index 0ab51e45a951..905f350ca6c5 100644
--- a/core/java/android/view/autofill/AutofillFeatureFlags.java
+++ b/core/java/android/view/autofill/AutofillFeatureFlags.java
@@ -316,6 +316,35 @@ public class AutofillFeatureFlags {
// END AUTOFILL PCC CLASSIFICATION FLAGS
+ // START AUTOFILL REMOVE PRE_TRIGGER FLAGS
+
+ /**
+ * Whether pre-trigger flow is disabled.
+ *
+ * @hide
+ */
+ public static final String DEVICE_CONFIG_IMPROVE_FILL_DIALOG_ENABLED = "improve_fill_dialog";
+
+ /**
+ * Minimum amount of time (in milliseconds) to wait after IME animation finishes, and before
+ * starting fill dialog animation.
+ *
+ * @hide
+ */
+ public static final String DEVICE_CONFIG_FILL_DIALOG_MIN_WAIT_AFTER_IME_ANIMATION_END_MS =
+ "fill_dialog_min_wait_after_animation_end_ms";
+
+ /**
+ * Sets a value of timeout in milliseconds, measured after animation end, during which fill
+ * dialog can be shown. If we are at time > animation_end_time + this timeout, fill dialog
+ * wouldn't be shown.
+ *
+ * @hide
+ */
+ public static final String DEVICE_CONFIG_FILL_DIALOG_TIMEOUT_MS = "fill_dialog_timeout_ms";
+
+ // END AUTOFILL REMOVE PRE_TRIGGER FLAGS
+
/**
* Define the max input length for autofill to show suggesiton UI
*
@@ -366,6 +395,17 @@ public class AutofillFeatureFlags {
DEFAULT_AFAA_SHOULD_INCLUDE_ALL_AUTOFILL_TYPE_NOT_NONE_VIEWS_IN_ASSIST_STRUCTURE = true;
// END AUTOFILL FOR ALL APPS DEFAULTS
+ // START AUTOFILL REMOVE PRE_TRIGGER FLAGS DEFAULTS
+ // Default for whether the pre trigger removal is enabled.
+ /** @hide */
+ public static final boolean DEFAULT_IMPROVE_FILL_DIALOG_ENABLED = true;
+ // Default for whether the pre trigger removal is enabled.
+ /** @hide */
+ public static final long DEFAULT_FILL_DIALOG_TIMEOUT_MS = 300; // 300 ms
+ /** @hide */
+ public static final long DEFAULT_FILL_DIALOG_MIN_WAIT_AFTER_IME_ANIMATION_END_MS = 0; // 0 ms
+ // END AUTOFILL REMOVE PRE_TRIGGER FLAGS DEFAULTS
+
/**
* @hide
*/
@@ -611,4 +651,48 @@ public class AutofillFeatureFlags {
}
// END AUTOFILL PCC CLASSIFICATION FUNCTIONS
+
+
+ // START AUTOFILL REMOVE PRE_TRIGGER
+ /**
+ * Whether Autofill Pre Trigger Removal is enabled.
+ *
+ * @hide
+ */
+ public static boolean isImproveFillDialogEnabled() {
+ // TODO(b/266379948): Add condition for checking whether device has PCC first
+
+ return DeviceConfig.getBoolean(
+ DeviceConfig.NAMESPACE_AUTOFILL,
+ DEVICE_CONFIG_IMPROVE_FILL_DIALOG_ENABLED,
+ DEFAULT_IMPROVE_FILL_DIALOG_ENABLED);
+ }
+
+ /**
+ * Whether Autofill Pre Trigger Removal is enabled.
+ *
+ * @hide
+ */
+ public static long getFillDialogTimeoutMs() {
+ // TODO(b/266379948): Add condition for checking whether device has PCC first
+
+ return DeviceConfig.getLong(
+ DeviceConfig.NAMESPACE_AUTOFILL,
+ DEVICE_CONFIG_FILL_DIALOG_TIMEOUT_MS,
+ DEFAULT_FILL_DIALOG_TIMEOUT_MS);
+ }
+
+ /**
+ * Whether Autofill Pre Trigger Removal is enabled.
+ *
+ * @hide
+ */
+ public static long getFillDialogMinWaitAfterImeAnimationtEndMs() {
+ // TODO(b/266379948): Add condition for checking whether device has PCC first
+
+ return DeviceConfig.getLong(
+ DeviceConfig.NAMESPACE_AUTOFILL,
+ DEVICE_CONFIG_FILL_DIALOG_MIN_WAIT_AFTER_IME_ANIMATION_END_MS,
+ DEFAULT_FILL_DIALOG_MIN_WAIT_AFTER_IME_ANIMATION_END_MS);
+ }
}