summaryrefslogtreecommitdiff
path: root/core/java/android/view/ViewStructure.java
diff options
context:
space:
mode:
authorFelipe Leme <felipeal@google.com>2017-03-17 18:05:01 -0700
committerFelipe Leme <felipeal@google.com>2017-03-20 16:21:41 -0700
commitf8a8174cd5bc8aff63befd6ca6d96d21e89260bd (patch)
tree10276aa1d5fe02550c2a1664b90b069e03f2cf2f /core/java/android/view/ViewStructure.java
parent2eb54b6bd88bd15240ffdf71c00f5c857c6ce34b (diff)
Changes on Assist structure to handle virtual child for autofill:
- Removed overloaded newChild() methods. - Added a setAutofillId(parent, virtualId). - Changed view so AutofillId is set on all relevant methods. Test: VirtualContainerActivityTest (with new tests) pass Bug: 36056207 Change-Id: Ia11344f95c2756e83307c54052878e9dbe471873
Diffstat (limited to 'core/java/android/view/ViewStructure.java')
-rw-r--r--core/java/android/view/ViewStructure.java35
1 files changed, 5 insertions, 30 deletions
diff --git a/core/java/android/view/ViewStructure.java b/core/java/android/view/ViewStructure.java
index 989cb13d3e69..e4eb014d5e0f 100644
--- a/core/java/android/view/ViewStructure.java
+++ b/core/java/android/view/ViewStructure.java
@@ -16,6 +16,7 @@
package android.view;
+import android.annotation.NonNull;
import android.annotation.Nullable;
import android.graphics.Matrix;
import android.graphics.Rect;
@@ -269,20 +270,6 @@ public abstract class ViewStructure {
public abstract ViewStructure newChild(int index);
/**
- * Create a new child {@link ViewStructure} in this view for autofill purposes.
- *
- * @param index the index (in the list of children) to put the new child at (see
- * {@link #addChildCount(int)} and {@link #setChildCount(int)}.
- * @param virtualId an opaque ID to the Android System (although it could be meaningful to the
- * {@link View} creating the {@link ViewStructure}), but it's the same id used on
- * {@link View#autofill(android.util.SparseArray)}.
- * @param flags currently {@code 0}.
- *
- * @return Returns an fresh {@link ViewStructure} ready to be filled in.
- */
- public abstract ViewStructure newChild(int index, int virtualId, int flags);
-
- /**
* Like {@link #newChild}, but allows the caller to asynchronously populate the returned
* child. It can transfer the returned {@link ViewStructure} to another thread for it
* to build its content (and children etc). Once done, some thread must call
@@ -293,25 +280,13 @@ public abstract class ViewStructure {
public abstract ViewStructure asyncNewChild(int index);
/**
- * Like {@link #newChild(int, int, int)}, but allows the caller to asynchronously
- * populate the returned child.
- *
- * <p>It can transfer the returned {@link ViewStructure} to another thread for it to build its
- * content (and children etc).
- *
- * <p>Once done, some thread must call {@link #asyncCommit()} to tell the containing
- * {@link ViewStructure} that the async population is done.
+ * Sets the {@link AutofillId} for this virtual node.
*
- * @param index the index (in the list of children) to put the new child at (see
- * {@link #addChildCount(int)} and {@link #setChildCount(int)}.
- * @param virtualId an opaque ID to the Android System (although it could be meaningful to the
- * {@link View} creating the {@link ViewStructure}), but it's the same id used on
+ * @param parent parent node.
+ * @param virtualId an opaque ID to the Android System; it's the same id used on
* {@link View#autofill(android.util.SparseArray)}.
- * @param flags currently {@code 0}.
- *
- * @return Returns an fresh {@link ViewStructure} ready to be filled in.
*/
- public abstract ViewStructure asyncNewChild(int index, int virtualId, int flags);
+ public abstract void setAutofillId(@NonNull ViewStructure parent, int virtualId);
/**
* Sets the {@link View#getAutofillType()} that can be used to autofill this node.