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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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: "
|
||||
|
||||
Reference in New Issue
Block a user