From 3e66fda5713817dedc8bfb3a5af6c89bcf6ecb4f Mon Sep 17 00:00:00 2001 From: miaojian Date: Wed, 19 Oct 2022 10:45:04 +0800 Subject: Fix NPE when finishing remote animation Make sure the access is in the synchronized block. Bug: 254320691 Test: Manual test Signed-off-by: miaojian Change-Id: Ia244b5ba2d3ba891319b32513841f397177cde0f --- .../java/com/android/server/wm/RemoteAnimationController.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/core/java/com/android/server/wm/RemoteAnimationController.java b/services/core/java/com/android/server/wm/RemoteAnimationController.java index 35cc5e30cacf..ddfdff6e38f8 100644 --- a/services/core/java/com/android/server/wm/RemoteAnimationController.java +++ b/services/core/java/com/android/server/wm/RemoteAnimationController.java @@ -308,11 +308,11 @@ class RemoteAnimationController implements DeathRecipient { mService.closeSurfaceTransaction("RemoteAnimationController#finished"); mIsFinishing = false; } + // Reset input for all activities when the remote animation is finished. + final Consumer updateActivities = + activity -> activity.setDropInputForAnimation(false); + mDisplayContent.forAllActivities(updateActivities); } - // Reset input for all activities when the remote animation is finished. - final Consumer updateActivities = - activity -> activity.setDropInputForAnimation(false); - mDisplayContent.forAllActivities(updateActivities); setRunningRemoteAnimation(false); ProtoLog.i(WM_DEBUG_REMOTE_ANIMATIONS, "Finishing remote animation"); } -- cgit v1.2.3-59-g8ed1b