Try to fix IndexOutBoundsException in Task#removeChild
When calling Task#removeChild in a Task with finishing task overlay
activities, it calls ActivityStackSupervisor#removeTask, and goes to
performClearTaskAtIndexLocked and calls removeChild() recursively,
which leads to iterating over mChildren twice.
This CL introduces a flag mInRemoveTask to prevent the double
invocation of removeTask, and also refactors
performClearTaskAtIndesLocked a bit to align with the current behavior.
Test: atest WmTests:TaskTests
Bug: 157663342
Change-Id: I9e3bb6947bca9adc87497d16947de644f3227ee4
3 files changed