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
This commit is contained in:
Vishnu Nair
2021-02-25 18:33:52 -08:00
parent 04501d566e
commit 64d5cb3719

View File

@@ -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;
}