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

Commit 647e0df0 authored by Jesse Hall's avatar Jesse Hall Committed by Android (Google) Code Review
Browse files

Merge "Surface: Leave object in unlocked state when unlockCanvasAndPost fails" into lmp-dev

parents 1901e175 d7e55967
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -250,7 +250,7 @@ public class Surface implements Parcelable {
                // double-lock, but that won't happen if mNativeObject was updated.  We can't
                // abandon the old mLockedObject because it might still be in use, so instead
                // we just refuse to re-lock the Surface.
                throw new IllegalStateException("Surface was already locked");
                throw new IllegalArgumentException("Surface was already locked");
            }
            mLockedObject = nativeLockCanvas(mNativeObject, mCanvas, inOutDirty);
            return mCanvas;
@@ -279,11 +279,14 @@ public class Surface implements Parcelable {
            if (mLockedObject == 0) {
                throw new IllegalStateException("Surface was not locked");
            }
            try {
                nativeUnlockCanvasAndPost(mLockedObject, canvas);
            } finally {
                nativeRelease(mLockedObject);
                mLockedObject = 0;
            }
        }
    }

    /**
     * @deprecated This API has been removed and is not supported.  Do not use.