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

Commit d4b38fe5 authored by Jesse Hall's avatar Jesse Hall Committed by Android Git Automerger
Browse files

am 647e0df0: Merge "Surface: Leave object in unlocked state when...

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

* commit '647e0df0':
  Surface: Leave object in unlocked state when unlockCanvasAndPost fails
parents 097c8d60 647e0df0
Loading
Loading
Loading
Loading
+7 −4
Original line number Original line 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
                // 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
                // abandon the old mLockedObject because it might still be in use, so instead
                // we just refuse to re-lock the Surface.
                // 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);
            mLockedObject = nativeLockCanvas(mNativeObject, mCanvas, inOutDirty);
            return mCanvas;
            return mCanvas;
@@ -279,11 +279,14 @@ public class Surface implements Parcelable {
            if (mLockedObject == 0) {
            if (mLockedObject == 0) {
                throw new IllegalStateException("Surface was not locked");
                throw new IllegalStateException("Surface was not locked");
            }
            }
            try {
                nativeUnlockCanvasAndPost(mLockedObject, canvas);
                nativeUnlockCanvasAndPost(mLockedObject, canvas);
            } finally {
                nativeRelease(mLockedObject);
                nativeRelease(mLockedObject);
                mLockedObject = 0;
                mLockedObject = 0;
            }
            }
        }
        }
    }


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