From 76b6f4a8886efba49f2e8b25da5eb11f8b58feac Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Tue, 30 Mar 2021 15:33:25 -0700 Subject: [PATCH] WindowState: Avoid destroying surface during relayout It's hard to find any reason for why this line of code needs to exist in the present system. Prior to the removal of detachChildren we needed to ensure we destroyed the surface when cancelling an animation (as the old surface would be detached and no longer usable), however in the current state I struggle to find any reason. It seems the situation is creating some confusion with the BLASTBufferQueue callback handling when the ViewRoot swaps out the SurfaceControl of an existing BLASTBufferQueue. We need to understand this situation more but the easiest way to stop bugs will be to prevent it from happening in the first place. Bug: 180194022 Test: Existing tests pass, manual testing of cancelling animations while slowing down Change-Id: Id450d49951bd276d3c8a8c16705568e9c328a698 Change-Id: I1e8f56ae6e7280325c0622dd13e5f1d77c4aabde --- services/core/java/com/android/server/wm/WindowState.java | 1 - 1 file changed, 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index eb8315248db2a..8f10e33a4eec4 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -5025,7 +5025,6 @@ class WindowState extends WindowContainer implements WindowManagerP // Cancel the existing exit animation for the next enter animation. if (isAnimating()) { cancelAnimation(); - destroySurfaceUnchecked(); } mAnimatingExit = false; }