Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3f061904 authored by Evan Rosky's avatar Evan Rosky
Browse files

Use an empty transitioninfo for force-sleep

This way, if the sleep transition has content, it won't
be prematurely free'd by one of the "signal" merges.

Bug: 276144574
Test: reduction in reports
Change-Id: If1b255b3e55d7de74dd9358499fea98fd61c310e
parent bdb7f0b0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
    }

+2 −1
Original line number Diff line number Diff line
@@ -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: "