From ba40611dce746824aa6eeb376807886110026b9c Mon Sep 17 00:00:00 2001 From: Vishnu Nair Date: Mon, 15 Mar 2021 09:30:13 -0700 Subject: [PATCH] Check if the sc is valid when finishing seamless rotation If the window is removed, the finish seamless rotation can be triggered from the blast sync timeout. Bug: 182738086 Test: repro steps in bug does not repro anymore Change-Id: I87bef0dbddeb5640e356afb2d2e57334b8690c28 --- services/core/java/com/android/server/wm/SeamlessRotator.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/core/java/com/android/server/wm/SeamlessRotator.java b/services/core/java/com/android/server/wm/SeamlessRotator.java index 1e8b8a5bb576a..4cc369f0a187b 100644 --- a/services/core/java/com/android/server/wm/SeamlessRotator.java +++ b/services/core/java/com/android/server/wm/SeamlessRotator.java @@ -102,6 +102,10 @@ public class SeamlessRotator { * window in the new orientation. */ void finish(Transaction t, WindowContainer win) { + if (win.mSurfaceControl == null || !win.mSurfaceControl.isValid()) { + return; + } + mTransform.reset(); t.setMatrix(win.mSurfaceControl, mTransform, mFloat9); t.setPosition(win.mSurfaceControl, win.mLastSurfacePosition.x, win.mLastSurfacePosition.y);