Merge "Fix IndexOutOfBoundsException when calling dispatchProvideStructure()" into sc-dev am: 9e22972568

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14442225

Change-Id: Id7dc77bfcd4635d2220b800ffb0478bfc7f35dd2
This commit is contained in:
Ahaan Ugale
2021-05-14 21:18:08 +00:00
committed by Automerger Merge Worker

View File

@@ -3581,7 +3581,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
}
structure.setChildCount(childrenCount);
ArrayList<View> preorderedList = buildOrderedChildList();
ArrayList<View> tempPreorderedList = buildOrderedChildList();
ArrayList<View> preorderedList =
tempPreorderedList != null ? new ArrayList<>(tempPreorderedList) : null;
boolean customOrder = preorderedList == null
&& isChildrenDrawingOrderEnabled();
for (int i = 0; i < childrenCount; i++) {