Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1a9797a7 authored by Candice Lo's avatar Candice Lo Committed by Android (Google) Code Review
Browse files

Merge "Correctly release the surface control to avoid leak" into main

parents f845be5f 7bbdb187
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -76,6 +76,9 @@ public class FullscreenMagnificationController implements ComponentCallbacks {
    private final IWindowManager mIWindowManager;
    private Supplier<SurfaceControlViewHost> mScvhSupplier;
    private SurfaceControlViewHost mSurfaceControlViewHost = null;
    /**
     * The SurfaceControl provided by SurfaceControlViewHost.
     */
    private SurfaceControl mBorderSurfaceControl = null;
    private Rect mWindowBounds;
    private SurfaceControl.Transaction mTransaction;
@@ -286,6 +289,12 @@ public class FullscreenMagnificationController implements ComponentCallbacks {
            mSurfaceControlViewHost = null;
        }

        if (mBorderSurfaceControl != null) {
            mTransaction.reparent(mBorderSurfaceControl, null).apply();
            mBorderSurfaceControl.release();
            mBorderSurfaceControl = null;
        }

        if (mFullscreenBorder != null) {
            if (mHandler.hasCallbacks(mHideBorderImmediatelyRunnable)) {
                mHandler.removeCallbacks(mHideBorderImmediatelyRunnable);