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: Ic995e087260e8ac618c10d2e8fddca593b4f8a74
This commit is contained in:
Ahaan Ugale
2021-05-14 21:19:50 +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++) {