Merge "Use an empty transitioninfo for force-sleep" into udc-dev

This commit is contained in:
Evan Rosky
2023-04-03 23:05:17 +00:00
committed by Android (Google) Code Review
2 changed files with 3 additions and 2 deletions

View File

@@ -41,9 +41,9 @@ class SleepHandler implements Transitions.TransitionHandler {
@NonNull SurfaceControl.Transaction startTransaction,
@NonNull SurfaceControl.Transaction finishTransaction,
@NonNull Transitions.TransitionFinishCallback finishCallback) {
mSleepTransitions.remove(transition);
startTransaction.apply();
finishCallback.onTransitionFinished(null, null);
mSleepTransitions.remove(transition);
return true;
}

View File

@@ -986,6 +986,7 @@ public class Transitions implements RemoteCallable<Transitions> {
onFinish(forceFinish, null, null);
}
final SurfaceControl.Transaction dummyT = new SurfaceControl.Transaction();
final TransitionInfo dummyInfo = new TransitionInfo(TRANSIT_SLEEP, 0 /* flags */);
while (!mActiveTransitions.isEmpty() && !mSleepHandler.mSleepTransitions.isEmpty()) {
final ActiveTransition playing = mActiveTransitions.get(0);
int sleepIdx = findByToken(mReadyTransitions, mSleepHandler.mSleepTransitions.get(0));
@@ -995,7 +996,7 @@ public class Transitions implements RemoteCallable<Transitions> {
final ActiveTransition nextSleep = mReadyTransitions.get(sleepIdx);
ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, " Attempt to merge SLEEP %s"
+ " into %s", nextSleep, playing);
playing.mHandler.mergeAnimation(nextSleep.mToken, nextSleep.mInfo, dummyT,
playing.mHandler.mergeAnimation(nextSleep.mToken, dummyInfo, dummyT,
playing.mToken, (wct, cb) -> {});
} else {
Log.e(TAG, "Couldn't find sleep transition in ready list: "