diff options
| -rw-r--r-- | core/java/android/view/ViewGroup.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 85d7c10ef91e..1ef6ab796e0c 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -3752,7 +3752,15 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager && !child.isActivityDeniedForAutofillForUnimportantView()) || (shouldIncludeAllChildrenViewWithAutofillTypeNotNone(afm) && child.getAutofillType() != AUTOFILL_TYPE_NONE) - || shouldIncludeAllChildrenViews(afm)){ + || shouldIncludeAllChildrenViews(afm) + || (child instanceof ViewGroup && child.getVisibility() != View.VISIBLE)) { + // If the child is a ViewGroup object and its visibility is not visible, include + // it as part of the assist structure. The children of these invisible ViewGroup + // objects are parsed and included in the assist structure. When the Autofill + // Provider determines the visibility of these children, it looks at their + // visibility as well as their parent's visibility. Omitting invisible parents + // will lead to the Autofill Provider incorrectly assuming that these children + // of invisible parents are actually visible. list.add(child); } else if (child instanceof ViewGroup) { ((ViewGroup) child).populateChildrenForAutofill(list, flags); |