From 5eb07f3755338bb4b8de8bb4b2e08cc0c6fe2cbf Mon Sep 17 00:00:00 2001 From: Haoran Zhang Date: Thu, 18 Apr 2024 20:47:15 +0000 Subject: [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 --- core/java/android/view/ViewStructure.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 @@ -75,6 +75,21 @@ public abstract class ViewStructure { public static final String EXTRA_FIRST_ACTIVE_POSITION = "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. * -- cgit v1.2.3-59-g8ed1b