summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Haoran Zhang <haoranzhang@google.com> 2024-04-18 20:47:15 +0000
committer Haoran Zhang <haoranzhang@google.com> 2024-04-19 23:10:40 +0000
commit5eb07f3755338bb4b8de8bb4b2e08cc0c6fe2cbf (patch)
tree22434004b76f355edc0e5bb84e2f7ed808280f9e
parentea89bae88a128d19d4a9807c7867d24c5980e2be (diff)
[Autofill Framework] Add a new key for specifying virtual structure type in ViewStructure extra.
Verified the key can be used and assist structure dump contains the value by testing on a local build, where I added a placeholder value into the ViewStructure extra. Screenshot of assist structure dumped at debug build: https://screenshot.googleplex.com/6CGGfUgu8kVqx6E Bug: b/331269835 Test: Tested key is dumped locally with a debug build Change-Id: I22cbf06c2f3ddf7f35b2063f59d72176056c3f27
-rw-r--r--core/java/android/view/ViewStructure.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/java/android/view/ViewStructure.java b/core/java/android/view/ViewStructure.java
index 6c852c3a2d3f..86e5bea46882 100644
--- a/core/java/android/view/ViewStructure.java
+++ b/core/java/android/view/ViewStructure.java
@@ -76,6 +76,21 @@ public abstract class ViewStructure {
"android.view.ViewStructure.extra.FIRST_ACTIVE_POSITION";
/**
+ * Key used for writing the type of the view that generated the virtual structure of its
+ * children.
+ *
+ * For example, if the virtual structure is generated by a webview, the value would be
+ * "WebView". If the virtual structure is generated by a compose view, then the value would be
+ * "ComposeView". The value is of type String.
+ *
+ * This value is added to mainly help with debugging purpose.
+ *
+ * @hide
+ */
+ public static final String EXTRA_VIRTUAL_STRUCTURE_TYPE =
+ "android.view.ViewStructure.extra.VIRTUAL_STRUCTURE_TYPE";
+
+ /**
* Set the identifier for this view.
*
* @param id The view's identifier, as per {@link View#getId View.getId()}.