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

Commit 5ea304db authored by Robert Carr's avatar Robert Carr
Browse files

Replace SurfaceControl#destroy with #remove

Because there may be other references, #destroy does
not actually destroy a Surface. We try and make this more clear
in the naming.

Bug: 111297488
Test: Builds
Change-Id: I3a395abf4449de27fac298e37a96eb54c204c42f
parent cc6d4839
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -868,12 +868,11 @@ public final class SurfaceControl implements Parcelable {
    }

    /**
     * Free all server-side state associated with this surface and
     * release this object's reference.  This method can only be
     * called from the process that created the service.
     * Release the local resources like {@link #release} but also
     * remove the Surface from the screen.
     * @hide
     */
    public void destroy() {
    public void remove() {
        if (mNativeObject != 0) {
            nativeDestroy(mNativeObject);
            mNativeObject = 0;
+4 −4
Original line number Diff line number Diff line
@@ -334,7 +334,7 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb

        updateSurface();
        if (mSurfaceControl != null) {
            mSurfaceControl.destroy();
            mSurfaceControl.remove();
        }
        mSurfaceControl = null;

@@ -502,11 +502,11 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb

    private void releaseSurfaces() {
        if (mSurfaceControl != null) {
            mSurfaceControl.destroy();
            mSurfaceControl.remove();
            mSurfaceControl = null;
        }
        if (mBackgroundControl != null) {
            mBackgroundControl.destroy();
            mBackgroundControl.remove();
            mBackgroundControl = null;
        }
    }
@@ -816,7 +816,7 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb
        }

        if (mDeferredDestroySurfaceControl != null) {
            mDeferredDestroySurfaceControl.destroy();
            mDeferredDestroySurfaceControl.remove();
            mDeferredDestroySurfaceControl = null;
        }

+1 −1
Original line number Diff line number Diff line
@@ -1596,7 +1596,7 @@ public final class ViewRootImpl implements ViewParent,
        mSurfaceSession = null;

        if (mBoundsSurfaceControl != null) {
            mBoundsSurfaceControl.destroy();
            mBoundsSurfaceControl.remove();
            mBoundsSurface.release();
            mBoundsSurfaceControl = null;
        }
+1 −1
Original line number Diff line number Diff line
@@ -1013,7 +1013,7 @@ public final class Magnifier {
            }
            synchronized (mLock) {
                mRenderer.destroy();
                mSurfaceControl.destroy();
                mSurfaceControl.remove();
                mSurfaceSession.kill();
                mHandler.removeCallbacks(mMagnifierUpdater);
                if (mBitmap != null) {
+1 −1
Original line number Diff line number Diff line
@@ -629,7 +629,7 @@ final class ColorFade {
            mSurfaceLayout = null;
            SurfaceControl.openTransaction();
            try {
                mSurfaceControl.destroy();
                mSurfaceControl.remove();
                mSurface.release();
            } finally {
                SurfaceControl.closeTransaction();
Loading