Make the transition sleep failsafe stricter

The original check was too lenient and assuming that the handlers
would finish. However, this is supposed to be a hammer so make it
always go down the force path if there is any other transition
playing or ready.

Bug: 267738124
Test: sleep while animation is playing.
Change-Id: Id08ad965ecfcc831a472356d723b4ee1e419a746
This commit is contained in:
Evan Rosky
2023-03-20 15:36:04 -07:00
parent 71f29f316b
commit 96af0f37cb

View File

@@ -534,7 +534,7 @@ public class Transitions implements RemoteCallable<Transitions> {
}
if (info.getType() == TRANSIT_SLEEP) {
if (activeIdx > 0) {
if (activeIdx > 0 || !mActiveTransitions.isEmpty() || mReadyTransitions.size() > 1) {
// Sleep starts a process of forcing all prior transitions to finish immediately
finishForSleep(null /* forceFinish */);
return;