Merge "Don't get struct of children of !laidout viewGroup" into oc-mr1-dev

This commit is contained in:
Philip P. Moltmann
2017-08-16 23:49:21 +00:00
committed by Android (Google) Code Review
2 changed files with 14 additions and 4 deletions

View File

@@ -8078,10 +8078,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
boolean forAutofill, @AutofillFlags int flags) {
if (forAutofill) {
structure.setAutofillId(getAutofillId());
if (!isLaidOut()) {
Log.w(VIEW_LOG_TAG, "dispatchProvideAutofillStructure(): not laid out, ignoring");
return;
}
onProvideAutofillStructure(structure, flags);
onProvideAutofillVirtualStructure(structure, flags);
} else if (!isAssistBlocked()) {

View File

@@ -3400,6 +3400,13 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
if (childrenCount <= 0) {
return;
}
if (!isLaidOut()) {
Log.v(VIEW_LOG_TAG, "dispatchProvideStructure(): not laid out, ignoring "
+ childrenCount + " children of " + getAccessibilityViewId());
return;
}
structure.setChildCount(childrenCount);
ArrayList<View> preorderedList = buildOrderedChildList();
boolean customOrder = preorderedList == null
@@ -3476,6 +3483,13 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
if (structure.getChildCount() != 0) {
return;
}
if (!isLaidOut()) {
Log.v(VIEW_LOG_TAG, "dispatchProvideAutofillStructure(): not laid out, ignoring "
+ mChildrenCount + " children of " + getAutofillId());
return;
}
final ChildListForAutoFill children = getChildrenForAutofill(flags);
final int childrenCount = children.size();
structure.setChildCount(childrenCount);