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

Commit 448c3395 authored by Eino-Ville Talvala's avatar Eino-Ville Talvala Committed by Android (Google) Code Review
Browse files

Merge "Camera2: Add user tag to CaptureRequest" into klp-dev

parents d3135451 4068388b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -10925,7 +10925,9 @@ package android.hardware.camera2 {
  public final class CaptureRequest extends android.hardware.camera2.CameraMetadata implements android.os.Parcelable {
    method public void addTarget(android.view.Surface);
    method public java.lang.Object getTag();
    method public void removeTarget(android.view.Surface);
    method public void setTag(java.lang.Object);
    field public static final android.hardware.camera2.CameraMetadata.Key BLACK_LEVEL_LOCK;
    field public static final android.hardware.camera2.CameraMetadata.Key COLOR_CORRECTION_GAINS;
    field public static final android.hardware.camera2.CameraMetadata.Key COLOR_CORRECTION_MODE;
+37 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ public final class CaptureRequest extends CameraMetadata implements Parcelable {

    private final Object mLock = new Object();
    private final HashSet<Surface> mSurfaceSet = new HashSet<Surface>();
    private Object mUserTag;

    /**
     * @hide
@@ -89,6 +90,42 @@ public final class CaptureRequest extends CameraMetadata implements Parcelable {
        }
    }

    /**
     * Set a tag for this request.
     *
     * <p>This tag is not used for anything by the camera device, but can be
     * used by an application to easily identify a CaptureRequest when it is
     * returned by
     * {@link CameraDevice.CaptureListener#onCaptureComplete CaptureListener.onCaptureComplete}
     *
     * @param tag an arbitrary Object to store with this request
     * @see #getTag
     */
    public void setTag(Object tag) {
        synchronized (mLock) {
            mUserTag = tag;
        }
    }

    /**
     * Retrieve the tag for this request, if any.
     *
     * <p>This tag is not used for anything by the camera device, but can be
     * used by an application to easily identify a CaptureRequest when it is
     * returned by
     * {@link CameraDevice.CaptureListener#onCaptureComplete CaptureListener.onCaptureComplete}
     * </p>
     *
     * @return the last tag Object set on this request, or {@code null} if
     *     no tag has been set.
     * @see #setTag
     */
    public Object getTag() {
        synchronized (mLock) {
            return mUserTag;
        }
    }

    public static final Parcelable.Creator<CaptureRequest> CREATOR =
            new Parcelable.Creator<CaptureRequest>() {
        @Override