Fixes onBackAnimationFinished executed in binder thread.

The finishCallback can be called from binder thread. Post it to shell
executor to make sure member fields are synchronized.

Bug: 241808055
Test: verify onBackAnimationFinished is executed in the same thread.
Change-Id: Iaf9ec5499d6d47b51bd06ec68a329259e90ad3b1
This commit is contained in:
wilsonshih
2022-11-15 15:29:53 +08:00
parent efd00e60eb
commit 7843095bf1

View File

@@ -611,8 +611,8 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont
mBackAnimationFinishedCallback = finishedCallback;
ProtoLog.d(WM_SHELL_BACK_PREVIEW, "BackAnimationController: startAnimation()");
runner.startAnimation(apps, wallpapers, nonApps,
BackAnimationController.this::onBackAnimationFinished);
runner.startAnimation(apps, wallpapers, nonApps, () -> mShellExecutor.execute(
BackAnimationController.this::onBackAnimationFinished));
if (apps.length >= 1) {
dispatchOnBackStarted(