Update LayerVector if the mirrorRoot is already inside
Mirror display creation and commitment are executed in different threads. The mMirrorDisplays may not have been updated when commitMirrorDisplays, so do the commitCreatedLayers first. If handleLayerCreatedLocked adding mirrorRoot to LayerVector of mCurrentState is executed before commitMirrorDisplays updating the LayerStack of the mirrorRoot as -1, The order of LayerVector will be disordered. Finally, the mirrorRoot cannot be found when removing. In order to fix this problem. Before commitMirrorDisplays sets the LayerStack of mirrorRoot, it needs to confirm whether the mirrorRoot is in LayerVector. If it is in LayerVector, re-add the layer to ensure that it is on the tail. Bug: 294942764 Test: Monkey test with 10 screen recording (cherry picked from https://partner-android-review.googlesource.com/q/commit:dd3d3ef5a393ee331c14de707321b3e7e3f60446) Merged-In: Iebcab7249ddbab31e8549c6d51a9b09c4c3549f4 Change-Id: Iebcab7249ddbab31e8549c6d51a9b09c4c3549f4
Loading
Please register or sign in to comment