From 64d5cb371946e7cb53bc189f570be037506c8eb5 Mon Sep 17 00:00:00 2001 From: Vishnu Nair Date: Thu, 25 Feb 2021 18:33:52 -0800 Subject: [PATCH] Reparent SurfacePackage to null when releasing it Previously, before BLAST, we were relying on the recreation of the SurfaceControl when the SurfaceView was detached and reattached to remove the SurfacePackage from the display. With BLAST we can continue to reuse the existing SurfaceControl so this fix explicitly removes SurfacePackage offscreen before releasing it. Fixes: 180436742 Test: try bug steps (Change grid options in wallpaper settings and check for no overlap) Test: go/wm-smoke Change-Id: I9ffbc4b4a724333c799cb57f67c1fc34fe94ce41 --- core/java/android/view/SurfaceView.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java index ec7e4c1f6a8e9..9688c677b9001 100644 --- a/core/java/android/view/SurfaceView.java +++ b/core/java/android/view/SurfaceView.java @@ -544,6 +544,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall // recreate this Surface, so only release it when we are fully // detached. if (mSurfacePackage != null) { + mTmpTransaction.reparent(mSurfacePackage.getSurfaceControl(), null).apply(); mSurfacePackage.release(); mSurfacePackage = null; }