Home | History | Annotate | Download | only in camera2
      1 /*
      2  * Copyright (C) 2013 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package android.hardware.camera2;
     18 
     19 import android.hardware.camera2.impl.CameraMetadataNative;
     20 import android.hardware.camera2.impl.PublicKey;
     21 import android.hardware.camera2.impl.SyntheticKey;
     22 import android.hardware.camera2.utils.HashCodeHelpers;
     23 import android.hardware.camera2.utils.TypeReference;
     24 import android.os.Parcel;
     25 import android.os.Parcelable;
     26 import android.view.Surface;
     27 
     28 import java.util.Collection;
     29 import java.util.Collections;
     30 import java.util.HashSet;
     31 import java.util.List;
     32 import java.util.Objects;
     33 
     34 
     35 /**
     36  * <p>An immutable package of settings and outputs needed to capture a single
     37  * image from the camera device.</p>
     38  *
     39  * <p>Contains the configuration for the capture hardware (sensor, lens, flash),
     40  * the processing pipeline, the control algorithms, and the output buffers. Also
     41  * contains the list of target Surfaces to send image data to for this
     42  * capture.</p>
     43  *
     44  * <p>CaptureRequests can be created by using a {@link Builder} instance,
     45  * obtained by calling {@link CameraDevice#createCaptureRequest}</p>
     46  *
     47  * <p>CaptureRequests are given to {@link CameraCaptureSession#capture} or
     48  * {@link CameraCaptureSession#setRepeatingRequest} to capture images from a camera.</p>
     49  *
     50  * <p>Each request can specify a different subset of target Surfaces for the
     51  * camera to send the captured data to. All the surfaces used in a request must
     52  * be part of the surface list given to the last call to
     53  * {@link CameraDevice#createCaptureSession}, when the request is submitted to the
     54  * session.</p>
     55  *
     56  * <p>For example, a request meant for repeating preview might only include the
     57  * Surface for the preview SurfaceView or SurfaceTexture, while a
     58  * high-resolution still capture would also include a Surface from a ImageReader
     59  * configured for high-resolution JPEG images.</p>
     60  *
     61  * @see CameraDevice#capture
     62  * @see CameraDevice#setRepeatingRequest
     63  * @see CameraDevice#createCaptureRequest
     64  */
     65 public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
     66         implements Parcelable {
     67 
     68     /**
     69      * A {@code Key} is used to do capture request field lookups with
     70      * {@link CaptureResult#get} or to set fields with
     71      * {@link CaptureRequest.Builder#set(Key, Object)}.
     72      *
     73      * <p>For example, to set the crop rectangle for the next capture:
     74      * <code><pre>
     75      * Rect cropRectangle = new Rect(0, 0, 640, 480);
     76      * captureRequestBuilder.set(SCALER_CROP_REGION, cropRectangle);
     77      * </pre></code>
     78      * </p>
     79      *
     80      * <p>To enumerate over all possible keys for {@link CaptureResult}, see
     81      * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p>
     82      *
     83      * @see CaptureResult#get
     84      * @see CameraCharacteristics#getAvailableCaptureResultKeys
     85      */
     86     public final static class Key<T> {
     87         private final CameraMetadataNative.Key<T> mKey;
     88 
     89         /**
     90          * Visible for testing and vendor extensions only.
     91          *
     92          * @hide
     93          */
     94         public Key(String name, Class<T> type) {
     95             mKey = new CameraMetadataNative.Key<T>(name, type);
     96         }
     97 
     98         /**
     99          * Visible for testing and vendor extensions only.
    100          *
    101          * @hide
    102          */
    103         public Key(String name, TypeReference<T> typeReference) {
    104             mKey = new CameraMetadataNative.Key<T>(name, typeReference);
    105         }
    106 
    107         /**
    108          * Return a camelCase, period separated name formatted like:
    109          * {@code "root.section[.subsections].name"}.
    110          *
    111          * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
    112          * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
    113          *
    114          * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
    115          * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
    116          * specific key might look like {@code "com.google.nexus.data.private"}.</p>
    117          *
    118          * @return String representation of the key name
    119          */
    120         public String getName() {
    121             return mKey.getName();
    122         }
    123 
    124         /**
    125          * {@inheritDoc}
    126          */
    127         @Override
    128         public final int hashCode() {
    129             return mKey.hashCode();
    130         }
    131 
    132         /**
    133          * {@inheritDoc}
    134          */
    135         @SuppressWarnings("unchecked")
    136         @Override
    137         public final boolean equals(Object o) {
    138             return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
    139         }
    140 
    141         /**
    142          * Visible for CameraMetadataNative implementation only; do not use.
    143          *
    144          * TODO: Make this private or remove it altogether.
    145          *
    146          * @hide
    147          */
    148         public CameraMetadataNative.Key<T> getNativeKey() {
    149             return mKey;
    150         }
    151 
    152         @SuppressWarnings({ "unchecked" })
    153         /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) {
    154             mKey = (CameraMetadataNative.Key<T>) nativeKey;
    155         }
    156     }
    157 
    158     private final HashSet<Surface> mSurfaceSet;
    159     private final CameraMetadataNative mSettings;
    160 
    161     private Object mUserTag;
    162 
    163     /**
    164      * Construct empty request.
    165      *
    166      * Used by Binder to unparcel this object only.
    167      */
    168     private CaptureRequest() {
    169         mSettings = new CameraMetadataNative();
    170         mSurfaceSet = new HashSet<Surface>();
    171     }
    172 
    173     /**
    174      * Clone from source capture request.
    175      *
    176      * Used by the Builder to create an immutable copy.
    177      */
    178     @SuppressWarnings("unchecked")
    179     private CaptureRequest(CaptureRequest source) {
    180         mSettings = new CameraMetadataNative(source.mSettings);
    181         mSurfaceSet = (HashSet<Surface>) source.mSurfaceSet.clone();
    182         mUserTag = source.mUserTag;
    183     }
    184 
    185     /**
    186      * Take ownership of passed-in settings.
    187      *
    188      * Used by the Builder to create a mutable CaptureRequest.
    189      */
    190     private CaptureRequest(CameraMetadataNative settings) {
    191         mSettings = CameraMetadataNative.move(settings);
    192         mSurfaceSet = new HashSet<Surface>();
    193     }
    194 
    195     /**
    196      * Get a capture request field value.
    197      *
    198      * <p>The field definitions can be found in {@link CaptureRequest}.</p>
    199      *
    200      * <p>Querying the value for the same key more than once will return a value
    201      * which is equal to the previous queried value.</p>
    202      *
    203      * @throws IllegalArgumentException if the key was not valid
    204      *
    205      * @param key The result field to read.
    206      * @return The value of that key, or {@code null} if the field is not set.
    207      */
    208     public <T> T get(Key<T> key) {
    209         return mSettings.get(key);
    210     }
    211 
    212     /**
    213      * {@inheritDoc}
    214      * @hide
    215      */
    216     @SuppressWarnings("unchecked")
    217     @Override
    218     protected <T> T getProtected(Key<?> key) {
    219         return (T) mSettings.get(key);
    220     }
    221 
    222     /**
    223      * {@inheritDoc}
    224      * @hide
    225      */
    226     @SuppressWarnings("unchecked")
    227     @Override
    228     protected Class<Key<?>> getKeyClass() {
    229         Object thisClass = Key.class;
    230         return (Class<Key<?>>)thisClass;
    231     }
    232 
    233     /**
    234      * {@inheritDoc}
    235      */
    236     @Override
    237     public List<Key<?>> getKeys() {
    238         // Force the javadoc for this function to show up on the CaptureRequest page
    239         return super.getKeys();
    240     }
    241 
    242     /**
    243      * Retrieve the tag for this request, if any.
    244      *
    245      * <p>This tag is not used for anything by the camera device, but can be
    246      * used by an application to easily identify a CaptureRequest when it is
    247      * returned by
    248      * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted CaptureCallback.onCaptureCompleted}
    249      * </p>
    250      *
    251      * @return the last tag Object set on this request, or {@code null} if
    252      *     no tag has been set.
    253      * @see Builder#setTag
    254      */
    255     public Object getTag() {
    256         return mUserTag;
    257     }
    258 
    259     /**
    260      * Determine whether this CaptureRequest is equal to another CaptureRequest.
    261      *
    262      * <p>A request is considered equal to another is if it's set of key/values is equal, it's
    263      * list of output surfaces is equal, and the user tag is equal.</p>
    264      *
    265      * @param other Another instance of CaptureRequest.
    266      *
    267      * @return True if the requests are the same, false otherwise.
    268      */
    269     @Override
    270     public boolean equals(Object other) {
    271         return other instanceof CaptureRequest
    272                 && equals((CaptureRequest)other);
    273     }
    274 
    275     private boolean equals(CaptureRequest other) {
    276         return other != null
    277                 && Objects.equals(mUserTag, other.mUserTag)
    278                 && mSurfaceSet.equals(other.mSurfaceSet)
    279                 && mSettings.equals(other.mSettings);
    280     }
    281 
    282     @Override
    283     public int hashCode() {
    284         return HashCodeHelpers.hashCode(mSettings, mSurfaceSet, mUserTag);
    285     }
    286 
    287     public static final Parcelable.Creator<CaptureRequest> CREATOR =
    288             new Parcelable.Creator<CaptureRequest>() {
    289         @Override
    290         public CaptureRequest createFromParcel(Parcel in) {
    291             CaptureRequest request = new CaptureRequest();
    292             request.readFromParcel(in);
    293 
    294             return request;
    295         }
    296 
    297         @Override
    298         public CaptureRequest[] newArray(int size) {
    299             return new CaptureRequest[size];
    300         }
    301     };
    302 
    303     /**
    304      * Expand this object from a Parcel.
    305      * Hidden since this breaks the immutability of CaptureRequest, but is
    306      * needed to receive CaptureRequests with aidl.
    307      *
    308      * @param in The parcel from which the object should be read
    309      * @hide
    310      */
    311     private void readFromParcel(Parcel in) {
    312         mSettings.readFromParcel(in);
    313 
    314         mSurfaceSet.clear();
    315 
    316         Parcelable[] parcelableArray = in.readParcelableArray(Surface.class.getClassLoader());
    317 
    318         if (parcelableArray == null) {
    319             return;
    320         }
    321 
    322         for (Parcelable p : parcelableArray) {
    323             Surface s = (Surface) p;
    324             mSurfaceSet.add(s);
    325         }
    326     }
    327 
    328     @Override
    329     public int describeContents() {
    330         return 0;
    331     }
    332 
    333     @Override
    334     public void writeToParcel(Parcel dest, int flags) {
    335         mSettings.writeToParcel(dest, flags);
    336         dest.writeParcelableArray(mSurfaceSet.toArray(new Surface[mSurfaceSet.size()]), flags);
    337     }
    338 
    339     /**
    340      * @hide
    341      */
    342     public boolean containsTarget(Surface surface) {
    343         return mSurfaceSet.contains(surface);
    344     }
    345 
    346     /**
    347      * @hide
    348      */
    349     public Collection<Surface> getTargets() {
    350         return Collections.unmodifiableCollection(mSurfaceSet);
    351     }
    352 
    353     /**
    354      * A builder for capture requests.
    355      *
    356      * <p>To obtain a builder instance, use the
    357      * {@link CameraDevice#createCaptureRequest} method, which initializes the
    358      * request fields to one of the templates defined in {@link CameraDevice}.
    359      *
    360      * @see CameraDevice#createCaptureRequest
    361      * @see CameraDevice#TEMPLATE_PREVIEW
    362      * @see CameraDevice#TEMPLATE_RECORD
    363      * @see CameraDevice#TEMPLATE_STILL_CAPTURE
    364      * @see CameraDevice#TEMPLATE_VIDEO_SNAPSHOT
    365      * @see CameraDevice#TEMPLATE_MANUAL
    366      */
    367     public final static class Builder {
    368 
    369         private final CaptureRequest mRequest;
    370 
    371         /**
    372          * Initialize the builder using the template; the request takes
    373          * ownership of the template.
    374          *
    375          * @hide
    376          */
    377         public Builder(CameraMetadataNative template) {
    378             mRequest = new CaptureRequest(template);
    379         }
    380 
    381         /**
    382          * <p>Add a surface to the list of targets for this request</p>
    383          *
    384          * <p>The Surface added must be one of the surfaces included in the most
    385          * recent call to {@link CameraDevice#createCaptureSession}, when the
    386          * request is given to the camera device.</p>
    387          *
    388          * <p>Adding a target more than once has no effect.</p>
    389          *
    390          * @param outputTarget Surface to use as an output target for this request
    391          */
    392         public void addTarget(Surface outputTarget) {
    393             mRequest.mSurfaceSet.add(outputTarget);
    394         }
    395 
    396         /**
    397          * <p>Remove a surface from the list of targets for this request.</p>
    398          *
    399          * <p>Removing a target that is not currently added has no effect.</p>
    400          *
    401          * @param outputTarget Surface to use as an output target for this request
    402          */
    403         public void removeTarget(Surface outputTarget) {
    404             mRequest.mSurfaceSet.remove(outputTarget);
    405         }
    406 
    407         /**
    408          * Set a capture request field to a value. The field definitions can be
    409          * found in {@link CaptureRequest}.
    410          *
    411          * @param key The metadata field to write.
    412          * @param value The value to set the field to, which must be of a matching
    413          * type to the key.
    414          */
    415         public <T> void set(Key<T> key, T value) {
    416             mRequest.mSettings.set(key, value);
    417         }
    418 
    419         /**
    420          * Get a capture request field value. The field definitions can be
    421          * found in {@link CaptureRequest}.
    422          *
    423          * @throws IllegalArgumentException if the key was not valid
    424          *
    425          * @param key The metadata field to read.
    426          * @return The value of that key, or {@code null} if the field is not set.
    427          */
    428         public <T> T get(Key<T> key) {
    429             return mRequest.mSettings.get(key);
    430         }
    431 
    432         /**
    433          * Set a tag for this request.
    434          *
    435          * <p>This tag is not used for anything by the camera device, but can be
    436          * used by an application to easily identify a CaptureRequest when it is
    437          * returned by
    438          * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted CaptureCallback.onCaptureCompleted}
    439          *
    440          * @param tag an arbitrary Object to store with this request
    441          * @see CaptureRequest#getTag
    442          */
    443         public void setTag(Object tag) {
    444             mRequest.mUserTag = tag;
    445         }
    446 
    447         /**
    448          * Build a request using the current target Surfaces and settings.
    449          * <p>Note that, although it is possible to create a {@code CaptureRequest} with no target
    450          * {@link Surface}s, passing such a request into {@link CameraCaptureSession#capture},
    451          * {@link CameraCaptureSession#captureBurst},
    452          * {@link CameraCaptureSession#setRepeatingBurst}, or
    453          * {@link CameraCaptureSession#setRepeatingRequest} will cause that method to throw an
    454          * {@link IllegalArgumentException}.</p>
    455          *
    456          * @return A new capture request instance, ready for submission to the
    457          * camera device.
    458          */
    459         public CaptureRequest build() {
    460             return new CaptureRequest(mRequest);
    461         }
    462 
    463 
    464         /**
    465          * @hide
    466          */
    467         public boolean isEmpty() {
    468             return mRequest.mSettings.isEmpty();
    469         }
    470 
    471     }
    472 
    473     /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
    474      * The key entries below this point are generated from metadata
    475      * definitions in /system/media/camera/docs. Do not modify by hand or
    476      * modify the comment blocks at the start or end.
    477      *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
    478 
    479     /**
    480      * <p>The mode control selects how the image data is converted from the
    481      * sensor's native color into linear sRGB color.</p>
    482      * <p>When auto-white balance (AWB) is enabled with {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, this
    483      * control is overridden by the AWB routine. When AWB is disabled, the
    484      * application controls how the color mapping is performed.</p>
    485      * <p>We define the expected processing pipeline below. For consistency
    486      * across devices, this is always the case with TRANSFORM_MATRIX.</p>
    487      * <p>When either FULL or HIGH_QUALITY is used, the camera device may
    488      * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
    489      * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the
    490      * camera device (in the results) and be roughly correct.</p>
    491      * <p>Switching to TRANSFORM_MATRIX and using the data provided from
    492      * FAST or HIGH_QUALITY will yield a picture with the same white point
    493      * as what was produced by the camera device in the earlier frame.</p>
    494      * <p>The expected processing pipeline is as follows:</p>
    495      * <p><img alt="White balance processing pipeline" src="../../../../images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p>
    496      * <p>The white balance is encoded by two values, a 4-channel white-balance
    497      * gain vector (applied in the Bayer domain), and a 3x3 color transform
    498      * matrix (applied after demosaic).</p>
    499      * <p>The 4-channel white-balance gains are defined as:</p>
    500      * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ]
    501      * </code></pre>
    502      * <p>where <code>G_even</code> is the gain for green pixels on even rows of the
    503      * output, and <code>G_odd</code> is the gain for green pixels on the odd rows.
    504      * These may be identical for a given camera device implementation; if
    505      * the camera device does not support a separate gain for even/odd green
    506      * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to
    507      * <code>G_even</code> in the output result metadata.</p>
    508      * <p>The matrices for color transforms are defined as a 9-entry vector:</p>
    509      * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ]
    510      * </code></pre>
    511      * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>,
    512      * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p>
    513      * <p>with colors as follows:</p>
    514      * <pre><code>r' = I0r + I1g + I2b
    515      * g' = I3r + I4g + I5b
    516      * b' = I6r + I7g + I8b
    517      * </code></pre>
    518      * <p>Both the input and output value ranges must match. Overflow/underflow
    519      * values are clipped to fit within the range.</p>
    520      * <p><b>Possible values:</b>
    521      * <ul>
    522      *   <li>{@link #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX TRANSFORM_MATRIX}</li>
    523      *   <li>{@link #COLOR_CORRECTION_MODE_FAST FAST}</li>
    524      *   <li>{@link #COLOR_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
    525      * </ul></p>
    526      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
    527      * <p><b>Full capability</b> -
    528      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
    529      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
    530      *
    531      * @see CaptureRequest#COLOR_CORRECTION_GAINS
    532      * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
    533      * @see CaptureRequest#CONTROL_AWB_MODE
    534      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
    535      * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX
    536      * @see #COLOR_CORRECTION_MODE_FAST
    537      * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY
    538      */
    539     @PublicKey
    540     public static final Key<Integer> COLOR_CORRECTION_MODE =
    541             new Key<Integer>("android.colorCorrection.mode", int.class);
    542 
    543     /**
    544      * <p>A color transform matrix to use to transform
    545      * from sensor RGB color space to output linear sRGB color space.</p>
    546      * <p>This matrix is either set by the camera device when the request
    547      * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
    548      * directly by the application in the request when the
    549      * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
    550      * <p>In the latter case, the camera device may round the matrix to account
    551      * for precision issues; the final rounded matrix should be reported back
    552      * in this matrix result metadata. The transform should keep the magnitude
    553      * of the output color values within <code>[0, 1.0]</code> (assuming input color
    554      * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p>
    555      * <p><b>Units</b>: Unitless scale factors</p>
    556      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
    557      * <p><b>Full capability</b> -
    558      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
    559      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
    560      *
    561      * @see CaptureRequest#COLOR_CORRECTION_MODE
    562      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
    563      */
    564     @PublicKey
    565     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM =
    566             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class);
    567 
    568     /**
    569      * <p>Gains applying to Bayer raw color channels for
    570      * white-balance.</p>
    571      * <p>These per-channel gains are either set by the camera device
    572      * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not
    573      * TRANSFORM_MATRIX, or directly by the application in the
    574      * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is
    575      * TRANSFORM_MATRIX.</p>
    576      * <p>The gains in the result metadata are the gains actually
    577      * applied by the camera device to the current frame.</p>
    578      * <p><b>Units</b>: Unitless gain factors</p>
    579      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
    580      * <p><b>Full capability</b> -
    581      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
    582      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
    583      *
    584      * @see CaptureRequest#COLOR_CORRECTION_MODE
    585      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
    586      */
    587     @PublicKey
    588     public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS =
    589             new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class);
    590 
    591     /**
    592      * <p>Mode of operation for the chromatic aberration correction algorithm.</p>
    593      * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light
    594      * can not focus on the same point after exiting from the lens. This metadata defines
    595      * the high level control of chromatic aberration correction algorithm, which aims to
    596      * minimize the chromatic artifacts that may occur along the object boundaries in an
    597      * image.</p>
    598      * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration
    599      * correction will be applied. HIGH_QUALITY mode indicates that the camera device will
    600      * use the highest-quality aberration correction algorithms, even if it slows down
    601      * capture rate. FAST means the camera device will not slow down capture rate when
    602      * applying aberration correction.</p>
    603      * <p>LEGACY devices will always be in FAST mode.</p>
    604      * <p><b>Possible values:</b>
    605      * <ul>
    606      *   <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_OFF OFF}</li>
    607      *   <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_FAST FAST}</li>
    608      *   <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
    609      * </ul></p>
    610      * <p><b>Available values for this device:</b><br>
    611      * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}</p>
    612      * <p>This key is available on all devices.</p>
    613      *
    614      * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES
    615      * @see #COLOR_CORRECTION_ABERRATION_MODE_OFF
    616      * @see #COLOR_CORRECTION_ABERRATION_MODE_FAST
    617      * @see #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY
    618      */
    619     @PublicKey
    620     public static final Key<Integer> COLOR_CORRECTION_ABERRATION_MODE =
    621             new Key<Integer>("android.colorCorrection.aberrationMode", int.class);
    622 
    623     /**
    624      * <p>The desired setting for the camera device's auto-exposure
    625      * algorithm's antibanding compensation.</p>
    626      * <p>Some kinds of lighting fixtures, such as some fluorescent
    627      * lights, flicker at the rate of the power supply frequency
    628      * (60Hz or 50Hz, depending on country). While this is
    629      * typically not noticeable to a person, it can be visible to
    630      * a camera device. If a camera sets its exposure time to the
    631      * wrong value, the flicker may become visible in the
    632      * viewfinder as flicker or in a final captured image, as a
    633      * set of variable-brightness bands across the image.</p>
    634      * <p>Therefore, the auto-exposure routines of camera devices
    635      * include antibanding routines that ensure that the chosen
    636      * exposure value will not cause such banding. The choice of
    637      * exposure time depends on the rate of flicker, which the
    638      * camera device can detect automatically, or the expected
    639      * rate can be selected by the application using this
    640      * control.</p>
    641      * <p>A given camera device may not support all of the possible
    642      * options for the antibanding mode. The
    643      * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
    644      * the available modes for a given camera device.</p>
    645      * <p>The default mode is AUTO, which is supported by all
    646      * camera devices.</p>
    647      * <p>If manual exposure control is enabled (by setting
    648      * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
    649      * then this setting has no effect, and the application must
    650      * ensure it selects exposure times that do not cause banding
    651      * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist
    652      * the application in this.</p>
    653      * <p><b>Possible values:</b>
    654      * <ul>
    655      *   <li>{@link #CONTROL_AE_ANTIBANDING_MODE_OFF OFF}</li>
    656      *   <li>{@link #CONTROL_AE_ANTIBANDING_MODE_50HZ 50HZ}</li>
    657      *   <li>{@link #CONTROL_AE_ANTIBANDING_MODE_60HZ 60HZ}</li>
    658      *   <li>{@link #CONTROL_AE_ANTIBANDING_MODE_AUTO AUTO}</li>
    659      * </ul></p>
    660      * <p><b>Available values for this device:</b><br></p>
    661      * <p>{@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes}</p>
    662      * <p>This key is available on all devices.</p>
    663      *
    664      * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES
    665      * @see CaptureRequest#CONTROL_AE_MODE
    666      * @see CaptureRequest#CONTROL_MODE
    667      * @see CaptureResult#STATISTICS_SCENE_FLICKER
    668      * @see #CONTROL_AE_ANTIBANDING_MODE_OFF
    669      * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ
    670      * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ
    671      * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO
    672      */
    673     @PublicKey
    674     public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE =
    675             new Key<Integer>("android.control.aeAntibandingMode", int.class);
    676 
    677     /**
    678      * <p>Adjustment to auto-exposure (AE) target image
    679      * brightness.</p>
    680      * <p>The adjustment is measured as a count of steps, with the
    681      * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the
    682      * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p>
    683      * <p>For example, if the exposure value (EV) step is 0.333, '6'
    684      * will mean an exposure compensation of +2 EV; -3 will mean an
    685      * exposure compensation of -1 EV. One EV represents a doubling
    686      * of image brightness. Note that this control will only be
    687      * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control
    688      * will take effect even when {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} <code>== true</code>.</p>
    689      * <p>In the event of exposure compensation value being changed, camera device
    690      * may take several frames to reach the newly requested exposure target.
    691      * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING
    692      * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will
    693      * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or
    694      * FLASH_REQUIRED (if the scene is too dark for still capture).</p>
    695      * <p><b>Units</b>: Compensation steps</p>
    696      * <p><b>Range of valid values:</b><br>
    697      * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}</p>
    698      * <p>This key is available on all devices.</p>
    699      *
    700      * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE
    701      * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
    702      * @see CaptureRequest#CONTROL_AE_LOCK
    703      * @see CaptureRequest#CONTROL_AE_MODE
    704      * @see CaptureResult#CONTROL_AE_STATE
    705      */
    706     @PublicKey
    707     public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION =
    708             new Key<Integer>("android.control.aeExposureCompensation", int.class);
    709 
    710     /**
    711      * <p>Whether auto-exposure (AE) is currently locked to its latest
    712      * calculated values.</p>
    713      * <p>When set to <code>true</code> (ON), the AE algorithm is locked to its latest parameters,
    714      * and will not change exposure settings until the lock is set to <code>false</code> (OFF).</p>
    715      * <p>Note that even when AE is locked, the flash may be fired if
    716      * the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH /
    717      * ON_ALWAYS_FLASH / ON_AUTO_FLASH_REDEYE.</p>
    718      * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock
    719      * is ON, the camera device will still adjust its exposure value.</p>
    720      * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger})
    721      * when AE is already locked, the camera device will not change the exposure time
    722      * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity})
    723      * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
    724      * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the
    725      * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.</p>
    726      * <p>Since the camera device has a pipeline of in-flight requests, the settings that
    727      * get locked do not necessarily correspond to the settings that were present in the
    728      * latest capture result received from the camera device, since additional captures
    729      * and AE updates may have occurred even before the result was sent out. If an
    730      * application is switching between automatic and manual control and wishes to eliminate
    731      * any flicker during the switch, the following procedure is recommended:</p>
    732      * <ol>
    733      * <li>Starting in auto-AE mode:</li>
    734      * <li>Lock AE</li>
    735      * <li>Wait for the first result to be output that has the AE locked</li>
    736      * <li>Copy exposure settings from that result into a request, set the request to manual AE</li>
    737      * <li>Submit the capture request, proceed to run manual AE as desired.</li>
    738      * </ol>
    739      * <p>See {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE lock related state transition details.</p>
    740      * <p>This key is available on all devices.</p>
    741      *
    742      * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
    743      * @see CaptureRequest#CONTROL_AE_MODE
    744      * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
    745      * @see CaptureResult#CONTROL_AE_STATE
    746      * @see CaptureRequest#SENSOR_EXPOSURE_TIME
    747      * @see CaptureRequest#SENSOR_SENSITIVITY
    748      */
    749     @PublicKey
    750     public static final Key<Boolean> CONTROL_AE_LOCK =
    751             new Key<Boolean>("android.control.aeLock", boolean.class);
    752 
    753     /**
    754      * <p>The desired mode for the camera device's
    755      * auto-exposure routine.</p>
    756      * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
    757      * AUTO.</p>
    758      * <p>When set to any of the ON modes, the camera device's
    759      * auto-exposure routine is enabled, overriding the
    760      * application's selected exposure time, sensor sensitivity,
    761      * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
    762      * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
    763      * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
    764      * is selected, the camera device's flash unit controls are
    765      * also overridden.</p>
    766      * <p>The FLASH modes are only available if the camera device
    767      * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
    768      * <p>If flash TORCH mode is desired, this field must be set to
    769      * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
    770      * <p>When set to any of the ON modes, the values chosen by the
    771      * camera device auto-exposure routine for the overridden
    772      * fields for a given capture will be available in its
    773      * CaptureResult.</p>
    774      * <p><b>Possible values:</b>
    775      * <ul>
    776      *   <li>{@link #CONTROL_AE_MODE_OFF OFF}</li>
    777      *   <li>{@link #CONTROL_AE_MODE_ON ON}</li>
    778      *   <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH ON_AUTO_FLASH}</li>
    779      *   <li>{@link #CONTROL_AE_MODE_ON_ALWAYS_FLASH ON_ALWAYS_FLASH}</li>
    780      *   <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE ON_AUTO_FLASH_REDEYE}</li>
    781      * </ul></p>
    782      * <p><b>Available values for this device:</b><br>
    783      * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}</p>
    784      * <p>This key is available on all devices.</p>
    785      *
    786      * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES
    787      * @see CaptureRequest#CONTROL_MODE
    788      * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
    789      * @see CaptureRequest#FLASH_MODE
    790      * @see CaptureRequest#SENSOR_EXPOSURE_TIME
    791      * @see CaptureRequest#SENSOR_FRAME_DURATION
    792      * @see CaptureRequest#SENSOR_SENSITIVITY
    793      * @see #CONTROL_AE_MODE_OFF
    794      * @see #CONTROL_AE_MODE_ON
    795      * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
    796      * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
    797      * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
    798      */
    799     @PublicKey
    800     public static final Key<Integer> CONTROL_AE_MODE =
    801             new Key<Integer>("android.control.aeMode", int.class);
    802 
    803     /**
    804      * <p>List of metering areas to use for auto-exposure adjustment.</p>
    805      * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe} is 0.
    806      * Otherwise will always be present.</p>
    807      * <p>The maximum number of regions supported by the device is determined by the value
    808      * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe}.</p>
    809      * <p>The coordinate system is based on the active pixel array,
    810      * with (0,0) being the top-left pixel in the active pixel array, and
    811      * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
    812      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
    813      * bottom-right pixel in the active pixel array.</p>
    814      * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
    815      * for every pixel in the area. This means that a large metering area
    816      * with the same weight as a smaller area will have more effect in
    817      * the metering result. Metering areas can partially overlap and the
    818      * camera device will add the weights in the overlap region.</p>
    819      * <p>The weights are relative to weights of other exposure metering regions, so if only one
    820      * region is used, all non-zero weights will have the same effect. A region with 0
    821      * weight is ignored.</p>
    822      * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
    823      * camera device.</p>
    824      * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
    825      * capture result metadata, the camera device will ignore the sections outside the crop
    826      * region and output only the intersection rectangle as the metering region in the result
    827      * metadata.  If the region is entirely outside the crop region, it will be ignored and
    828      * not reported in the result metadata.</p>
    829      * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
    830      * <p><b>Range of valid values:</b><br>
    831      * Coordinates must be between <code>[(0,0), (width, height))</code> of
    832      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
    833      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
    834      *
    835      * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE
    836      * @see CaptureRequest#SCALER_CROP_REGION
    837      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
    838      */
    839     @PublicKey
    840     public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
    841             new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
    842 
    843     /**
    844      * <p>Range over which the auto-exposure routine can
    845      * adjust the capture frame rate to maintain good
    846      * exposure.</p>
    847      * <p>Only constrains auto-exposure (AE) algorithm, not
    848      * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} and
    849      * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}.</p>
    850      * <p><b>Units</b>: Frames per second (FPS)</p>
    851      * <p><b>Range of valid values:</b><br>
    852      * Any of the entries in {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}</p>
    853      * <p>This key is available on all devices.</p>
    854      *
    855      * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES
    856      * @see CaptureRequest#SENSOR_EXPOSURE_TIME
    857      * @see CaptureRequest#SENSOR_FRAME_DURATION
    858      */
    859     @PublicKey
    860     public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE =
    861             new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }});
    862 
    863     /**
    864      * <p>Whether the camera device will trigger a precapture
    865      * metering sequence when it processes this request.</p>
    866      * <p>This entry is normally set to IDLE, or is not
    867      * included at all in the request settings. When included and
    868      * set to START, the camera device will trigger the autoexposure
    869      * precapture metering sequence.</p>
    870      * <p>The precapture sequence should triggered before starting a
    871      * high-quality still capture for final metering decisions to
    872      * be made, and for firing pre-capture flash pulses to estimate
    873      * scene brightness and required final capture flash power, when
    874      * the flash is enabled.</p>
    875      * <p>Normally, this entry should be set to START for only a
    876      * single request, and the application should wait until the
    877      * sequence completes before starting a new one.</p>
    878      * <p>The exact effect of auto-exposure (AE) precapture trigger
    879      * depends on the current AE mode and state; see
    880      * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition
    881      * details.</p>
    882      * <p>On LEGACY-level devices, the precapture trigger is not supported;
    883      * capturing a high-resolution JPEG image will automatically trigger a
    884      * precapture sequence before the high-resolution capture, including
    885      * potentially firing a pre-capture flash.</p>
    886      * <p><b>Possible values:</b>
    887      * <ul>
    888      *   <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE IDLE}</li>
    889      *   <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_START START}</li>
    890      * </ul></p>
    891      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
    892      * <p><b>Limited capability</b> -
    893      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
    894      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
    895      *
    896      * @see CaptureResult#CONTROL_AE_STATE
    897      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
    898      * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
    899      * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
    900      */
    901     @PublicKey
    902     public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
    903             new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
    904 
    905     /**
    906      * <p>Whether auto-focus (AF) is currently enabled, and what
    907      * mode it is set to.</p>
    908      * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus
    909      * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>).</p>
    910      * <p>If the lens is controlled by the camera device auto-focus algorithm,
    911      * the camera device will report the current AF status in {@link CaptureResult#CONTROL_AF_STATE android.control.afState}
    912      * in result metadata.</p>
    913      * <p><b>Possible values:</b>
    914      * <ul>
    915      *   <li>{@link #CONTROL_AF_MODE_OFF OFF}</li>
    916      *   <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li>
    917      *   <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li>
    918      *   <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li>
    919      *   <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li>
    920      *   <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li>
    921      * </ul></p>
    922      * <p><b>Available values for this device:</b><br>
    923      * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p>
    924      * <p>This key is available on all devices.</p>
    925      *
    926      * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES
    927      * @see CaptureResult#CONTROL_AF_STATE
    928      * @see CaptureRequest#CONTROL_MODE
    929      * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
    930      * @see #CONTROL_AF_MODE_OFF
    931      * @see #CONTROL_AF_MODE_AUTO
    932      * @see #CONTROL_AF_MODE_MACRO
    933      * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
    934      * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
    935      * @see #CONTROL_AF_MODE_EDOF
    936      */
    937     @PublicKey
    938     public static final Key<Integer> CONTROL_AF_MODE =
    939             new Key<Integer>("android.control.afMode", int.class);
    940 
    941     /**
    942      * <p>List of metering areas to use for auto-focus.</p>
    943      * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0.
    944      * Otherwise will always be present.</p>
    945      * <p>The maximum number of focus areas supported by the device is determined by the value
    946      * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p>
    947      * <p>The coordinate system is based on the active pixel array,
    948      * with (0,0) being the top-left pixel in the active pixel array, and
    949      * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
    950      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
    951      * bottom-right pixel in the active pixel array.</p>
    952      * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
    953      * for every pixel in the area. This means that a large metering area
    954      * with the same weight as a smaller area will have more effect in
    955      * the metering result. Metering areas can partially overlap and the
    956      * camera device will add the weights in the overlap region.</p>
    957      * <p>The weights are relative to weights of other metering regions, so if only one region
    958      * is used, all non-zero weights will have the same effect. A region with 0 weight is
    959      * ignored.</p>
    960      * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
    961      * camera device.</p>
    962      * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
    963      * capture result metadata, the camera device will ignore the sections outside the crop
    964      * region and output only the intersection rectangle as the metering region in the result
    965      * metadata. If the region is entirely outside the crop region, it will be ignored and
    966      * not reported in the result metadata.</p>
    967      * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
    968      * <p><b>Range of valid values:</b><br>
    969      * Coordinates must be between <code>[(0,0), (width, height))</code> of
    970      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
    971      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
    972      *
    973      * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF
    974      * @see CaptureRequest#SCALER_CROP_REGION
    975      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
    976      */
    977     @PublicKey
    978     public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
    979             new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
    980 
    981     /**
    982      * <p>Whether the camera device will trigger autofocus for this request.</p>
    983      * <p>This entry is normally set to IDLE, or is not
    984      * included at all in the request settings.</p>
    985      * <p>When included and set to START, the camera device will trigger the
    986      * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
    987      * <p>When set to CANCEL, the camera device will cancel any active trigger,
    988      * and return to its initial AF state.</p>
    989      * <p>Generally, applications should set this entry to START or CANCEL for only a
    990      * single capture, and then return it to IDLE (or not set at all). Specifying
    991      * START for multiple captures in a row means restarting the AF operation over
    992      * and over again.</p>
    993      * <p>See {@link CaptureResult#CONTROL_AF_STATE android.control.afState} for what the trigger means for each AF mode.</p>
    994      * <p><b>Possible values:</b>
    995      * <ul>
    996      *   <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li>
    997      *   <li>{@link #CONTROL_AF_TRIGGER_START START}</li>
    998      *   <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li>
    999      * </ul></p>
   1000      * <p>This key is available on all devices.</p>
   1001      *
   1002      * @see CaptureResult#CONTROL_AF_STATE
   1003      * @see #CONTROL_AF_TRIGGER_IDLE
   1004      * @see #CONTROL_AF_TRIGGER_START
   1005      * @see #CONTROL_AF_TRIGGER_CANCEL
   1006      */
   1007     @PublicKey
   1008     public static final Key<Integer> CONTROL_AF_TRIGGER =
   1009             new Key<Integer>("android.control.afTrigger", int.class);
   1010 
   1011     /**
   1012      * <p>Whether auto-white balance (AWB) is currently locked to its
   1013      * latest calculated values.</p>
   1014      * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters,
   1015      * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p>
   1016      * <p>Since the camera device has a pipeline of in-flight requests, the settings that
   1017      * get locked do not necessarily correspond to the settings that were present in the
   1018      * latest capture result received from the camera device, since additional captures
   1019      * and AWB updates may have occurred even before the result was sent out. If an
   1020      * application is switching between automatic and manual control and wishes to eliminate
   1021      * any flicker during the switch, the following procedure is recommended:</p>
   1022      * <ol>
   1023      * <li>Starting in auto-AWB mode:</li>
   1024      * <li>Lock AWB</li>
   1025      * <li>Wait for the first result to be output that has the AWB locked</li>
   1026      * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li>
   1027      * <li>Submit the capture request, proceed to run manual AWB as desired.</li>
   1028      * </ol>
   1029      * <p>Note that AWB lock is only meaningful when
   1030      * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes,
   1031      * AWB is already fixed to a specific setting.</p>
   1032      * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p>
   1033      * <p>This key is available on all devices.</p>
   1034      *
   1035      * @see CaptureRequest#CONTROL_AWB_MODE
   1036      */
   1037     @PublicKey
   1038     public static final Key<Boolean> CONTROL_AWB_LOCK =
   1039             new Key<Boolean>("android.control.awbLock", boolean.class);
   1040 
   1041     /**
   1042      * <p>Whether auto-white balance (AWB) is currently setting the color
   1043      * transform fields, and what its illumination target
   1044      * is.</p>
   1045      * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is AUTO.</p>
   1046      * <p>When set to the ON mode, the camera device's auto-white balance
   1047      * routine is enabled, overriding the application's selected
   1048      * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
   1049      * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
   1050      * <p>When set to the OFF mode, the camera device's auto-white balance
   1051      * routine is disabled. The application manually controls the white
   1052      * balance by {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains}
   1053      * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
   1054      * <p>When set to any other modes, the camera device's auto-white
   1055      * balance routine is disabled. The camera device uses each
   1056      * particular illumination target for white balance
   1057      * adjustment. The application's values for
   1058      * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform},
   1059      * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
   1060      * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p>
   1061      * <p><b>Possible values:</b>
   1062      * <ul>
   1063      *   <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li>
   1064      *   <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li>
   1065      *   <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li>
   1066      *   <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li>
   1067      *   <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li>
   1068      *   <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li>
   1069      *   <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li>
   1070      *   <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li>
   1071      *   <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li>
   1072      * </ul></p>
   1073      * <p><b>Available values for this device:</b><br>
   1074      * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p>
   1075      * <p>This key is available on all devices.</p>
   1076      *
   1077      * @see CaptureRequest#COLOR_CORRECTION_GAINS
   1078      * @see CaptureRequest#COLOR_CORRECTION_MODE
   1079      * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
   1080      * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES
   1081      * @see CaptureRequest#CONTROL_MODE
   1082      * @see #CONTROL_AWB_MODE_OFF
   1083      * @see #CONTROL_AWB_MODE_AUTO
   1084      * @see #CONTROL_AWB_MODE_INCANDESCENT
   1085      * @see #CONTROL_AWB_MODE_FLUORESCENT
   1086      * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
   1087      * @see #CONTROL_AWB_MODE_DAYLIGHT
   1088      * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
   1089      * @see #CONTROL_AWB_MODE_TWILIGHT
   1090      * @see #CONTROL_AWB_MODE_SHADE
   1091      */
   1092     @PublicKey
   1093     public static final Key<Integer> CONTROL_AWB_MODE =
   1094             new Key<Integer>("android.control.awbMode", int.class);
   1095 
   1096     /**
   1097      * <p>List of metering areas to use for auto-white-balance illuminant
   1098      * estimation.</p>
   1099      * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0.
   1100      * Otherwise will always be present.</p>
   1101      * <p>The maximum number of regions supported by the device is determined by the value
   1102      * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p>
   1103      * <p>The coordinate system is based on the active pixel array,
   1104      * with (0,0) being the top-left pixel in the active pixel array, and
   1105      * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
   1106      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
   1107      * bottom-right pixel in the active pixel array.</p>
   1108      * <p>The weight must range from 0 to 1000, and represents a weight
   1109      * for every pixel in the area. This means that a large metering area
   1110      * with the same weight as a smaller area will have more effect in
   1111      * the metering result. Metering areas can partially overlap and the
   1112      * camera device will add the weights in the overlap region.</p>
   1113      * <p>The weights are relative to weights of other white balance metering regions, so if
   1114      * only one region is used, all non-zero weights will have the same effect. A region with
   1115      * 0 weight is ignored.</p>
   1116      * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
   1117      * camera device.</p>
   1118      * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
   1119      * capture result metadata, the camera device will ignore the sections outside the crop
   1120      * region and output only the intersection rectangle as the metering region in the result
   1121      * metadata.  If the region is entirely outside the crop region, it will be ignored and
   1122      * not reported in the result metadata.</p>
   1123      * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
   1124      * <p><b>Range of valid values:</b><br>
   1125      * Coordinates must be between <code>[(0,0), (width, height))</code> of
   1126      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
   1127      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1128      *
   1129      * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB
   1130      * @see CaptureRequest#SCALER_CROP_REGION
   1131      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
   1132      */
   1133     @PublicKey
   1134     public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
   1135             new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
   1136 
   1137     /**
   1138      * <p>Information to the camera device 3A (auto-exposure,
   1139      * auto-focus, auto-white balance) routines about the purpose
   1140      * of this capture, to help the camera device to decide optimal 3A
   1141      * strategy.</p>
   1142      * <p>This control (except for MANUAL) is only effective if
   1143      * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF</code> and any 3A routine is active.</p>
   1144      * <p>ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
   1145      * contains ZSL. MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
   1146      * contains MANUAL_SENSOR. Other intent values are always supported.</p>
   1147      * <p><b>Possible values:</b>
   1148      * <ul>
   1149      *   <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li>
   1150      *   <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li>
   1151      *   <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li>
   1152      *   <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li>
   1153      *   <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li>
   1154      *   <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
   1155      *   <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li>
   1156      * </ul></p>
   1157      * <p>This key is available on all devices.</p>
   1158      *
   1159      * @see CaptureRequest#CONTROL_MODE
   1160      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
   1161      * @see #CONTROL_CAPTURE_INTENT_CUSTOM
   1162      * @see #CONTROL_CAPTURE_INTENT_PREVIEW
   1163      * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
   1164      * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
   1165      * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
   1166      * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
   1167      * @see #CONTROL_CAPTURE_INTENT_MANUAL
   1168      */
   1169     @PublicKey
   1170     public static final Key<Integer> CONTROL_CAPTURE_INTENT =
   1171             new Key<Integer>("android.control.captureIntent", int.class);
   1172 
   1173     /**
   1174      * <p>A special color effect to apply.</p>
   1175      * <p>When this mode is set, a color effect will be applied
   1176      * to images produced by the camera device. The interpretation
   1177      * and implementation of these color effects is left to the
   1178      * implementor of the camera device, and should not be
   1179      * depended on to be consistent (or present) across all
   1180      * devices.</p>
   1181      * <p><b>Possible values:</b>
   1182      * <ul>
   1183      *   <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li>
   1184      *   <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li>
   1185      *   <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li>
   1186      *   <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li>
   1187      *   <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li>
   1188      *   <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li>
   1189      *   <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li>
   1190      *   <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li>
   1191      *   <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li>
   1192      * </ul></p>
   1193      * <p><b>Available values for this device:</b><br>
   1194      * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p>
   1195      * <p>This key is available on all devices.</p>
   1196      *
   1197      * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS
   1198      * @see #CONTROL_EFFECT_MODE_OFF
   1199      * @see #CONTROL_EFFECT_MODE_MONO
   1200      * @see #CONTROL_EFFECT_MODE_NEGATIVE
   1201      * @see #CONTROL_EFFECT_MODE_SOLARIZE
   1202      * @see #CONTROL_EFFECT_MODE_SEPIA
   1203      * @see #CONTROL_EFFECT_MODE_POSTERIZE
   1204      * @see #CONTROL_EFFECT_MODE_WHITEBOARD
   1205      * @see #CONTROL_EFFECT_MODE_BLACKBOARD
   1206      * @see #CONTROL_EFFECT_MODE_AQUA
   1207      */
   1208     @PublicKey
   1209     public static final Key<Integer> CONTROL_EFFECT_MODE =
   1210             new Key<Integer>("android.control.effectMode", int.class);
   1211 
   1212     /**
   1213      * <p>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control
   1214      * routines.</p>
   1215      * <p>This is a top-level 3A control switch. When set to OFF, all 3A control
   1216      * by the camera device is disabled. The application must set the fields for
   1217      * capture parameters itself.</p>
   1218      * <p>When set to AUTO, the individual algorithm controls in
   1219      * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
   1220      * <p>When set to USE_SCENE_MODE, the individual controls in
   1221      * android.control.* are mostly disabled, and the camera device implements
   1222      * one of the scene mode settings (such as ACTION, SUNSET, or PARTY)
   1223      * as it wishes. The camera device scene mode 3A settings are provided by
   1224      * android.control.sceneModeOverrides.</p>
   1225      * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
   1226      * is that this frame will not be used by camera device background 3A statistics
   1227      * update, as if this frame is never captured. This mode can be used in the scenario
   1228      * where the application doesn't want a 3A manual control capture to affect
   1229      * the subsequent auto 3A capture results.</p>
   1230      * <p>LEGACY mode devices will only support AUTO and USE_SCENE_MODE modes.
   1231      * LIMITED mode devices will only support OFF and OFF_KEEP_STATE if they
   1232      * support the MANUAL_SENSOR and MANUAL_POST_PROCSESING capabilities.
   1233      * FULL mode devices will always support OFF and OFF_KEEP_STATE.</p>
   1234      * <p><b>Possible values:</b>
   1235      * <ul>
   1236      *   <li>{@link #CONTROL_MODE_OFF OFF}</li>
   1237      *   <li>{@link #CONTROL_MODE_AUTO AUTO}</li>
   1238      *   <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li>
   1239      *   <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li>
   1240      * </ul></p>
   1241      * <p>This key is available on all devices.</p>
   1242      *
   1243      * @see CaptureRequest#CONTROL_AF_MODE
   1244      * @see #CONTROL_MODE_OFF
   1245      * @see #CONTROL_MODE_AUTO
   1246      * @see #CONTROL_MODE_USE_SCENE_MODE
   1247      * @see #CONTROL_MODE_OFF_KEEP_STATE
   1248      */
   1249     @PublicKey
   1250     public static final Key<Integer> CONTROL_MODE =
   1251             new Key<Integer>("android.control.mode", int.class);
   1252 
   1253     /**
   1254      * <p>Control for which scene mode is currently active.</p>
   1255      * <p>Scene modes are custom camera modes optimized for a certain set of conditions and
   1256      * capture settings.</p>
   1257      * <p>This is the mode that that is active when
   1258      * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY,
   1259      * these modes will disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode},
   1260      * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} while in use.</p>
   1261      * <p>The interpretation and implementation of these scene modes is left
   1262      * to the implementor of the camera device. Their behavior will not be
   1263      * consistent across all devices, and any given device may only implement
   1264      * a subset of these modes.</p>
   1265      * <p><b>Possible values:</b>
   1266      * <ul>
   1267      *   <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li>
   1268      *   <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li>
   1269      *   <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li>
   1270      *   <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li>
   1271      *   <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li>
   1272      *   <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li>
   1273      *   <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li>
   1274      *   <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li>
   1275      *   <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li>
   1276      *   <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li>
   1277      *   <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li>
   1278      *   <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li>
   1279      *   <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li>
   1280      *   <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li>
   1281      *   <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li>
   1282      *   <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li>
   1283      *   <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li>
   1284      *   <li>{@link #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO HIGH_SPEED_VIDEO}</li>
   1285      * </ul></p>
   1286      * <p><b>Available values for this device:</b><br>
   1287      * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p>
   1288      * <p>This key is available on all devices.</p>
   1289      *
   1290      * @see CaptureRequest#CONTROL_AE_MODE
   1291      * @see CaptureRequest#CONTROL_AF_MODE
   1292      * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
   1293      * @see CaptureRequest#CONTROL_AWB_MODE
   1294      * @see CaptureRequest#CONTROL_MODE
   1295      * @see #CONTROL_SCENE_MODE_DISABLED
   1296      * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
   1297      * @see #CONTROL_SCENE_MODE_ACTION
   1298      * @see #CONTROL_SCENE_MODE_PORTRAIT
   1299      * @see #CONTROL_SCENE_MODE_LANDSCAPE
   1300      * @see #CONTROL_SCENE_MODE_NIGHT
   1301      * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
   1302      * @see #CONTROL_SCENE_MODE_THEATRE
   1303      * @see #CONTROL_SCENE_MODE_BEACH
   1304      * @see #CONTROL_SCENE_MODE_SNOW
   1305      * @see #CONTROL_SCENE_MODE_SUNSET
   1306      * @see #CONTROL_SCENE_MODE_STEADYPHOTO
   1307      * @see #CONTROL_SCENE_MODE_FIREWORKS
   1308      * @see #CONTROL_SCENE_MODE_SPORTS
   1309      * @see #CONTROL_SCENE_MODE_PARTY
   1310      * @see #CONTROL_SCENE_MODE_CANDLELIGHT
   1311      * @see #CONTROL_SCENE_MODE_BARCODE
   1312      * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO
   1313      */
   1314     @PublicKey
   1315     public static final Key<Integer> CONTROL_SCENE_MODE =
   1316             new Key<Integer>("android.control.sceneMode", int.class);
   1317 
   1318     /**
   1319      * <p>Whether video stabilization is
   1320      * active.</p>
   1321      * <p>Video stabilization automatically translates and scales images from
   1322      * the camera in order to stabilize motion between consecutive frames.</p>
   1323      * <p>If enabled, video stabilization can modify the
   1324      * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p>
   1325      * <p>Switching between different video stabilization modes may take several
   1326      * frames to initialize, the camera device will report the current mode
   1327      * in capture result metadata. For example, When "ON" mode is requested,
   1328      * the video stabilization modes in the first several capture results may
   1329      * still be "OFF", and it will become "ON" when the initialization is
   1330      * done.</p>
   1331      * <p>If a camera device supports both this mode and OIS
   1332      * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may
   1333      * produce undesirable interaction, so it is recommended not to enable
   1334      * both at the same time.</p>
   1335      * <p><b>Possible values:</b>
   1336      * <ul>
   1337      *   <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li>
   1338      *   <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li>
   1339      * </ul></p>
   1340      * <p>This key is available on all devices.</p>
   1341      *
   1342      * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
   1343      * @see CaptureRequest#SCALER_CROP_REGION
   1344      * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
   1345      * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
   1346      */
   1347     @PublicKey
   1348     public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
   1349             new Key<Integer>("android.control.videoStabilizationMode", int.class);
   1350 
   1351     /**
   1352      * <p>Operation mode for edge
   1353      * enhancement.</p>
   1354      * <p>Edge enhancement improves sharpness and details in the captured image. OFF means
   1355      * no enhancement will be applied by the camera device.</p>
   1356      * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
   1357      * will be applied. HIGH_QUALITY mode indicates that the
   1358      * camera device will use the highest-quality enhancement algorithms,
   1359      * even if it slows down capture rate. FAST means the camera device will
   1360      * not slow down capture rate when applying edge enhancement.</p>
   1361      * <p><b>Possible values:</b>
   1362      * <ul>
   1363      *   <li>{@link #EDGE_MODE_OFF OFF}</li>
   1364      *   <li>{@link #EDGE_MODE_FAST FAST}</li>
   1365      *   <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
   1366      * </ul></p>
   1367      * <p><b>Available values for this device:</b><br>
   1368      * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p>
   1369      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1370      * <p><b>Full capability</b> -
   1371      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
   1372      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   1373      *
   1374      * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
   1375      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   1376      * @see #EDGE_MODE_OFF
   1377      * @see #EDGE_MODE_FAST
   1378      * @see #EDGE_MODE_HIGH_QUALITY
   1379      */
   1380     @PublicKey
   1381     public static final Key<Integer> EDGE_MODE =
   1382             new Key<Integer>("android.edge.mode", int.class);
   1383 
   1384     /**
   1385      * <p>The desired mode for for the camera device's flash control.</p>
   1386      * <p>This control is only effective when flash unit is available
   1387      * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
   1388      * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
   1389      * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
   1390      * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
   1391      * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
   1392      * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
   1393      * device's auto-exposure routine's result. When used in still capture case, this
   1394      * control should be used along with auto-exposure (AE) precapture metering sequence
   1395      * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
   1396      * <p>When set to TORCH, the flash will be on continuously. This mode can be used
   1397      * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
   1398      * <p>The flash status will be reported by {@link CaptureResult#FLASH_STATE android.flash.state} in the capture result metadata.</p>
   1399      * <p><b>Possible values:</b>
   1400      * <ul>
   1401      *   <li>{@link #FLASH_MODE_OFF OFF}</li>
   1402      *   <li>{@link #FLASH_MODE_SINGLE SINGLE}</li>
   1403      *   <li>{@link #FLASH_MODE_TORCH TORCH}</li>
   1404      * </ul></p>
   1405      * <p>This key is available on all devices.</p>
   1406      *
   1407      * @see CaptureRequest#CONTROL_AE_MODE
   1408      * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
   1409      * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
   1410      * @see CaptureResult#FLASH_STATE
   1411      * @see #FLASH_MODE_OFF
   1412      * @see #FLASH_MODE_SINGLE
   1413      * @see #FLASH_MODE_TORCH
   1414      */
   1415     @PublicKey
   1416     public static final Key<Integer> FLASH_MODE =
   1417             new Key<Integer>("android.flash.mode", int.class);
   1418 
   1419     /**
   1420      * <p>Operational mode for hot pixel correction.</p>
   1421      * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
   1422      * that do not accurately measure the incoming light (i.e. pixels that
   1423      * are stuck at an arbitrary value or are oversensitive).</p>
   1424      * <p><b>Possible values:</b>
   1425      * <ul>
   1426      *   <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li>
   1427      *   <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li>
   1428      *   <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
   1429      * </ul></p>
   1430      * <p><b>Available values for this device:</b><br>
   1431      * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p>
   1432      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1433      *
   1434      * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
   1435      * @see #HOT_PIXEL_MODE_OFF
   1436      * @see #HOT_PIXEL_MODE_FAST
   1437      * @see #HOT_PIXEL_MODE_HIGH_QUALITY
   1438      */
   1439     @PublicKey
   1440     public static final Key<Integer> HOT_PIXEL_MODE =
   1441             new Key<Integer>("android.hotPixel.mode", int.class);
   1442 
   1443     /**
   1444      * <p>A location object to use when generating image GPS metadata.</p>
   1445      * <p>Setting a location object in a request will include the GPS coordinates of the location
   1446      * into any JPEG images captured based on the request. These coordinates can then be
   1447      * viewed by anyone who receives the JPEG image.</p>
   1448      * <p>This key is available on all devices.</p>
   1449      */
   1450     @PublicKey
   1451     @SyntheticKey
   1452     public static final Key<android.location.Location> JPEG_GPS_LOCATION =
   1453             new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);
   1454 
   1455     /**
   1456      * <p>GPS coordinates to include in output JPEG
   1457      * EXIF.</p>
   1458      * <p><b>Range of valid values:</b><br>
   1459      * (-180 - 180], [-90,90], [-inf, inf]</p>
   1460      * <p>This key is available on all devices.</p>
   1461      * @hide
   1462      */
   1463     public static final Key<double[]> JPEG_GPS_COORDINATES =
   1464             new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
   1465 
   1466     /**
   1467      * <p>32 characters describing GPS algorithm to
   1468      * include in EXIF.</p>
   1469      * <p><b>Units</b>: UTF-8 null-terminated string</p>
   1470      * <p>This key is available on all devices.</p>
   1471      * @hide
   1472      */
   1473     public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
   1474             new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
   1475 
   1476     /**
   1477      * <p>Time GPS fix was made to include in
   1478      * EXIF.</p>
   1479      * <p><b>Units</b>: UTC in seconds since January 1, 1970</p>
   1480      * <p>This key is available on all devices.</p>
   1481      * @hide
   1482      */
   1483     public static final Key<Long> JPEG_GPS_TIMESTAMP =
   1484             new Key<Long>("android.jpeg.gpsTimestamp", long.class);
   1485 
   1486     /**
   1487      * <p>The orientation for a JPEG image.</p>
   1488      * <p>The clockwise rotation angle in degrees, relative to the orientation
   1489      * to the camera, that the JPEG picture needs to be rotated by, to be viewed
   1490      * upright.</p>
   1491      * <p>Camera devices may either encode this value into the JPEG EXIF header, or
   1492      * rotate the image data to match this orientation.</p>
   1493      * <p>Note that this orientation is relative to the orientation of the camera sensor, given
   1494      * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p>
   1495      * <p>To translate from the device orientation given by the Android sensor APIs, the following
   1496      * sample code may be used:</p>
   1497      * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) {
   1498      *     if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0;
   1499      *     int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION);
   1500      *
   1501      *     // Round device orientation to a multiple of 90
   1502      *     deviceOrientation = (deviceOrientation + 45) / 90 * 90;
   1503      *
   1504      *     // Reverse device orientation for front-facing cameras
   1505      *     boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT;
   1506      *     if (facingFront) deviceOrientation = -deviceOrientation;
   1507      *
   1508      *     // Calculate desired JPEG orientation relative to camera orientation to make
   1509      *     // the image upright relative to the device orientation
   1510      *     int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360;
   1511      *
   1512      *     return jpegOrientation;
   1513      * }
   1514      * </code></pre>
   1515      * <p><b>Units</b>: Degrees in multiples of 90</p>
   1516      * <p><b>Range of valid values:</b><br>
   1517      * 0, 90, 180, 270</p>
   1518      * <p>This key is available on all devices.</p>
   1519      *
   1520      * @see CameraCharacteristics#SENSOR_ORIENTATION
   1521      */
   1522     @PublicKey
   1523     public static final Key<Integer> JPEG_ORIENTATION =
   1524             new Key<Integer>("android.jpeg.orientation", int.class);
   1525 
   1526     /**
   1527      * <p>Compression quality of the final JPEG
   1528      * image.</p>
   1529      * <p>85-95 is typical usage range.</p>
   1530      * <p><b>Range of valid values:</b><br>
   1531      * 1-100; larger is higher quality</p>
   1532      * <p>This key is available on all devices.</p>
   1533      */
   1534     @PublicKey
   1535     public static final Key<Byte> JPEG_QUALITY =
   1536             new Key<Byte>("android.jpeg.quality", byte.class);
   1537 
   1538     /**
   1539      * <p>Compression quality of JPEG
   1540      * thumbnail.</p>
   1541      * <p><b>Range of valid values:</b><br>
   1542      * 1-100; larger is higher quality</p>
   1543      * <p>This key is available on all devices.</p>
   1544      */
   1545     @PublicKey
   1546     public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
   1547             new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
   1548 
   1549     /**
   1550      * <p>Resolution of embedded JPEG thumbnail.</p>
   1551      * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
   1552      * but the captured JPEG will still be a valid image.</p>
   1553      * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected
   1554      * should have the same aspect ratio as the main JPEG output.</p>
   1555      * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect
   1556      * ratio, the camera device creates the thumbnail by cropping it from the primary image.
   1557      * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
   1558      * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
   1559      * generate the thumbnail image. The thumbnail image will always have a smaller Field
   1560      * Of View (FOV) than the primary image when aspect ratios differ.</p>
   1561      * <p><b>Range of valid values:</b><br>
   1562      * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p>
   1563      * <p>This key is available on all devices.</p>
   1564      *
   1565      * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES
   1566      */
   1567     @PublicKey
   1568     public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
   1569             new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
   1570 
   1571     /**
   1572      * <p>The desired lens aperture size, as a ratio of lens focal length to the
   1573      * effective aperture diameter.</p>
   1574      * <p>Setting this value is only supported on the camera devices that have a variable
   1575      * aperture lens.</p>
   1576      * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
   1577      * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
   1578      * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
   1579      * to achieve manual exposure control.</p>
   1580      * <p>The requested aperture value may take several frames to reach the
   1581      * requested value; the camera device will report the current (intermediate)
   1582      * aperture size in capture result metadata while the aperture is changing.
   1583      * While the aperture is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
   1584      * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
   1585      * the ON modes, this will be overridden by the camera device
   1586      * auto-exposure algorithm, the overridden values are then provided
   1587      * back to the user in the corresponding result.</p>
   1588      * <p><b>Units</b>: The f-number (f/N)</p>
   1589      * <p><b>Range of valid values:</b><br>
   1590      * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p>
   1591      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1592      * <p><b>Full capability</b> -
   1593      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
   1594      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   1595      *
   1596      * @see CaptureRequest#CONTROL_AE_MODE
   1597      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   1598      * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
   1599      * @see CaptureResult#LENS_STATE
   1600      * @see CaptureRequest#SENSOR_EXPOSURE_TIME
   1601      * @see CaptureRequest#SENSOR_FRAME_DURATION
   1602      * @see CaptureRequest#SENSOR_SENSITIVITY
   1603      */
   1604     @PublicKey
   1605     public static final Key<Float> LENS_APERTURE =
   1606             new Key<Float>("android.lens.aperture", float.class);
   1607 
   1608     /**
   1609      * <p>The desired setting for the lens neutral density filter(s).</p>
   1610      * <p>This control will not be supported on most camera devices.</p>
   1611      * <p>Lens filters are typically used to lower the amount of light the
   1612      * sensor is exposed to (measured in steps of EV). As used here, an EV
   1613      * step is the standard logarithmic representation, which are
   1614      * non-negative, and inversely proportional to the amount of light
   1615      * hitting the sensor.  For example, setting this to 0 would result
   1616      * in no reduction of the incoming light, and setting this to 2 would
   1617      * mean that the filter is set to reduce incoming light by two stops
   1618      * (allowing 1/4 of the prior amount of light to the sensor).</p>
   1619      * <p>It may take several frames before the lens filter density changes
   1620      * to the requested value. While the filter density is still changing,
   1621      * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
   1622      * <p><b>Units</b>: Exposure Value (EV)</p>
   1623      * <p><b>Range of valid values:</b><br>
   1624      * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p>
   1625      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1626      * <p><b>Full capability</b> -
   1627      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
   1628      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   1629      *
   1630      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   1631      * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
   1632      * @see CaptureResult#LENS_STATE
   1633      */
   1634     @PublicKey
   1635     public static final Key<Float> LENS_FILTER_DENSITY =
   1636             new Key<Float>("android.lens.filterDensity", float.class);
   1637 
   1638     /**
   1639      * <p>The desired lens focal length; used for optical zoom.</p>
   1640      * <p>This setting controls the physical focal length of the camera
   1641      * device's lens. Changing the focal length changes the field of
   1642      * view of the camera device, and is usually used for optical zoom.</p>
   1643      * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
   1644      * setting won't be applied instantaneously, and it may take several
   1645      * frames before the lens can change to the requested focal length.
   1646      * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
   1647      * be set to MOVING.</p>
   1648      * <p>Optical zoom will not be supported on most devices.</p>
   1649      * <p><b>Units</b>: Millimeters</p>
   1650      * <p><b>Range of valid values:</b><br>
   1651      * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p>
   1652      * <p>This key is available on all devices.</p>
   1653      *
   1654      * @see CaptureRequest#LENS_APERTURE
   1655      * @see CaptureRequest#LENS_FOCUS_DISTANCE
   1656      * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
   1657      * @see CaptureResult#LENS_STATE
   1658      */
   1659     @PublicKey
   1660     public static final Key<Float> LENS_FOCAL_LENGTH =
   1661             new Key<Float>("android.lens.focalLength", float.class);
   1662 
   1663     /**
   1664      * <p>Desired distance to plane of sharpest focus,
   1665      * measured from frontmost surface of the lens.</p>
   1666      * <p>This control can be used for setting manual focus, on devices that support
   1667      * the MANUAL_SENSOR capability and have a variable-focus lens (see
   1668      * {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}).</p>
   1669      * <p>A value of <code>0.0f</code> means infinity focus. The value set will be clamped to
   1670      * <code>[0.0f, {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}]</code>.</p>
   1671      * <p>Like {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, this setting won't be applied
   1672      * instantaneously, and it may take several frames before the lens
   1673      * can move to the requested focus distance. While the lens is still moving,
   1674      * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
   1675      * <p>LEGACY devices support at most setting this to <code>0.0f</code>
   1676      * for infinity focus.</p>
   1677      * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
   1678      * <p><b>Range of valid values:</b><br>
   1679      * &gt;= 0</p>
   1680      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1681      * <p><b>Full capability</b> -
   1682      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
   1683      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   1684      *
   1685      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   1686      * @see CaptureRequest#LENS_FOCAL_LENGTH
   1687      * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
   1688      * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
   1689      * @see CaptureResult#LENS_STATE
   1690      */
   1691     @PublicKey
   1692     public static final Key<Float> LENS_FOCUS_DISTANCE =
   1693             new Key<Float>("android.lens.focusDistance", float.class);
   1694 
   1695     /**
   1696      * <p>Sets whether the camera device uses optical image stabilization (OIS)
   1697      * when capturing images.</p>
   1698      * <p>OIS is used to compensate for motion blur due to small
   1699      * movements of the camera during capture. Unlike digital image
   1700      * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS
   1701      * makes use of mechanical elements to stabilize the camera
   1702      * sensor, and thus allows for longer exposure times before
   1703      * camera shake becomes apparent.</p>
   1704      * <p>Switching between different optical stabilization modes may take several
   1705      * frames to initialize, the camera device will report the current mode in
   1706      * capture result metadata. For example, When "ON" mode is requested, the
   1707      * optical stabilization modes in the first several capture results may still
   1708      * be "OFF", and it will become "ON" when the initialization is done.</p>
   1709      * <p>If a camera device supports both OIS and digital image stabilization
   1710      * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable
   1711      * interaction, so it is recommended not to enable both at the same time.</p>
   1712      * <p>Not all devices will support OIS; see
   1713      * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
   1714      * available controls.</p>
   1715      * <p><b>Possible values:</b>
   1716      * <ul>
   1717      *   <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li>
   1718      *   <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li>
   1719      * </ul></p>
   1720      * <p><b>Available values for this device:</b><br>
   1721      * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p>
   1722      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1723      * <p><b>Limited capability</b> -
   1724      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
   1725      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   1726      *
   1727      * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
   1728      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   1729      * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
   1730      * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
   1731      * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
   1732      */
   1733     @PublicKey
   1734     public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
   1735             new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
   1736 
   1737     /**
   1738      * <p>Mode of operation for the noise reduction algorithm.</p>
   1739      * <p>The noise reduction algorithm attempts to improve image quality by removing
   1740      * excessive noise added by the capture process, especially in dark conditions.
   1741      * OFF means no noise reduction will be applied by the camera device.</p>
   1742      * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
   1743      * will be applied. HIGH_QUALITY mode indicates that the camera device
   1744      * will use the highest-quality noise filtering algorithms,
   1745      * even if it slows down capture rate. FAST means the camera device will not
   1746      * slow down capture rate when applying noise filtering.</p>
   1747      * <p><b>Possible values:</b>
   1748      * <ul>
   1749      *   <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li>
   1750      *   <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li>
   1751      *   <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
   1752      * </ul></p>
   1753      * <p><b>Available values for this device:</b><br>
   1754      * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p>
   1755      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1756      * <p><b>Full capability</b> -
   1757      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
   1758      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   1759      *
   1760      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   1761      * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
   1762      * @see #NOISE_REDUCTION_MODE_OFF
   1763      * @see #NOISE_REDUCTION_MODE_FAST
   1764      * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
   1765      */
   1766     @PublicKey
   1767     public static final Key<Integer> NOISE_REDUCTION_MODE =
   1768             new Key<Integer>("android.noiseReduction.mode", int.class);
   1769 
   1770     /**
   1771      * <p>An application-specified ID for the current
   1772      * request. Must be maintained unchanged in output
   1773      * frame</p>
   1774      * <p><b>Units</b>: arbitrary integer assigned by application</p>
   1775      * <p><b>Range of valid values:</b><br>
   1776      * Any int</p>
   1777      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1778      * @hide
   1779      */
   1780     public static final Key<Integer> REQUEST_ID =
   1781             new Key<Integer>("android.request.id", int.class);
   1782 
   1783     /**
   1784      * <p>The desired region of the sensor to read out for this capture.</p>
   1785      * <p>This control can be used to implement digital zoom.</p>
   1786      * <p>The crop region coordinate system is based off
   1787      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the
   1788      * top-left corner of the sensor active array.</p>
   1789      * <p>Output streams use this rectangle to produce their output,
   1790      * cropping to a smaller region if necessary to maintain the
   1791      * stream's aspect ratio, then scaling the sensor input to
   1792      * match the output's configured resolution.</p>
   1793      * <p>The crop region is applied after the RAW to other color
   1794      * space (e.g. YUV) conversion. Since raw streams
   1795      * (e.g. RAW16) don't have the conversion stage, they are not
   1796      * croppable. The crop region will be ignored by raw streams.</p>
   1797      * <p>For non-raw streams, any additional per-stream cropping will
   1798      * be done to maximize the final pixel area of the stream.</p>
   1799      * <p>For example, if the crop region is set to a 4:3 aspect
   1800      * ratio, then 4:3 streams will use the exact crop
   1801      * region. 16:9 streams will further crop vertically
   1802      * (letterbox).</p>
   1803      * <p>Conversely, if the crop region is set to a 16:9, then 4:3
   1804      * outputs will crop horizontally (pillarbox), and 16:9
   1805      * streams will match exactly. These additional crops will
   1806      * be centered within the crop region.</p>
   1807      * <p>The width and height of the crop region cannot
   1808      * be set to be smaller than
   1809      * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and
   1810      * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p>
   1811      * <p>The camera device may adjust the crop region to account
   1812      * for rounding and other hardware requirements; the final
   1813      * crop region used will be included in the output capture
   1814      * result.</p>
   1815      * <p><b>Units</b>: Pixel coordinates relative to
   1816      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
   1817      * <p>This key is available on all devices.</p>
   1818      *
   1819      * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
   1820      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
   1821      */
   1822     @PublicKey
   1823     public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
   1824             new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
   1825 
   1826     /**
   1827      * <p>Duration each pixel is exposed to
   1828      * light.</p>
   1829      * <p>If the sensor can't expose this exact duration, it will shorten the
   1830      * duration exposed to the nearest possible value (rather than expose longer).
   1831      * The final exposure time used will be available in the output capture result.</p>
   1832      * <p>This control is only effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} is set to
   1833      * OFF; otherwise the auto-exposure algorithm will override this value.</p>
   1834      * <p><b>Units</b>: Nanoseconds</p>
   1835      * <p><b>Range of valid values:</b><br>
   1836      * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p>
   1837      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1838      * <p><b>Full capability</b> -
   1839      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
   1840      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   1841      *
   1842      * @see CaptureRequest#CONTROL_AE_MODE
   1843      * @see CaptureRequest#CONTROL_MODE
   1844      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   1845      * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE
   1846      */
   1847     @PublicKey
   1848     public static final Key<Long> SENSOR_EXPOSURE_TIME =
   1849             new Key<Long>("android.sensor.exposureTime", long.class);
   1850 
   1851     /**
   1852      * <p>Duration from start of frame exposure to
   1853      * start of next frame exposure.</p>
   1854      * <p>The maximum frame rate that can be supported by a camera subsystem is
   1855      * a function of many factors:</p>
   1856      * <ul>
   1857      * <li>Requested resolutions of output image streams</li>
   1858      * <li>Availability of binning / skipping modes on the imager</li>
   1859      * <li>The bandwidth of the imager interface</li>
   1860      * <li>The bandwidth of the various ISP processing blocks</li>
   1861      * </ul>
   1862      * <p>Since these factors can vary greatly between different ISPs and
   1863      * sensors, the camera abstraction tries to represent the bandwidth
   1864      * restrictions with as simple a model as possible.</p>
   1865      * <p>The model presented has the following characteristics:</p>
   1866      * <ul>
   1867      * <li>The image sensor is always configured to output the smallest
   1868      * resolution possible given the application's requested output stream
   1869      * sizes.  The smallest resolution is defined as being at least as large
   1870      * as the largest requested output stream size; the camera pipeline must
   1871      * never digitally upsample sensor data when the crop region covers the
   1872      * whole sensor. In general, this means that if only small output stream
   1873      * resolutions are configured, the sensor can provide a higher frame
   1874      * rate.</li>
   1875      * <li>Since any request may use any or all the currently configured
   1876      * output streams, the sensor and ISP must be configured to support
   1877      * scaling a single capture to all the streams at the same time.  This
   1878      * means the camera pipeline must be ready to produce the largest
   1879      * requested output size without any delay.  Therefore, the overall
   1880      * frame rate of a given configured stream set is governed only by the
   1881      * largest requested stream resolution.</li>
   1882      * <li>Using more than one output stream in a request does not affect the
   1883      * frame duration.</li>
   1884      * <li>Certain format-streams may need to do additional background processing
   1885      * before data is consumed/produced by that stream. These processors
   1886      * can run concurrently to the rest of the camera pipeline, but
   1887      * cannot process more than 1 capture at a time.</li>
   1888      * </ul>
   1889      * <p>The necessary information for the application, given the model above,
   1890      * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field
   1891      * using StreamConfigurationMap#getOutputMinFrameDuration(int, Size).
   1892      * These are used to determine the maximum frame rate / minimum frame
   1893      * duration that is possible for a given stream configuration.</p>
   1894      * <p>Specifically, the application can use the following rules to
   1895      * determine the minimum frame duration it can request from the camera
   1896      * device:</p>
   1897      * <ol>
   1898      * <li>Let the set of currently configured input/output streams
   1899      * be called <code>S</code>.</li>
   1900      * <li>Find the minimum frame durations for each stream in <code>S</code>, by
   1901      * looking it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using
   1902      * StreamConfigurationMap#getOutputMinFrameDuration(int, Size) (with
   1903      * its respective size/format). Let this set of frame durations be called
   1904      * <code>F</code>.</li>
   1905      * <li>For any given request <code>R</code>, the minimum frame duration allowed
   1906      * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams
   1907      * used in <code>R</code> be called <code>S_r</code>.</li>
   1908      * </ol>
   1909      * <p>If none of the streams in <code>S_r</code> have a stall time (listed in
   1910      * StreamConfigurationMap#getOutputStallDuration(int,Size) using its
   1911      * respective size/format), then the frame duration in
   1912      * <code>F</code> determines the steady state frame rate that the application will
   1913      * get if it uses <code>R</code> as a repeating request. Let this special kind
   1914      * of request be called <code>Rsimple</code>.</p>
   1915      * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved
   1916      * by a single capture of a new request <code>Rstall</code> (which has at least
   1917      * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the
   1918      * same minimum frame duration this will not cause a frame rate loss
   1919      * if all buffers from the previous <code>Rstall</code> have already been
   1920      * delivered.</p>
   1921      * <p>For more details about stalling, see
   1922      * StreamConfigurationMap#getOutputStallDuration(int,Size).</p>
   1923      * <p>This control is only effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} is set to
   1924      * OFF; otherwise the auto-exposure algorithm will override this value.</p>
   1925      * <p><b>Units</b>: Nanoseconds</p>
   1926      * <p><b>Range of valid values:</b><br>
   1927      * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration},
   1928      * {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}. The duration
   1929      * is capped to <code>max(duration, exposureTime + overhead)</code>.</p>
   1930      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1931      * <p><b>Full capability</b> -
   1932      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
   1933      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   1934      *
   1935      * @see CaptureRequest#CONTROL_AE_MODE
   1936      * @see CaptureRequest#CONTROL_MODE
   1937      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   1938      * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
   1939      * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION
   1940      */
   1941     @PublicKey
   1942     public static final Key<Long> SENSOR_FRAME_DURATION =
   1943             new Key<Long>("android.sensor.frameDuration", long.class);
   1944 
   1945     /**
   1946      * <p>The amount of gain applied to sensor data
   1947      * before processing.</p>
   1948      * <p>The sensitivity is the standard ISO sensitivity value,
   1949      * as defined in ISO 12232:2006.</p>
   1950      * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and
   1951      * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device
   1952      * is guaranteed to use only analog amplification for applying the gain.</p>
   1953      * <p>If the camera device cannot apply the exact sensitivity
   1954      * requested, it will reduce the gain to the nearest supported
   1955      * value. The final sensitivity used will be available in the
   1956      * output capture result.</p>
   1957      * <p><b>Units</b>: ISO arithmetic units</p>
   1958      * <p><b>Range of valid values:</b><br>
   1959      * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p>
   1960      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1961      * <p><b>Full capability</b> -
   1962      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
   1963      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   1964      *
   1965      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   1966      * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
   1967      * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY
   1968      */
   1969     @PublicKey
   1970     public static final Key<Integer> SENSOR_SENSITIVITY =
   1971             new Key<Integer>("android.sensor.sensitivity", int.class);
   1972 
   1973     /**
   1974      * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
   1975      * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
   1976      * <p>Each color channel is treated as an unsigned 32-bit integer.
   1977      * The camera device then uses the most significant X bits
   1978      * that correspond to how many bits are in its Bayer raw sensor
   1979      * output.</p>
   1980      * <p>For example, a sensor with RAW10 Bayer output would use the
   1981      * 10 most significant bits from each color channel.</p>
   1982      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1983      *
   1984      * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
   1985      */
   1986     @PublicKey
   1987     public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
   1988             new Key<int[]>("android.sensor.testPatternData", int[].class);
   1989 
   1990     /**
   1991      * <p>When enabled, the sensor sends a test pattern instead of
   1992      * doing a real exposure from the camera.</p>
   1993      * <p>When a test pattern is enabled, all manual sensor controls specified
   1994      * by android.sensor.* will be ignored. All other controls should
   1995      * work as normal.</p>
   1996      * <p>For example, if manual flash is enabled, flash firing should still
   1997      * occur (and that the test pattern remain unmodified, since the flash
   1998      * would not actually affect it).</p>
   1999      * <p>Defaults to OFF.</p>
   2000      * <p><b>Possible values:</b>
   2001      * <ul>
   2002      *   <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li>
   2003      *   <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li>
   2004      *   <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li>
   2005      *   <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li>
   2006      *   <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li>
   2007      *   <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li>
   2008      * </ul></p>
   2009      * <p><b>Available values for this device:</b><br>
   2010      * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p>
   2011      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2012      *
   2013      * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES
   2014      * @see #SENSOR_TEST_PATTERN_MODE_OFF
   2015      * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
   2016      * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
   2017      * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
   2018      * @see #SENSOR_TEST_PATTERN_MODE_PN9
   2019      * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
   2020      */
   2021     @PublicKey
   2022     public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
   2023             new Key<Integer>("android.sensor.testPatternMode", int.class);
   2024 
   2025     /**
   2026      * <p>Quality of lens shading correction applied
   2027      * to the image data.</p>
   2028      * <p>When set to OFF mode, no lens shading correction will be applied by the
   2029      * camera device, and an identity lens shading map data will be provided
   2030      * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens
   2031      * shading map with size of <code>[ 4, 3 ]</code>,
   2032      * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity
   2033      * map shown below:</p>
   2034      * <pre><code>[ 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
   2035      *  1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
   2036      *  1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
   2037      *  1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
   2038      *  1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
   2039      *  1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0 ]
   2040      * </code></pre>
   2041      * <p>When set to other modes, lens shading correction will be applied by the camera
   2042      * device. Applications can request lens shading map data by setting
   2043      * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens
   2044      * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map
   2045      * data will be the one applied by the camera device for this capture request.</p>
   2046      * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore
   2047      * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and
   2048      * AWB are in AUTO modes({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF and {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} <code>!=</code>
   2049      * OFF), to get best results, it is recommended that the applications wait for the AE and AWB
   2050      * to be converged before using the returned shading map data.</p>
   2051      * <p><b>Possible values:</b>
   2052      * <ul>
   2053      *   <li>{@link #SHADING_MODE_OFF OFF}</li>
   2054      *   <li>{@link #SHADING_MODE_FAST FAST}</li>
   2055      *   <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
   2056      * </ul></p>
   2057      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2058      * <p><b>Full capability</b> -
   2059      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
   2060      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   2061      *
   2062      * @see CaptureRequest#CONTROL_AE_MODE
   2063      * @see CaptureRequest#CONTROL_AWB_MODE
   2064      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   2065      * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP
   2066      * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
   2067      * @see #SHADING_MODE_OFF
   2068      * @see #SHADING_MODE_FAST
   2069      * @see #SHADING_MODE_HIGH_QUALITY
   2070      */
   2071     @PublicKey
   2072     public static final Key<Integer> SHADING_MODE =
   2073             new Key<Integer>("android.shading.mode", int.class);
   2074 
   2075     /**
   2076      * <p>Operating mode for the face detector
   2077      * unit.</p>
   2078      * <p>Whether face detection is enabled, and whether it
   2079      * should output just the basic fields or the full set of
   2080      * fields.</p>
   2081      * <p><b>Possible values:</b>
   2082      * <ul>
   2083      *   <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li>
   2084      *   <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li>
   2085      *   <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li>
   2086      * </ul></p>
   2087      * <p><b>Available values for this device:</b><br>
   2088      * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p>
   2089      * <p>This key is available on all devices.</p>
   2090      *
   2091      * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
   2092      * @see #STATISTICS_FACE_DETECT_MODE_OFF
   2093      * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
   2094      * @see #STATISTICS_FACE_DETECT_MODE_FULL
   2095      */
   2096     @PublicKey
   2097     public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
   2098             new Key<Integer>("android.statistics.faceDetectMode", int.class);
   2099 
   2100     /**
   2101      * <p>Operating mode for hot pixel map generation.</p>
   2102      * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.
   2103      * If set to <code>false</code>, no hot pixel map will be returned.</p>
   2104      * <p><b>Range of valid values:</b><br>
   2105      * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}</p>
   2106      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2107      *
   2108      * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
   2109      * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
   2110      */
   2111     @PublicKey
   2112     public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
   2113             new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
   2114 
   2115     /**
   2116      * <p>Whether the camera device will output the lens
   2117      * shading map in output result metadata.</p>
   2118      * <p>When set to ON,
   2119      * android.statistics.lensShadingMap will be provided in
   2120      * the output result metadata.</p>
   2121      * <p>ON is always supported on devices with the RAW capability.</p>
   2122      * <p><b>Possible values:</b>
   2123      * <ul>
   2124      *   <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li>
   2125      *   <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li>
   2126      * </ul></p>
   2127      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2128      * <p><b>Full capability</b> -
   2129      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
   2130      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   2131      *
   2132      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   2133      * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
   2134      * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
   2135      */
   2136     @PublicKey
   2137     public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
   2138             new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
   2139 
   2140     /**
   2141      * <p>Tonemapping / contrast / gamma curve for the blue
   2142      * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
   2143      * CONTRAST_CURVE.</p>
   2144      * <p>See android.tonemap.curveRed for more details.</p>
   2145      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2146      * <p><b>Full capability</b> -
   2147      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
   2148      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   2149      *
   2150      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   2151      * @see CaptureRequest#TONEMAP_MODE
   2152      * @hide
   2153      */
   2154     public static final Key<float[]> TONEMAP_CURVE_BLUE =
   2155             new Key<float[]>("android.tonemap.curveBlue", float[].class);
   2156 
   2157     /**
   2158      * <p>Tonemapping / contrast / gamma curve for the green
   2159      * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
   2160      * CONTRAST_CURVE.</p>
   2161      * <p>See android.tonemap.curveRed for more details.</p>
   2162      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2163      * <p><b>Full capability</b> -
   2164      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
   2165      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   2166      *
   2167      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   2168      * @see CaptureRequest#TONEMAP_MODE
   2169      * @hide
   2170      */
   2171     public static final Key<float[]> TONEMAP_CURVE_GREEN =
   2172             new Key<float[]>("android.tonemap.curveGreen", float[].class);
   2173 
   2174     /**
   2175      * <p>Tonemapping / contrast / gamma curve for the red
   2176      * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
   2177      * CONTRAST_CURVE.</p>
   2178      * <p>Each channel's curve is defined by an array of control points:</p>
   2179      * <pre><code>android.tonemap.curveRed =
   2180      *   [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
   2181      * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
   2182      * <p>These are sorted in order of increasing <code>Pin</code>; it is
   2183      * required that input values 0.0 and 1.0 are included in the list to
   2184      * define a complete mapping. For input values between control points,
   2185      * the camera device must linearly interpolate between the control
   2186      * points.</p>
   2187      * <p>Each curve can have an independent number of points, and the number
   2188      * of points can be less than max (that is, the request doesn't have to
   2189      * always provide a curve with number of points equivalent to
   2190      * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
   2191      * <p>A few examples, and their corresponding graphical mappings; these
   2192      * only specify the red channel and the precision is limited to 4
   2193      * digits, for conciseness.</p>
   2194      * <p>Linear mapping:</p>
   2195      * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
   2196      * </code></pre>
   2197      * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
   2198      * <p>Invert mapping:</p>
   2199      * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
   2200      * </code></pre>
   2201      * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
   2202      * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
   2203      * <pre><code>android.tonemap.curveRed = [
   2204      *   0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
   2205      *   0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
   2206      *   0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
   2207      *   0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
   2208      * </code></pre>
   2209      * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
   2210      * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
   2211      * <pre><code>android.tonemap.curveRed = [
   2212      *   0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
   2213      *   0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
   2214      *   0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
   2215      *   0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
   2216      * </code></pre>
   2217      * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
   2218      * <p><b>Range of valid values:</b><br>
   2219      * 0-1 on both input and output coordinates, normalized
   2220      * as a floating-point value such that 0 == black and 1 == white.</p>
   2221      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2222      * <p><b>Full capability</b> -
   2223      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
   2224      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   2225      *
   2226      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   2227      * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
   2228      * @see CaptureRequest#TONEMAP_MODE
   2229      * @hide
   2230      */
   2231     public static final Key<float[]> TONEMAP_CURVE_RED =
   2232             new Key<float[]>("android.tonemap.curveRed", float[].class);
   2233 
   2234     /**
   2235      * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
   2236      * is CONTRAST_CURVE.</p>
   2237      * <p>The tonemapCurve consist of three curves for each of red, green, and blue
   2238      * channels respectively. The following example uses the red channel as an
   2239      * example. The same logic applies to green and blue channel.
   2240      * Each channel's curve is defined by an array of control points:</p>
   2241      * <pre><code>curveRed =
   2242      *   [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
   2243      * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
   2244      * <p>These are sorted in order of increasing <code>Pin</code>; it is always
   2245      * guaranteed that input values 0.0 and 1.0 are included in the list to
   2246      * define a complete mapping. For input values between control points,
   2247      * the camera device must linearly interpolate between the control
   2248      * points.</p>
   2249      * <p>Each curve can have an independent number of points, and the number
   2250      * of points can be less than max (that is, the request doesn't have to
   2251      * always provide a curve with number of points equivalent to
   2252      * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
   2253      * <p>A few examples, and their corresponding graphical mappings; these
   2254      * only specify the red channel and the precision is limited to 4
   2255      * digits, for conciseness.</p>
   2256      * <p>Linear mapping:</p>
   2257      * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ]
   2258      * </code></pre>
   2259      * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
   2260      * <p>Invert mapping:</p>
   2261      * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ]
   2262      * </code></pre>
   2263      * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
   2264      * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
   2265      * <pre><code>curveRed = [
   2266      *   (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
   2267      *   (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
   2268      *   (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
   2269      *   (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
   2270      * </code></pre>
   2271      * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
   2272      * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
   2273      * <pre><code>curveRed = [
   2274      *   (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
   2275      *   (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
   2276      *   (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
   2277      *   (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
   2278      * </code></pre>
   2279      * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
   2280      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2281      * <p><b>Full capability</b> -
   2282      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
   2283      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   2284      *
   2285      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   2286      * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
   2287      * @see CaptureRequest#TONEMAP_MODE
   2288      */
   2289     @PublicKey
   2290     @SyntheticKey
   2291     public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE =
   2292             new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class);
   2293 
   2294     /**
   2295      * <p>High-level global contrast/gamma/tonemapping control.</p>
   2296      * <p>When switching to an application-defined contrast curve by setting
   2297      * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
   2298      * per-channel with a set of <code>(in, out)</code> points that specify the
   2299      * mapping from input high-bit-depth pixel value to the output
   2300      * low-bit-depth value.  Since the actual pixel ranges of both input
   2301      * and output may change depending on the camera pipeline, the values
   2302      * are specified by normalized floating-point numbers.</p>
   2303      * <p>More-complex color mapping operations such as 3D color look-up
   2304      * tables, selective chroma enhancement, or other non-linear color
   2305      * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
   2306      * CONTRAST_CURVE.</p>
   2307      * <p>When using either FAST or HIGH_QUALITY, the camera device will
   2308      * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.
   2309      * These values are always available, and as close as possible to the
   2310      * actually used nonlinear/nonglobal transforms.</p>
   2311      * <p>If a request is sent with CONTRAST_CURVE with the camera device's
   2312      * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
   2313      * roughly the same.</p>
   2314      * <p><b>Possible values:</b>
   2315      * <ul>
   2316      *   <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li>
   2317      *   <li>{@link #TONEMAP_MODE_FAST FAST}</li>
   2318      *   <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
   2319      * </ul></p>
   2320      * <p><b>Available values for this device:</b><br>
   2321      * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p>
   2322      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2323      * <p><b>Full capability</b> -
   2324      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
   2325      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   2326      *
   2327      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   2328      * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
   2329      * @see CaptureRequest#TONEMAP_CURVE
   2330      * @see CaptureRequest#TONEMAP_MODE
   2331      * @see #TONEMAP_MODE_CONTRAST_CURVE
   2332      * @see #TONEMAP_MODE_FAST
   2333      * @see #TONEMAP_MODE_HIGH_QUALITY
   2334      */
   2335     @PublicKey
   2336     public static final Key<Integer> TONEMAP_MODE =
   2337             new Key<Integer>("android.tonemap.mode", int.class);
   2338 
   2339     /**
   2340      * <p>This LED is nominally used to indicate to the user
   2341      * that the camera is powered on and may be streaming images back to the
   2342      * Application Processor. In certain rare circumstances, the OS may
   2343      * disable this when video is processed locally and not transmitted to
   2344      * any untrusted applications.</p>
   2345      * <p>In particular, the LED <em>must</em> always be on when the data could be
   2346      * transmitted off the device. The LED <em>should</em> always be on whenever
   2347      * data is stored locally on the device.</p>
   2348      * <p>The LED <em>may</em> be off if a trusted application is using the data that
   2349      * doesn't violate the above rules.</p>
   2350      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2351      * @hide
   2352      */
   2353     public static final Key<Boolean> LED_TRANSMIT =
   2354             new Key<Boolean>("android.led.transmit", boolean.class);
   2355 
   2356     /**
   2357      * <p>Whether black-level compensation is locked
   2358      * to its current values, or is free to vary.</p>
   2359      * <p>When set to <code>true</code> (ON), the values used for black-level
   2360      * compensation will not change until the lock is set to
   2361      * <code>false</code> (OFF).</p>
   2362      * <p>Since changes to certain capture parameters (such as
   2363      * exposure time) may require resetting of black level
   2364      * compensation, the camera device must report whether setting
   2365      * the black level lock was successful in the output result
   2366      * metadata.</p>
   2367      * <p>For example, if a sequence of requests is as follows:</p>
   2368      * <ul>
   2369      * <li>Request 1: Exposure = 10ms, Black level lock = OFF</li>
   2370      * <li>Request 2: Exposure = 10ms, Black level lock = ON</li>
   2371      * <li>Request 3: Exposure = 10ms, Black level lock = ON</li>
   2372      * <li>Request 4: Exposure = 20ms, Black level lock = ON</li>
   2373      * <li>Request 5: Exposure = 20ms, Black level lock = ON</li>
   2374      * <li>Request 6: Exposure = 20ms, Black level lock = ON</li>
   2375      * </ul>
   2376      * <p>And the exposure change in Request 4 requires the camera
   2377      * device to reset the black level offsets, then the output
   2378      * result metadata is expected to be:</p>
   2379      * <ul>
   2380      * <li>Result 1: Exposure = 10ms, Black level lock = OFF</li>
   2381      * <li>Result 2: Exposure = 10ms, Black level lock = ON</li>
   2382      * <li>Result 3: Exposure = 10ms, Black level lock = ON</li>
   2383      * <li>Result 4: Exposure = 20ms, Black level lock = OFF</li>
   2384      * <li>Result 5: Exposure = 20ms, Black level lock = ON</li>
   2385      * <li>Result 6: Exposure = 20ms, Black level lock = ON</li>
   2386      * </ul>
   2387      * <p>This indicates to the application that on frame 4, black
   2388      * levels were reset due to exposure value changes, and pixel
   2389      * values may not be consistent across captures.</p>
   2390      * <p>The camera device will maintain the lock to the extent
   2391      * possible, only overriding the lock to OFF when changes to
   2392      * other request parameters require a black level recalculation
   2393      * or reset.</p>
   2394      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2395      * <p><b>Full capability</b> -
   2396      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
   2397      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   2398      *
   2399      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   2400      */
   2401     @PublicKey
   2402     public static final Key<Boolean> BLACK_LEVEL_LOCK =
   2403             new Key<Boolean>("android.blackLevel.lock", boolean.class);
   2404 
   2405     /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
   2406      * End generated code
   2407      *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
   2408 
   2409 
   2410 
   2411 }
   2412