Refactor transition player to fix merge ordering
The existing code was starting to get non-understandable and had several bugs around ordering of transitions which were merged or aborted. This CL separates the singular "active transitions" list into 3 queues. When the player becomes aware of a transition, it places it into the pending queue. Once Core reports taht it is ready, it is moved to the ready queue. If there are no active animations (active list is empty), it will move the first item from the ready queue into the active list and start playing it. If there is an ongoing animation, it will attempt to merge the first item in the ready queue -- if it succeeds, it will be moved into the playing transition's list of "merged" transitions. Finished transitions are removed from the active list. Whenever a significant change happens (something finishes, merges, becomes ready), it will re-check the ready-queue. This continues until there is nothing left. Keeping separate lists should make it clearer what state each transition is in and reduces a lot of confusing logic. Additionally, this is a better base for eventually having parallel animaations. Bug: 270986780 Test: ShellTransitionTests (existing and new testInterleavedMerging) Change-Id: I84ac88416d9d152dd51a864b2a3bac61eded0b3f
Loading
Please register or sign in to comment