• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.annotation.NonNull;
20 import android.annotation.Nullable;
21 import android.hardware.camera2.impl.CameraMetadataNative;
22 import android.hardware.camera2.impl.PublicKey;
23 import android.hardware.camera2.impl.SyntheticKey;
24 import android.hardware.camera2.utils.TypeReference;
25 import android.util.Rational;
26 
27 import java.util.Collections;
28 import java.util.List;
29 
30 /**
31  * <p>The properties describing a
32  * {@link CameraDevice CameraDevice}.</p>
33  *
34  * <p>These properties are fixed for a given CameraDevice, and can be queried
35  * through the {@link CameraManager CameraManager}
36  * interface with {@link CameraManager#getCameraCharacteristics}.</p>
37  *
38  * <p>{@link CameraCharacteristics} objects are immutable.</p>
39  *
40  * @see CameraDevice
41  * @see CameraManager
42  */
43 public final class CameraCharacteristics extends CameraMetadata<CameraCharacteristics.Key<?>> {
44 
45     /**
46      * A {@code Key} is used to do camera characteristics field lookups with
47      * {@link CameraCharacteristics#get}.
48      *
49      * <p>For example, to get the stream configuration map:
50      * <code><pre>
51      * StreamConfigurationMap map = cameraCharacteristics.get(
52      *      CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
53      * </pre></code>
54      * </p>
55      *
56      * <p>To enumerate over all possible keys for {@link CameraCharacteristics}, see
57      * {@link CameraCharacteristics#getKeys()}.</p>
58      *
59      * @see CameraCharacteristics#get
60      * @see CameraCharacteristics#getKeys()
61      */
62     public static final class Key<T> {
63         private final CameraMetadataNative.Key<T> mKey;
64 
65         /**
66          * Visible for testing and vendor extensions only.
67          *
68          * @hide
69          */
Key(String name, Class<T> type)70         public Key(String name, Class<T> type) {
71             mKey = new CameraMetadataNative.Key<T>(name,  type);
72         }
73 
74         /**
75          * Visible for testing and vendor extensions only.
76          *
77          * @hide
78          */
Key(String name, TypeReference<T> typeReference)79         public Key(String name, TypeReference<T> typeReference) {
80             mKey = new CameraMetadataNative.Key<T>(name,  typeReference);
81         }
82 
83         /**
84          * Return a camelCase, period separated name formatted like:
85          * {@code "root.section[.subsections].name"}.
86          *
87          * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
88          * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
89          *
90          * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
91          * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
92          * specific key might look like {@code "com.google.nexus.data.private"}.</p>
93          *
94          * @return String representation of the key name
95          */
96         @NonNull
getName()97         public String getName() {
98             return mKey.getName();
99         }
100 
101         /**
102          * {@inheritDoc}
103          */
104         @Override
hashCode()105         public final int hashCode() {
106             return mKey.hashCode();
107         }
108 
109         /**
110          * {@inheritDoc}
111          */
112         @SuppressWarnings("unchecked")
113         @Override
equals(Object o)114         public final boolean equals(Object o) {
115             return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
116         }
117 
118         /**
119          * Return this {@link Key} as a string representation.
120          *
121          * <p>{@code "CameraCharacteristics.Key(%s)"}, where {@code %s} represents
122          * the name of this key as returned by {@link #getName}.</p>
123          *
124          * @return string representation of {@link Key}
125          */
126         @NonNull
127         @Override
toString()128         public String toString() {
129             return String.format("CameraCharacteristics.Key(%s)", mKey.getName());
130         }
131 
132         /**
133          * Visible for CameraMetadataNative implementation only; do not use.
134          *
135          * TODO: Make this private or remove it altogether.
136          *
137          * @hide
138          */
getNativeKey()139         public CameraMetadataNative.Key<T> getNativeKey() {
140             return mKey;
141         }
142 
143         @SuppressWarnings({
144                 "unused", "unchecked"
145         })
Key(CameraMetadataNative.Key<?> nativeKey)146         private Key(CameraMetadataNative.Key<?> nativeKey) {
147             mKey = (CameraMetadataNative.Key<T>) nativeKey;
148         }
149     }
150 
151     private final CameraMetadataNative mProperties;
152     private List<CameraCharacteristics.Key<?>> mKeys;
153     private List<CaptureRequest.Key<?>> mAvailableRequestKeys;
154     private List<CaptureResult.Key<?>> mAvailableResultKeys;
155 
156     /**
157      * Takes ownership of the passed-in properties object
158      * @hide
159      */
CameraCharacteristics(CameraMetadataNative properties)160     public CameraCharacteristics(CameraMetadataNative properties) {
161         mProperties = CameraMetadataNative.move(properties);
162     }
163 
164     /**
165      * Returns a copy of the underlying {@link CameraMetadataNative}.
166      * @hide
167      */
getNativeCopy()168     public CameraMetadataNative getNativeCopy() {
169         return new CameraMetadataNative(mProperties);
170     }
171 
172     /**
173      * Get a camera characteristics field value.
174      *
175      * <p>The field definitions can be
176      * found in {@link CameraCharacteristics}.</p>
177      *
178      * <p>Querying the value for the same key more than once will return a value
179      * which is equal to the previous queried value.</p>
180      *
181      * @throws IllegalArgumentException if the key was not valid
182      *
183      * @param key The characteristics field to read.
184      * @return The value of that key, or {@code null} if the field is not set.
185      */
186     @Nullable
get(Key<T> key)187     public <T> T get(Key<T> key) {
188         return mProperties.get(key);
189     }
190 
191     /**
192      * {@inheritDoc}
193      * @hide
194      */
195     @SuppressWarnings("unchecked")
196     @Override
getProtected(Key<?> key)197     protected <T> T getProtected(Key<?> key) {
198         return (T) mProperties.get(key);
199     }
200 
201     /**
202      * {@inheritDoc}
203      * @hide
204      */
205     @SuppressWarnings("unchecked")
206     @Override
getKeyClass()207     protected Class<Key<?>> getKeyClass() {
208         Object thisClass = Key.class;
209         return (Class<Key<?>>)thisClass;
210     }
211 
212     /**
213      * {@inheritDoc}
214      */
215     @NonNull
216     @Override
getKeys()217     public List<Key<?>> getKeys() {
218         // List of keys is immutable; cache the results after we calculate them
219         if (mKeys != null) {
220             return mKeys;
221         }
222 
223         int[] filterTags = get(REQUEST_AVAILABLE_CHARACTERISTICS_KEYS);
224         if (filterTags == null) {
225             throw new AssertionError("android.request.availableCharacteristicsKeys must be non-null"
226                     + " in the characteristics");
227         }
228 
229         mKeys = Collections.unmodifiableList(
230                 getKeysStatic(getClass(), getKeyClass(), this, filterTags));
231         return mKeys;
232     }
233 
234     /**
235      * Returns the list of keys supported by this {@link CameraDevice} for querying
236      * with a {@link CaptureRequest}.
237      *
238      * <p>The list returned is not modifiable, so any attempts to modify it will throw
239      * a {@code UnsupportedOperationException}.</p>
240      *
241      * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
242      *
243      * <p>Note that there is no {@code getAvailableCameraCharacteristicsKeys()} -- use
244      * {@link #getKeys()} instead.</p>
245      *
246      * @return List of keys supported by this CameraDevice for CaptureRequests.
247      */
248     @SuppressWarnings({"unchecked"})
249     @NonNull
getAvailableCaptureRequestKeys()250     public List<CaptureRequest.Key<?>> getAvailableCaptureRequestKeys() {
251         if (mAvailableRequestKeys == null) {
252             Object crKey = CaptureRequest.Key.class;
253             Class<CaptureRequest.Key<?>> crKeyTyped = (Class<CaptureRequest.Key<?>>)crKey;
254 
255             int[] filterTags = get(REQUEST_AVAILABLE_REQUEST_KEYS);
256             if (filterTags == null) {
257                 throw new AssertionError("android.request.availableRequestKeys must be non-null "
258                         + "in the characteristics");
259             }
260             mAvailableRequestKeys =
261                     getAvailableKeyList(CaptureRequest.class, crKeyTyped, filterTags);
262         }
263         return mAvailableRequestKeys;
264     }
265 
266     /**
267      * Returns the list of keys supported by this {@link CameraDevice} for querying
268      * with a {@link CaptureResult}.
269      *
270      * <p>The list returned is not modifiable, so any attempts to modify it will throw
271      * a {@code UnsupportedOperationException}.</p>
272      *
273      * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
274      *
275      * <p>Note that there is no {@code getAvailableCameraCharacteristicsKeys()} -- use
276      * {@link #getKeys()} instead.</p>
277      *
278      * @return List of keys supported by this CameraDevice for CaptureResults.
279      */
280     @SuppressWarnings({"unchecked"})
281     @NonNull
getAvailableCaptureResultKeys()282     public List<CaptureResult.Key<?>> getAvailableCaptureResultKeys() {
283         if (mAvailableResultKeys == null) {
284             Object crKey = CaptureResult.Key.class;
285             Class<CaptureResult.Key<?>> crKeyTyped = (Class<CaptureResult.Key<?>>)crKey;
286 
287             int[] filterTags = get(REQUEST_AVAILABLE_RESULT_KEYS);
288             if (filterTags == null) {
289                 throw new AssertionError("android.request.availableResultKeys must be non-null "
290                         + "in the characteristics");
291             }
292             mAvailableResultKeys = getAvailableKeyList(CaptureResult.class, crKeyTyped, filterTags);
293         }
294         return mAvailableResultKeys;
295     }
296 
297     /**
298      * Returns the list of keys supported by this {@link CameraDevice} by metadataClass.
299      *
300      * <p>The list returned is not modifiable, so any attempts to modify it will throw
301      * a {@code UnsupportedOperationException}.</p>
302      *
303      * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
304      *
305      * @param metadataClass The subclass of CameraMetadata that you want to get the keys for.
306      * @param keyClass The class of the metadata key, e.g. CaptureRequest.Key.class
307      *
308      * @return List of keys supported by this CameraDevice for metadataClass.
309      *
310      * @throws IllegalArgumentException if metadataClass is not a subclass of CameraMetadata
311      */
312     private <TKey> List<TKey>
getAvailableKeyList(Class<?> metadataClass, Class<TKey> keyClass, int[] filterTags)313     getAvailableKeyList(Class<?> metadataClass, Class<TKey> keyClass, int[] filterTags) {
314 
315         if (metadataClass.equals(CameraMetadata.class)) {
316             throw new AssertionError(
317                     "metadataClass must be a strict subclass of CameraMetadata");
318         } else if (!CameraMetadata.class.isAssignableFrom(metadataClass)) {
319             throw new AssertionError(
320                     "metadataClass must be a subclass of CameraMetadata");
321         }
322 
323         List<TKey> staticKeyList = CameraCharacteristics.<TKey>getKeysStatic(
324                 metadataClass, keyClass, /*instance*/null, filterTags);
325         return Collections.unmodifiableList(staticKeyList);
326     }
327 
328     /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
329      * The key entries below this point are generated from metadata
330      * definitions in /system/media/camera/docs. Do not modify by hand or
331      * modify the comment blocks at the start or end.
332      *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
333 
334     /**
335      * <p>List of aberration correction modes for {@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode} that are
336      * supported by this camera device.</p>
337      * <p>This key lists the valid modes for {@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode}.  If no
338      * aberration correction modes are available for a device, this list will solely include
339      * OFF mode. All camera devices will support either OFF or FAST mode.</p>
340      * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always list
341      * OFF mode. This includes all FULL level devices.</p>
342      * <p>LEGACY devices will always only support FAST mode.</p>
343      * <p><b>Range of valid values:</b><br>
344      * Any value listed in {@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode}</p>
345      * <p>This key is available on all devices.</p>
346      *
347      * @see CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE
348      */
349     @PublicKey
350     public static final Key<int[]> COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES =
351             new Key<int[]>("android.colorCorrection.availableAberrationModes", int[].class);
352 
353     /**
354      * <p>List of auto-exposure antibanding modes for {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} that are
355      * supported by this camera device.</p>
356      * <p>Not all of the auto-exposure anti-banding modes may be
357      * supported by a given camera device. This field lists the
358      * valid anti-banding modes that the application may request
359      * for this camera device with the
360      * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} control.</p>
361      * <p><b>Range of valid values:</b><br>
362      * Any value listed in {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode}</p>
363      * <p>This key is available on all devices.</p>
364      *
365      * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
366      */
367     @PublicKey
368     public static final Key<int[]> CONTROL_AE_AVAILABLE_ANTIBANDING_MODES =
369             new Key<int[]>("android.control.aeAvailableAntibandingModes", int[].class);
370 
371     /**
372      * <p>List of auto-exposure modes for {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} that are supported by this camera
373      * device.</p>
374      * <p>Not all the auto-exposure modes may be supported by a
375      * given camera device, especially if no flash unit is
376      * available. This entry lists the valid modes for
377      * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} for this camera device.</p>
378      * <p>All camera devices support ON, and all camera devices with flash
379      * units support ON_AUTO_FLASH and ON_ALWAYS_FLASH.</p>
380      * <p>FULL mode camera devices always support OFF mode,
381      * which enables application control of camera exposure time,
382      * sensitivity, and frame duration.</p>
383      * <p>LEGACY mode camera devices never support OFF mode.
384      * LIMITED mode devices support OFF if they support the MANUAL_SENSOR
385      * capability.</p>
386      * <p><b>Range of valid values:</b><br>
387      * Any value listed in {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}</p>
388      * <p>This key is available on all devices.</p>
389      *
390      * @see CaptureRequest#CONTROL_AE_MODE
391      */
392     @PublicKey
393     public static final Key<int[]> CONTROL_AE_AVAILABLE_MODES =
394             new Key<int[]>("android.control.aeAvailableModes", int[].class);
395 
396     /**
397      * <p>List of frame rate ranges for {@link CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE android.control.aeTargetFpsRange} supported by
398      * this camera device.</p>
399      * <p>For devices at the LEGACY level or above:</p>
400      * <ul>
401      * <li>
402      * <p>For constant-framerate recording, for each normal
403      * {@link android.media.CamcorderProfile CamcorderProfile}, that is, a
404      * {@link android.media.CamcorderProfile CamcorderProfile} that has
405      * {@link android.media.CamcorderProfile#quality quality} in
406      * the range [{@link android.media.CamcorderProfile#QUALITY_LOW QUALITY_LOW},
407      * {@link android.media.CamcorderProfile#QUALITY_2160P QUALITY_2160P}], if the profile is
408      * supported by the device and has
409      * {@link android.media.CamcorderProfile#videoFrameRate videoFrameRate} <code>x</code>, this list will
410      * always include (<code>x</code>,<code>x</code>).</p>
411      * </li>
412      * <li>
413      * <p>Also, a camera device must either not support any
414      * {@link android.media.CamcorderProfile CamcorderProfile},
415      * or support at least one
416      * normal {@link android.media.CamcorderProfile CamcorderProfile} that has
417      * {@link android.media.CamcorderProfile#videoFrameRate videoFrameRate} <code>x</code> &gt;= 24.</p>
418      * </li>
419      * </ul>
420      * <p>For devices at the LIMITED level or above:</p>
421      * <ul>
422      * <li>For YUV_420_888 burst capture use case, this list will always include (<code>min</code>, <code>max</code>)
423      * and (<code>max</code>, <code>max</code>) where <code>min</code> &lt;= 15 and <code>max</code> = the maximum output frame rate of the
424      * maximum YUV_420_888 output size.</li>
425      * </ul>
426      * <p><b>Units</b>: Frames per second (FPS)</p>
427      * <p>This key is available on all devices.</p>
428      *
429      * @see CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE
430      */
431     @PublicKey
432     public static final Key<android.util.Range<Integer>[]> CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES =
433             new Key<android.util.Range<Integer>[]>("android.control.aeAvailableTargetFpsRanges", new TypeReference<android.util.Range<Integer>[]>() {{ }});
434 
435     /**
436      * <p>Maximum and minimum exposure compensation values for
437      * {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation}, in counts of {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep},
438      * that are supported by this camera device.</p>
439      * <p><b>Range of valid values:</b><br></p>
440      * <p>Range [0,0] indicates that exposure compensation is not supported.</p>
441      * <p>For LIMITED and FULL devices, range must follow below requirements if exposure
442      * compensation is supported (<code>range != [0, 0]</code>):</p>
443      * <p><code>Min.exposure compensation * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} &lt;= -2 EV</code></p>
444      * <p><code>Max.exposure compensation * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} &gt;= 2 EV</code></p>
445      * <p>LEGACY devices may support a smaller range than this.</p>
446      * <p>This key is available on all devices.</p>
447      *
448      * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
449      * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
450      */
451     @PublicKey
452     public static final Key<android.util.Range<Integer>> CONTROL_AE_COMPENSATION_RANGE =
453             new Key<android.util.Range<Integer>>("android.control.aeCompensationRange", new TypeReference<android.util.Range<Integer>>() {{ }});
454 
455     /**
456      * <p>Smallest step by which the exposure compensation
457      * can be changed.</p>
458      * <p>This is the unit for {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation}. For example, if this key has
459      * a value of <code>1/2</code>, then a setting of <code>-2</code> for {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} means
460      * that the target EV offset for the auto-exposure routine is -1 EV.</p>
461      * <p>One unit of EV compensation changes the brightness of the captured image by a factor
462      * of two. +1 EV doubles the image brightness, while -1 EV halves the image brightness.</p>
463      * <p><b>Units</b>: Exposure Value (EV)</p>
464      * <p>This key is available on all devices.</p>
465      *
466      * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
467      */
468     @PublicKey
469     public static final Key<Rational> CONTROL_AE_COMPENSATION_STEP =
470             new Key<Rational>("android.control.aeCompensationStep", Rational.class);
471 
472     /**
473      * <p>List of auto-focus (AF) modes for {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} that are
474      * supported by this camera device.</p>
475      * <p>Not all the auto-focus modes may be supported by a
476      * given camera device. This entry lists the valid modes for
477      * {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} for this camera device.</p>
478      * <p>All LIMITED and FULL mode camera devices will support OFF mode, and all
479      * camera devices with adjustable focuser units
480      * (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>) will support AUTO mode.</p>
481      * <p>LEGACY devices will support OFF mode only if they support
482      * focusing to infinity (by also setting {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} to
483      * <code>0.0f</code>).</p>
484      * <p><b>Range of valid values:</b><br>
485      * Any value listed in {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}</p>
486      * <p>This key is available on all devices.</p>
487      *
488      * @see CaptureRequest#CONTROL_AF_MODE
489      * @see CaptureRequest#LENS_FOCUS_DISTANCE
490      * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
491      */
492     @PublicKey
493     public static final Key<int[]> CONTROL_AF_AVAILABLE_MODES =
494             new Key<int[]>("android.control.afAvailableModes", int[].class);
495 
496     /**
497      * <p>List of color effects for {@link CaptureRequest#CONTROL_EFFECT_MODE android.control.effectMode} that are supported by this camera
498      * device.</p>
499      * <p>This list contains the color effect modes that can be applied to
500      * images produced by the camera device.
501      * Implementations are not expected to be consistent across all devices.
502      * If no color effect modes are available for a device, this will only list
503      * OFF.</p>
504      * <p>A color effect will only be applied if
505      * {@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF.  OFF is always included in this list.</p>
506      * <p>This control has no effect on the operation of other control routines such
507      * as auto-exposure, white balance, or focus.</p>
508      * <p><b>Range of valid values:</b><br>
509      * Any value listed in {@link CaptureRequest#CONTROL_EFFECT_MODE android.control.effectMode}</p>
510      * <p>This key is available on all devices.</p>
511      *
512      * @see CaptureRequest#CONTROL_EFFECT_MODE
513      * @see CaptureRequest#CONTROL_MODE
514      */
515     @PublicKey
516     public static final Key<int[]> CONTROL_AVAILABLE_EFFECTS =
517             new Key<int[]>("android.control.availableEffects", int[].class);
518 
519     /**
520      * <p>List of scene modes for {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} that are supported by this camera
521      * device.</p>
522      * <p>This list contains scene modes that can be set for the camera device.
523      * Only scene modes that have been fully implemented for the
524      * camera device may be included here. Implementations are not expected
525      * to be consistent across all devices.</p>
526      * <p>If no scene modes are supported by the camera device, this
527      * will be set to DISABLED. Otherwise DISABLED will not be listed.</p>
528      * <p>FACE_PRIORITY is always listed if face detection is
529      * supported (i.e.<code>{@link CameraCharacteristics#STATISTICS_INFO_MAX_FACE_COUNT android.statistics.info.maxFaceCount} &gt;
530      * 0</code>).</p>
531      * <p><b>Range of valid values:</b><br>
532      * Any value listed in {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode}</p>
533      * <p>This key is available on all devices.</p>
534      *
535      * @see CaptureRequest#CONTROL_SCENE_MODE
536      * @see CameraCharacteristics#STATISTICS_INFO_MAX_FACE_COUNT
537      */
538     @PublicKey
539     public static final Key<int[]> CONTROL_AVAILABLE_SCENE_MODES =
540             new Key<int[]>("android.control.availableSceneModes", int[].class);
541 
542     /**
543      * <p>List of video stabilization modes for {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}
544      * that are supported by this camera device.</p>
545      * <p>OFF will always be listed.</p>
546      * <p><b>Range of valid values:</b><br>
547      * Any value listed in {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}</p>
548      * <p>This key is available on all devices.</p>
549      *
550      * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
551      */
552     @PublicKey
553     public static final Key<int[]> CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES =
554             new Key<int[]>("android.control.availableVideoStabilizationModes", int[].class);
555 
556     /**
557      * <p>List of auto-white-balance modes for {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} that are supported by this
558      * camera device.</p>
559      * <p>Not all the auto-white-balance modes may be supported by a
560      * given camera device. This entry lists the valid modes for
561      * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} for this camera device.</p>
562      * <p>All camera devices will support ON mode.</p>
563      * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always support OFF
564      * mode, which enables application control of white balance, by using
565      * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} and {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains}({@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} must be set to TRANSFORM_MATRIX). This includes all FULL
566      * mode camera devices.</p>
567      * <p><b>Range of valid values:</b><br>
568      * Any value listed in {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}</p>
569      * <p>This key is available on all devices.</p>
570      *
571      * @see CaptureRequest#COLOR_CORRECTION_GAINS
572      * @see CaptureRequest#COLOR_CORRECTION_MODE
573      * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
574      * @see CaptureRequest#CONTROL_AWB_MODE
575      */
576     @PublicKey
577     public static final Key<int[]> CONTROL_AWB_AVAILABLE_MODES =
578             new Key<int[]>("android.control.awbAvailableModes", int[].class);
579 
580     /**
581      * <p>List of the maximum number of regions that can be used for metering in
582      * auto-exposure (AE), auto-white balance (AWB), and auto-focus (AF);
583      * this corresponds to the the maximum number of elements in
584      * {@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}, {@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions},
585      * and {@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}.</p>
586      * <p><b>Range of valid values:</b><br></p>
587      * <p>Value must be &gt;= 0 for each element. For full-capability devices
588      * this value must be &gt;= 1 for AE and AF. The order of the elements is:
589      * <code>(AE, AWB, AF)</code>.</p>
590      * <p>This key is available on all devices.</p>
591      *
592      * @see CaptureRequest#CONTROL_AE_REGIONS
593      * @see CaptureRequest#CONTROL_AF_REGIONS
594      * @see CaptureRequest#CONTROL_AWB_REGIONS
595      * @hide
596      */
597     public static final Key<int[]> CONTROL_MAX_REGIONS =
598             new Key<int[]>("android.control.maxRegions", int[].class);
599 
600     /**
601      * <p>The maximum number of metering regions that can be used by the auto-exposure (AE)
602      * routine.</p>
603      * <p>This corresponds to the the maximum allowed number of elements in
604      * {@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}.</p>
605      * <p><b>Range of valid values:</b><br>
606      * Value will be &gt;= 0. For FULL-capability devices, this
607      * value will be &gt;= 1.</p>
608      * <p>This key is available on all devices.</p>
609      *
610      * @see CaptureRequest#CONTROL_AE_REGIONS
611      */
612     @PublicKey
613     @SyntheticKey
614     public static final Key<Integer> CONTROL_MAX_REGIONS_AE =
615             new Key<Integer>("android.control.maxRegionsAe", int.class);
616 
617     /**
618      * <p>The maximum number of metering regions that can be used by the auto-white balance (AWB)
619      * routine.</p>
620      * <p>This corresponds to the the maximum allowed number of elements in
621      * {@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions}.</p>
622      * <p><b>Range of valid values:</b><br>
623      * Value will be &gt;= 0.</p>
624      * <p>This key is available on all devices.</p>
625      *
626      * @see CaptureRequest#CONTROL_AWB_REGIONS
627      */
628     @PublicKey
629     @SyntheticKey
630     public static final Key<Integer> CONTROL_MAX_REGIONS_AWB =
631             new Key<Integer>("android.control.maxRegionsAwb", int.class);
632 
633     /**
634      * <p>The maximum number of metering regions that can be used by the auto-focus (AF) routine.</p>
635      * <p>This corresponds to the the maximum allowed number of elements in
636      * {@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}.</p>
637      * <p><b>Range of valid values:</b><br>
638      * Value will be &gt;= 0. For FULL-capability devices, this
639      * value will be &gt;= 1.</p>
640      * <p>This key is available on all devices.</p>
641      *
642      * @see CaptureRequest#CONTROL_AF_REGIONS
643      */
644     @PublicKey
645     @SyntheticKey
646     public static final Key<Integer> CONTROL_MAX_REGIONS_AF =
647             new Key<Integer>("android.control.maxRegionsAf", int.class);
648 
649     /**
650      * <p>List of available high speed video size, fps range and max batch size configurations
651      * supported by the camera device, in the format of (width, height, fps_min, fps_max, batch_size_max).</p>
652      * <p>When CONSTRAINED_HIGH_SPEED_VIDEO is supported in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities},
653      * this metadata will list the supported high speed video size, fps range and max batch size
654      * configurations. All the sizes listed in this configuration will be a subset of the sizes
655      * reported by {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes }
656      * for processed non-stalling formats.</p>
657      * <p>For the high speed video use case, the application must
658      * select the video size and fps range from this metadata to configure the recording and
659      * preview streams and setup the recording requests. For example, if the application intends
660      * to do high speed recording, it can select the maximum size reported by this metadata to
661      * configure output streams. Once the size is selected, application can filter this metadata
662      * by selected size and get the supported fps ranges, and use these fps ranges to setup the
663      * recording requests. Note that for the use case of multiple output streams, application
664      * must select one unique size from this metadata to use (e.g., preview and recording streams
665      * must have the same size). Otherwise, the high speed capture session creation will fail.</p>
666      * <p>The min and max fps will be multiple times of 30fps.</p>
667      * <p>High speed video streaming extends significant performance pressue to camera hardware,
668      * to achieve efficient high speed streaming, the camera device may have to aggregate
669      * multiple frames together and send to camera device for processing where the request
670      * controls are same for all the frames in this batch. Max batch size indicates
671      * the max possible number of frames the camera device will group together for this high
672      * speed stream configuration. This max batch size will be used to generate a high speed
673      * recording request list by
674      * {@link android.hardware.camera2.CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList }.
675      * The max batch size for each configuration will satisfy below conditions:</p>
676      * <ul>
677      * <li>Each max batch size will be a divisor of its corresponding fps_max / 30. For example,
678      * if max_fps is 300, max batch size will only be 1, 2, 5, or 10.</li>
679      * <li>The camera device may choose smaller internal batch size for each configuration, but
680      * the actual batch size will be a divisor of max batch size. For example, if the max batch
681      * size is 8, the actual batch size used by camera device will only be 1, 2, 4, or 8.</li>
682      * <li>The max batch size in each configuration entry must be no larger than 32.</li>
683      * </ul>
684      * <p>The camera device doesn't have to support batch mode to achieve high speed video recording,
685      * in such case, batch_size_max will be reported as 1 in each configuration entry.</p>
686      * <p>This fps ranges in this configuration list can only be used to create requests
687      * that are submitted to a high speed camera capture session created by
688      * {@link android.hardware.camera2.CameraDevice#createConstrainedHighSpeedCaptureSession }.
689      * The fps ranges reported in this metadata must not be used to setup capture requests for
690      * normal capture session, or it will cause request error.</p>
691      * <p><b>Range of valid values:</b><br></p>
692      * <p>For each configuration, the fps_max &gt;= 120fps.</p>
693      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
694      * <p><b>Limited capability</b> -
695      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
696      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
697      *
698      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
699      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
700      * @hide
701      */
702     public static final Key<android.hardware.camera2.params.HighSpeedVideoConfiguration[]> CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS =
703             new Key<android.hardware.camera2.params.HighSpeedVideoConfiguration[]>("android.control.availableHighSpeedVideoConfigurations", android.hardware.camera2.params.HighSpeedVideoConfiguration[].class);
704 
705     /**
706      * <p>Whether the camera device supports {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock}</p>
707      * <p>Devices with MANUAL_SENSOR capability or BURST_CAPTURE capability will always
708      * list <code>true</code>. This includes FULL devices.</p>
709      * <p>This key is available on all devices.</p>
710      *
711      * @see CaptureRequest#CONTROL_AE_LOCK
712      */
713     @PublicKey
714     public static final Key<Boolean> CONTROL_AE_LOCK_AVAILABLE =
715             new Key<Boolean>("android.control.aeLockAvailable", boolean.class);
716 
717     /**
718      * <p>Whether the camera device supports {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock}</p>
719      * <p>Devices with MANUAL_POST_PROCESSING capability or BURST_CAPTURE capability will
720      * always list <code>true</code>. This includes FULL devices.</p>
721      * <p>This key is available on all devices.</p>
722      *
723      * @see CaptureRequest#CONTROL_AWB_LOCK
724      */
725     @PublicKey
726     public static final Key<Boolean> CONTROL_AWB_LOCK_AVAILABLE =
727             new Key<Boolean>("android.control.awbLockAvailable", boolean.class);
728 
729     /**
730      * <p>List of control modes for {@link CaptureRequest#CONTROL_MODE android.control.mode} that are supported by this camera
731      * device.</p>
732      * <p>This list contains control modes that can be set for the camera device.
733      * LEGACY mode devices will always support AUTO mode. LIMITED and FULL
734      * devices will always support OFF, AUTO modes.</p>
735      * <p><b>Range of valid values:</b><br>
736      * Any value listed in {@link CaptureRequest#CONTROL_MODE android.control.mode}</p>
737      * <p>This key is available on all devices.</p>
738      *
739      * @see CaptureRequest#CONTROL_MODE
740      */
741     @PublicKey
742     public static final Key<int[]> CONTROL_AVAILABLE_MODES =
743             new Key<int[]>("android.control.availableModes", int[].class);
744 
745     /**
746      * <p>Range of boosts for {@link CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST android.control.postRawSensitivityBoost} supported
747      * by this camera device.</p>
748      * <p>Devices support post RAW sensitivity boost  will advertise
749      * {@link CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST android.control.postRawSensitivityBoost} key for controling
750      * post RAW sensitivity boost.</p>
751      * <p>This key will be <code>null</code> for devices that do not support any RAW format
752      * outputs. For devices that do support RAW format outputs, this key will always
753      * present, and if a device does not support post RAW sensitivity boost, it will
754      * list <code>(100, 100)</code> in this key.</p>
755      * <p><b>Units</b>: ISO arithmetic units, the same as {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</p>
756      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
757      *
758      * @see CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST
759      * @see CaptureRequest#SENSOR_SENSITIVITY
760      */
761     @PublicKey
762     public static final Key<android.util.Range<Integer>> CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE =
763             new Key<android.util.Range<Integer>>("android.control.postRawSensitivityBoostRange", new TypeReference<android.util.Range<Integer>>() {{ }});
764 
765     /**
766      * <p>List of edge enhancement modes for {@link CaptureRequest#EDGE_MODE android.edge.mode} that are supported by this camera
767      * device.</p>
768      * <p>Full-capability camera devices must always support OFF; camera devices that support
769      * YUV_REPROCESSING or PRIVATE_REPROCESSING will list ZERO_SHUTTER_LAG; all devices will
770      * list FAST.</p>
771      * <p><b>Range of valid values:</b><br>
772      * Any value listed in {@link CaptureRequest#EDGE_MODE android.edge.mode}</p>
773      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
774      * <p><b>Full capability</b> -
775      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
776      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
777      *
778      * @see CaptureRequest#EDGE_MODE
779      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
780      */
781     @PublicKey
782     public static final Key<int[]> EDGE_AVAILABLE_EDGE_MODES =
783             new Key<int[]>("android.edge.availableEdgeModes", int[].class);
784 
785     /**
786      * <p>Whether this camera device has a
787      * flash unit.</p>
788      * <p>Will be <code>false</code> if no flash is available.</p>
789      * <p>If there is no flash unit, none of the flash controls do
790      * anything.
791      * This key is available on all devices.</p>
792      */
793     @PublicKey
794     public static final Key<Boolean> FLASH_INFO_AVAILABLE =
795             new Key<Boolean>("android.flash.info.available", boolean.class);
796 
797     /**
798      * <p>List of hot pixel correction modes for {@link CaptureRequest#HOT_PIXEL_MODE android.hotPixel.mode} that are supported by this
799      * camera device.</p>
800      * <p>FULL mode camera devices will always support FAST.</p>
801      * <p><b>Range of valid values:</b><br>
802      * Any value listed in {@link CaptureRequest#HOT_PIXEL_MODE android.hotPixel.mode}</p>
803      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
804      *
805      * @see CaptureRequest#HOT_PIXEL_MODE
806      */
807     @PublicKey
808     public static final Key<int[]> HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES =
809             new Key<int[]>("android.hotPixel.availableHotPixelModes", int[].class);
810 
811     /**
812      * <p>List of JPEG thumbnail sizes for {@link CaptureRequest#JPEG_THUMBNAIL_SIZE android.jpeg.thumbnailSize} supported by this
813      * camera device.</p>
814      * <p>This list will include at least one non-zero resolution, plus <code>(0,0)</code> for indicating no
815      * thumbnail should be generated.</p>
816      * <p>Below condiditions will be satisfied for this size list:</p>
817      * <ul>
818      * <li>The sizes will be sorted by increasing pixel area (width x height).
819      * If several resolutions have the same area, they will be sorted by increasing width.</li>
820      * <li>The aspect ratio of the largest thumbnail size will be same as the
821      * aspect ratio of largest JPEG output size in android.scaler.availableStreamConfigurations.
822      * The largest size is defined as the size that has the largest pixel area
823      * in a given size list.</li>
824      * <li>Each output JPEG size in android.scaler.availableStreamConfigurations will have at least
825      * one corresponding size that has the same aspect ratio in availableThumbnailSizes,
826      * and vice versa.</li>
827      * <li>All non-<code>(0, 0)</code> sizes will have non-zero widths and heights.
828      * This key is available on all devices.</li>
829      * </ul>
830      *
831      * @see CaptureRequest#JPEG_THUMBNAIL_SIZE
832      */
833     @PublicKey
834     public static final Key<android.util.Size[]> JPEG_AVAILABLE_THUMBNAIL_SIZES =
835             new Key<android.util.Size[]>("android.jpeg.availableThumbnailSizes", android.util.Size[].class);
836 
837     /**
838      * <p>List of aperture size values for {@link CaptureRequest#LENS_APERTURE android.lens.aperture} that are
839      * supported by this camera device.</p>
840      * <p>If the camera device doesn't support a variable lens aperture,
841      * this list will contain only one value, which is the fixed aperture size.</p>
842      * <p>If the camera device supports a variable aperture, the aperture values
843      * in this list will be sorted in ascending order.</p>
844      * <p><b>Units</b>: The aperture f-number</p>
845      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
846      * <p><b>Full capability</b> -
847      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
848      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
849      *
850      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
851      * @see CaptureRequest#LENS_APERTURE
852      */
853     @PublicKey
854     public static final Key<float[]> LENS_INFO_AVAILABLE_APERTURES =
855             new Key<float[]>("android.lens.info.availableApertures", float[].class);
856 
857     /**
858      * <p>List of neutral density filter values for
859      * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} that are supported by this camera device.</p>
860      * <p>If a neutral density filter is not supported by this camera device,
861      * this list will contain only 0. Otherwise, this list will include every
862      * filter density supported by the camera device, in ascending order.</p>
863      * <p><b>Units</b>: Exposure value (EV)</p>
864      * <p><b>Range of valid values:</b><br></p>
865      * <p>Values are &gt;= 0</p>
866      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
867      * <p><b>Full capability</b> -
868      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
869      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
870      *
871      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
872      * @see CaptureRequest#LENS_FILTER_DENSITY
873      */
874     @PublicKey
875     public static final Key<float[]> LENS_INFO_AVAILABLE_FILTER_DENSITIES =
876             new Key<float[]>("android.lens.info.availableFilterDensities", float[].class);
877 
878     /**
879      * <p>List of focal lengths for {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength} that are supported by this camera
880      * device.</p>
881      * <p>If optical zoom is not supported, this list will only contain
882      * a single value corresponding to the fixed focal length of the
883      * device. Otherwise, this list will include every focal length supported
884      * by the camera device, in ascending order.</p>
885      * <p><b>Units</b>: Millimeters</p>
886      * <p><b>Range of valid values:</b><br></p>
887      * <p>Values are &gt; 0</p>
888      * <p>This key is available on all devices.</p>
889      *
890      * @see CaptureRequest#LENS_FOCAL_LENGTH
891      */
892     @PublicKey
893     public static final Key<float[]> LENS_INFO_AVAILABLE_FOCAL_LENGTHS =
894             new Key<float[]>("android.lens.info.availableFocalLengths", float[].class);
895 
896     /**
897      * <p>List of optical image stabilization (OIS) modes for
898      * {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode} that are supported by this camera device.</p>
899      * <p>If OIS is not supported by a given camera device, this list will
900      * contain only OFF.</p>
901      * <p><b>Range of valid values:</b><br>
902      * Any value listed in {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}</p>
903      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
904      * <p><b>Limited capability</b> -
905      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
906      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
907      *
908      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
909      * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
910      */
911     @PublicKey
912     public static final Key<int[]> LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION =
913             new Key<int[]>("android.lens.info.availableOpticalStabilization", int[].class);
914 
915     /**
916      * <p>Hyperfocal distance for this lens.</p>
917      * <p>If the lens is not fixed focus, the camera device will report this
918      * field when {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} is APPROXIMATE or CALIBRATED.</p>
919      * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
920      * <p><b>Range of valid values:</b><br>
921      * If lens is fixed focus, &gt;= 0. If lens has focuser unit, the value is
922      * within <code>(0.0f, {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}]</code></p>
923      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
924      * <p><b>Limited capability</b> -
925      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
926      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
927      *
928      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
929      * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
930      * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
931      */
932     @PublicKey
933     public static final Key<Float> LENS_INFO_HYPERFOCAL_DISTANCE =
934             new Key<Float>("android.lens.info.hyperfocalDistance", float.class);
935 
936     /**
937      * <p>Shortest distance from frontmost surface
938      * of the lens that can be brought into sharp focus.</p>
939      * <p>If the lens is fixed-focus, this will be
940      * 0.</p>
941      * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
942      * <p><b>Range of valid values:</b><br>
943      * &gt;= 0</p>
944      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
945      * <p><b>Limited capability</b> -
946      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
947      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
948      *
949      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
950      * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
951      */
952     @PublicKey
953     public static final Key<Float> LENS_INFO_MINIMUM_FOCUS_DISTANCE =
954             new Key<Float>("android.lens.info.minimumFocusDistance", float.class);
955 
956     /**
957      * <p>Dimensions of lens shading map.</p>
958      * <p>The map should be on the order of 30-40 rows and columns, and
959      * must be smaller than 64x64.</p>
960      * <p><b>Range of valid values:</b><br>
961      * Both values &gt;= 1</p>
962      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
963      * <p><b>Full capability</b> -
964      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
965      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
966      *
967      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
968      * @hide
969      */
970     public static final Key<android.util.Size> LENS_INFO_SHADING_MAP_SIZE =
971             new Key<android.util.Size>("android.lens.info.shadingMapSize", android.util.Size.class);
972 
973     /**
974      * <p>The lens focus distance calibration quality.</p>
975      * <p>The lens focus distance calibration quality determines the reliability of
976      * focus related metadata entries, i.e. {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
977      * {@link CaptureResult#LENS_FOCUS_RANGE android.lens.focusRange}, {@link CameraCharacteristics#LENS_INFO_HYPERFOCAL_DISTANCE android.lens.info.hyperfocalDistance}, and
978      * {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}.</p>
979      * <p>APPROXIMATE and CALIBRATED devices report the focus metadata in
980      * units of diopters (1/meter), so <code>0.0f</code> represents focusing at infinity,
981      * and increasing positive numbers represent focusing closer and closer
982      * to the camera device. The focus distance control also uses diopters
983      * on these devices.</p>
984      * <p>UNCALIBRATED devices do not use units that are directly comparable
985      * to any real physical measurement, but <code>0.0f</code> still represents farthest
986      * focus, and {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} represents the
987      * nearest focus the device can achieve.</p>
988      * <p><b>Possible values:</b>
989      * <ul>
990      *   <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED UNCALIBRATED}</li>
991      *   <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE APPROXIMATE}</li>
992      *   <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED CALIBRATED}</li>
993      * </ul></p>
994      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
995      * <p><b>Limited capability</b> -
996      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
997      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
998      *
999      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1000      * @see CaptureRequest#LENS_FOCUS_DISTANCE
1001      * @see CaptureResult#LENS_FOCUS_RANGE
1002      * @see CameraCharacteristics#LENS_INFO_HYPERFOCAL_DISTANCE
1003      * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
1004      * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED
1005      * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE
1006      * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED
1007      */
1008     @PublicKey
1009     public static final Key<Integer> LENS_INFO_FOCUS_DISTANCE_CALIBRATION =
1010             new Key<Integer>("android.lens.info.focusDistanceCalibration", int.class);
1011 
1012     /**
1013      * <p>Direction the camera faces relative to
1014      * device screen.</p>
1015      * <p><b>Possible values:</b>
1016      * <ul>
1017      *   <li>{@link #LENS_FACING_FRONT FRONT}</li>
1018      *   <li>{@link #LENS_FACING_BACK BACK}</li>
1019      *   <li>{@link #LENS_FACING_EXTERNAL EXTERNAL}</li>
1020      * </ul></p>
1021      * <p>This key is available on all devices.</p>
1022      * @see #LENS_FACING_FRONT
1023      * @see #LENS_FACING_BACK
1024      * @see #LENS_FACING_EXTERNAL
1025      */
1026     @PublicKey
1027     public static final Key<Integer> LENS_FACING =
1028             new Key<Integer>("android.lens.facing", int.class);
1029 
1030     /**
1031      * <p>The orientation of the camera relative to the sensor
1032      * coordinate system.</p>
1033      * <p>The four coefficients that describe the quaternion
1034      * rotation from the Android sensor coordinate system to a
1035      * camera-aligned coordinate system where the X-axis is
1036      * aligned with the long side of the image sensor, the Y-axis
1037      * is aligned with the short side of the image sensor, and
1038      * the Z-axis is aligned with the optical axis of the sensor.</p>
1039      * <p>To convert from the quaternion coefficients <code>(x,y,z,w)</code>
1040      * to the axis of rotation <code>(a_x, a_y, a_z)</code> and rotation
1041      * amount <code>theta</code>, the following formulas can be used:</p>
1042      * <pre><code> theta = 2 * acos(w)
1043      * a_x = x / sin(theta/2)
1044      * a_y = y / sin(theta/2)
1045      * a_z = z / sin(theta/2)
1046      * </code></pre>
1047      * <p>To create a 3x3 rotation matrix that applies the rotation
1048      * defined by this quaternion, the following matrix can be
1049      * used:</p>
1050      * <pre><code>R = [ 1 - 2y^2 - 2z^2,       2xy - 2zw,       2xz + 2yw,
1051      *            2xy + 2zw, 1 - 2x^2 - 2z^2,       2yz - 2xw,
1052      *            2xz - 2yw,       2yz + 2xw, 1 - 2x^2 - 2y^2 ]
1053      * </code></pre>
1054      * <p>This matrix can then be used to apply the rotation to a
1055      *  column vector point with</p>
1056      * <p><code>p' = Rp</code></p>
1057      * <p>where <code>p</code> is in the device sensor coordinate system, and
1058      *  <code>p'</code> is in the camera-oriented coordinate system.</p>
1059      * <p><b>Units</b>:
1060      * Quaternion coefficients</p>
1061      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1062      */
1063     @PublicKey
1064     public static final Key<float[]> LENS_POSE_ROTATION =
1065             new Key<float[]>("android.lens.poseRotation", float[].class);
1066 
1067     /**
1068      * <p>Position of the camera optical center.</p>
1069      * <p>The position of the camera device's lens optical center,
1070      * as a three-dimensional vector <code>(x,y,z)</code>, relative to the
1071      * optical center of the largest camera device facing in the
1072      * same direction as this camera, in the {@link android.hardware.SensorEvent Android sensor coordinate
1073      * axes}. Note that only the axis definitions are shared with
1074      * the sensor coordinate system, but not the origin.</p>
1075      * <p>If this device is the largest or only camera device with a
1076      * given facing, then this position will be <code>(0, 0, 0)</code>; a
1077      * camera device with a lens optical center located 3 cm from
1078      * the main sensor along the +X axis (to the right from the
1079      * user's perspective) will report <code>(0.03, 0, 0)</code>.</p>
1080      * <p>To transform a pixel coordinates between two cameras
1081      * facing the same direction, first the source camera
1082      * {@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion} must be corrected for.  Then
1083      * the source camera {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} needs
1084      * to be applied, followed by the {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation}
1085      * of the source camera, the translation of the source camera
1086      * relative to the destination camera, the
1087      * {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the destination camera, and
1088      * finally the inverse of {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration}
1089      * of the destination camera. This obtains a
1090      * radial-distortion-free coordinate in the destination
1091      * camera pixel coordinates.</p>
1092      * <p>To compare this against a real image from the destination
1093      * camera, the destination camera image then needs to be
1094      * corrected for radial distortion before comparison or
1095      * sampling.</p>
1096      * <p><b>Units</b>: Meters</p>
1097      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1098      *
1099      * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
1100      * @see CameraCharacteristics#LENS_POSE_ROTATION
1101      * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
1102      */
1103     @PublicKey
1104     public static final Key<float[]> LENS_POSE_TRANSLATION =
1105             new Key<float[]>("android.lens.poseTranslation", float[].class);
1106 
1107     /**
1108      * <p>The parameters for this camera device's intrinsic
1109      * calibration.</p>
1110      * <p>The five calibration parameters that describe the
1111      * transform from camera-centric 3D coordinates to sensor
1112      * pixel coordinates:</p>
1113      * <pre><code>[f_x, f_y, c_x, c_y, s]
1114      * </code></pre>
1115      * <p>Where <code>f_x</code> and <code>f_y</code> are the horizontal and vertical
1116      * focal lengths, <code>[c_x, c_y]</code> is the position of the optical
1117      * axis, and <code>s</code> is a skew parameter for the sensor plane not
1118      * being aligned with the lens plane.</p>
1119      * <p>These are typically used within a transformation matrix K:</p>
1120      * <pre><code>K = [ f_x,   s, c_x,
1121      *        0, f_y, c_y,
1122      *        0    0,   1 ]
1123      * </code></pre>
1124      * <p>which can then be combined with the camera pose rotation
1125      * <code>R</code> and translation <code>t</code> ({@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} and
1126      * {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}, respective) to calculate the
1127      * complete transform from world coordinates to pixel
1128      * coordinates:</p>
1129      * <pre><code>P = [ K 0   * [ R t
1130      *      0 1 ]     0 1 ]
1131      * </code></pre>
1132      * <p>and with <code>p_w</code> being a point in the world coordinate system
1133      * and <code>p_s</code> being a point in the camera active pixel array
1134      * coordinate system, and with the mapping including the
1135      * homogeneous division by z:</p>
1136      * <pre><code> p_h = (x_h, y_h, z_h) = P p_w
1137      * p_s = p_h / z_h
1138      * </code></pre>
1139      * <p>so <code>[x_s, y_s]</code> is the pixel coordinates of the world
1140      * point, <code>z_s = 1</code>, and <code>w_s</code> is a measurement of disparity
1141      * (depth) in pixel coordinates.</p>
1142      * <p>Note that the coordinate system for this transform is the
1143      * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} system,
1144      * where <code>(0,0)</code> is the top-left of the
1145      * preCorrectionActiveArraySize rectangle. Once the pose and
1146      * intrinsic calibration transforms have been applied to a
1147      * world point, then the {@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion}
1148      * transform needs to be applied, and the result adjusted to
1149      * be in the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} coordinate
1150      * system (where <code>(0, 0)</code> is the top-left of the
1151      * activeArraySize rectangle), to determine the final pixel
1152      * coordinate of the world point for processed (non-RAW)
1153      * output buffers.</p>
1154      * <p><b>Units</b>:
1155      * Pixels in the
1156      * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}
1157      * coordinate system.</p>
1158      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1159      *
1160      * @see CameraCharacteristics#LENS_POSE_ROTATION
1161      * @see CameraCharacteristics#LENS_POSE_TRANSLATION
1162      * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
1163      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
1164      * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
1165      */
1166     @PublicKey
1167     public static final Key<float[]> LENS_INTRINSIC_CALIBRATION =
1168             new Key<float[]>("android.lens.intrinsicCalibration", float[].class);
1169 
1170     /**
1171      * <p>The correction coefficients to correct for this camera device's
1172      * radial and tangential lens distortion.</p>
1173      * <p>Four radial distortion coefficients <code>[kappa_0, kappa_1, kappa_2,
1174      * kappa_3]</code> and two tangential distortion coefficients
1175      * <code>[kappa_4, kappa_5]</code> that can be used to correct the
1176      * lens's geometric distortion with the mapping equations:</p>
1177      * <pre><code> x_c = x_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
1178      *        kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
1179      *  y_c = y_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
1180      *        kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
1181      * </code></pre>
1182      * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
1183      * input image that correspond to the pixel values in the
1184      * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
1185      * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
1186      * </code></pre>
1187      * <p>The pixel coordinates are defined in a normalized
1188      * coordinate system related to the
1189      * {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} calibration fields.
1190      * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code> have <code>(0,0)</code> at the
1191      * lens optical center <code>[c_x, c_y]</code>. The maximum magnitudes
1192      * of both x and y coordinates are normalized to be 1 at the
1193      * edge further from the optical center, so the range
1194      * for both dimensions is <code>-1 &lt;= x &lt;= 1</code>.</p>
1195      * <p>Finally, <code>r</code> represents the radial distance from the
1196      * optical center, <code>r^2 = x_i^2 + y_i^2</code>, and its magnitude
1197      * is therefore no larger than <code>|r| &lt;= sqrt(2)</code>.</p>
1198      * <p>The distortion model used is the Brown-Conrady model.</p>
1199      * <p><b>Units</b>:
1200      * Unitless coefficients.</p>
1201      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1202      *
1203      * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
1204      */
1205     @PublicKey
1206     public static final Key<float[]> LENS_RADIAL_DISTORTION =
1207             new Key<float[]>("android.lens.radialDistortion", float[].class);
1208 
1209     /**
1210      * <p>List of noise reduction modes for {@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} that are supported
1211      * by this camera device.</p>
1212      * <p>Full-capability camera devices will always support OFF and FAST.</p>
1213      * <p>Camera devices that support YUV_REPROCESSING or PRIVATE_REPROCESSING will support
1214      * ZERO_SHUTTER_LAG.</p>
1215      * <p>Legacy-capability camera devices will only support FAST mode.</p>
1216      * <p><b>Range of valid values:</b><br>
1217      * Any value listed in {@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}</p>
1218      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1219      * <p><b>Limited capability</b> -
1220      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1221      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1222      *
1223      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1224      * @see CaptureRequest#NOISE_REDUCTION_MODE
1225      */
1226     @PublicKey
1227     public static final Key<int[]> NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES =
1228             new Key<int[]>("android.noiseReduction.availableNoiseReductionModes", int[].class);
1229 
1230     /**
1231      * <p>If set to 1, the HAL will always split result
1232      * metadata for a single capture into multiple buffers,
1233      * returned using multiple process_capture_result calls.</p>
1234      * <p>Does not need to be listed in static
1235      * metadata. Support for partial results will be reworked in
1236      * future versions of camera service. This quirk will stop
1237      * working at that point; DO NOT USE without careful
1238      * consideration of future support.</p>
1239      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1240      * @deprecated
1241      * @hide
1242      */
1243     @Deprecated
1244     public static final Key<Byte> QUIRKS_USE_PARTIAL_RESULT =
1245             new Key<Byte>("android.quirks.usePartialResult", byte.class);
1246 
1247     /**
1248      * <p>The maximum numbers of different types of output streams
1249      * that can be configured and used simultaneously by a camera device.</p>
1250      * <p>This is a 3 element tuple that contains the max number of output simultaneous
1251      * streams for raw sensor, processed (but not stalling), and processed (and stalling)
1252      * formats respectively. For example, assuming that JPEG is typically a processed and
1253      * stalling stream, if max raw sensor format output stream number is 1, max YUV streams
1254      * number is 3, and max JPEG stream number is 2, then this tuple should be <code>(1, 3, 2)</code>.</p>
1255      * <p>This lists the upper bound of the number of output streams supported by
1256      * the camera device. Using more streams simultaneously may require more hardware and
1257      * CPU resources that will consume more power. The image format for an output stream can
1258      * be any supported format provided by android.scaler.availableStreamConfigurations.
1259      * The formats defined in android.scaler.availableStreamConfigurations can be catergorized
1260      * into the 3 stream types as below:</p>
1261      * <ul>
1262      * <li>Processed (but stalling): any non-RAW format with a stallDurations &gt; 0.
1263      *   Typically {@link android.graphics.ImageFormat#JPEG JPEG format}.</li>
1264      * <li>Raw formats: {@link android.graphics.ImageFormat#RAW_SENSOR RAW_SENSOR}, {@link android.graphics.ImageFormat#RAW10 RAW10}, or {@link android.graphics.ImageFormat#RAW12 RAW12}.</li>
1265      * <li>Processed (but not-stalling): any non-RAW format without a stall duration.
1266      *   Typically {@link android.graphics.ImageFormat#YUV_420_888 YUV_420_888},
1267      *   {@link android.graphics.ImageFormat#NV21 NV21}, or
1268      *   {@link android.graphics.ImageFormat#YV12 YV12}.</li>
1269      * </ul>
1270      * <p><b>Range of valid values:</b><br></p>
1271      * <p>For processed (and stalling) format streams, &gt;= 1.</p>
1272      * <p>For Raw format (either stalling or non-stalling) streams, &gt;= 0.</p>
1273      * <p>For processed (but not stalling) format streams, &gt;= 3
1274      * for FULL mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL</code>);
1275      * &gt;= 2 for LIMITED mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == LIMITED</code>).</p>
1276      * <p>This key is available on all devices.</p>
1277      *
1278      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1279      * @hide
1280      */
1281     public static final Key<int[]> REQUEST_MAX_NUM_OUTPUT_STREAMS =
1282             new Key<int[]>("android.request.maxNumOutputStreams", int[].class);
1283 
1284     /**
1285      * <p>The maximum numbers of different types of output streams
1286      * that can be configured and used simultaneously by a camera device
1287      * for any <code>RAW</code> formats.</p>
1288      * <p>This value contains the max number of output simultaneous
1289      * streams from the raw sensor.</p>
1290      * <p>This lists the upper bound of the number of output streams supported by
1291      * the camera device. Using more streams simultaneously may require more hardware and
1292      * CPU resources that will consume more power. The image format for this kind of an output stream can
1293      * be any <code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
1294      * <p>In particular, a <code>RAW</code> format is typically one of:</p>
1295      * <ul>
1296      * <li>{@link android.graphics.ImageFormat#RAW_SENSOR RAW_SENSOR}</li>
1297      * <li>{@link android.graphics.ImageFormat#RAW10 RAW10}</li>
1298      * <li>{@link android.graphics.ImageFormat#RAW12 RAW12}</li>
1299      * </ul>
1300      * <p>LEGACY mode devices ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} <code>==</code> LEGACY)
1301      * never support raw streams.</p>
1302      * <p><b>Range of valid values:</b><br></p>
1303      * <p>&gt;= 0</p>
1304      * <p>This key is available on all devices.</p>
1305      *
1306      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1307      * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
1308      */
1309     @PublicKey
1310     @SyntheticKey
1311     public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_RAW =
1312             new Key<Integer>("android.request.maxNumOutputRaw", int.class);
1313 
1314     /**
1315      * <p>The maximum numbers of different types of output streams
1316      * that can be configured and used simultaneously by a camera device
1317      * for any processed (but not-stalling) formats.</p>
1318      * <p>This value contains the max number of output simultaneous
1319      * streams for any processed (but not-stalling) formats.</p>
1320      * <p>This lists the upper bound of the number of output streams supported by
1321      * the camera device. Using more streams simultaneously may require more hardware and
1322      * CPU resources that will consume more power. The image format for this kind of an output stream can
1323      * be any non-<code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
1324      * <p>Processed (but not-stalling) is defined as any non-RAW format without a stall duration.
1325      * Typically:</p>
1326      * <ul>
1327      * <li>{@link android.graphics.ImageFormat#YUV_420_888 YUV_420_888}</li>
1328      * <li>{@link android.graphics.ImageFormat#NV21 NV21}</li>
1329      * <li>{@link android.graphics.ImageFormat#YV12 YV12}</li>
1330      * <li>Implementation-defined formats, i.e. {@link android.hardware.camera2.params.StreamConfigurationMap#isOutputSupportedFor(Class) }</li>
1331      * </ul>
1332      * <p>For full guarantees, query {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } with a
1333      * processed format -- it will return 0 for a non-stalling stream.</p>
1334      * <p>LEGACY devices will support at least 2 processing/non-stalling streams.</p>
1335      * <p><b>Range of valid values:</b><br></p>
1336      * <p>&gt;= 3
1337      * for FULL mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL</code>);
1338      * &gt;= 2 for LIMITED mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == LIMITED</code>).</p>
1339      * <p>This key is available on all devices.</p>
1340      *
1341      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1342      * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
1343      */
1344     @PublicKey
1345     @SyntheticKey
1346     public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_PROC =
1347             new Key<Integer>("android.request.maxNumOutputProc", int.class);
1348 
1349     /**
1350      * <p>The maximum numbers of different types of output streams
1351      * that can be configured and used simultaneously by a camera device
1352      * for any processed (and stalling) formats.</p>
1353      * <p>This value contains the max number of output simultaneous
1354      * streams for any processed (but not-stalling) formats.</p>
1355      * <p>This lists the upper bound of the number of output streams supported by
1356      * the camera device. Using more streams simultaneously may require more hardware and
1357      * CPU resources that will consume more power. The image format for this kind of an output stream can
1358      * be any non-<code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
1359      * <p>A processed and stalling format is defined as any non-RAW format with a stallDurations
1360      * &gt; 0.  Typically only the {@link android.graphics.ImageFormat#JPEG JPEG format} is a
1361      * stalling format.</p>
1362      * <p>For full guarantees, query {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } with a
1363      * processed format -- it will return a non-0 value for a stalling stream.</p>
1364      * <p>LEGACY devices will support up to 1 processing/stalling stream.</p>
1365      * <p><b>Range of valid values:</b><br></p>
1366      * <p>&gt;= 1</p>
1367      * <p>This key is available on all devices.</p>
1368      *
1369      * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
1370      */
1371     @PublicKey
1372     @SyntheticKey
1373     public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_PROC_STALLING =
1374             new Key<Integer>("android.request.maxNumOutputProcStalling", int.class);
1375 
1376     /**
1377      * <p>The maximum numbers of any type of input streams
1378      * that can be configured and used simultaneously by a camera device.</p>
1379      * <p>When set to 0, it means no input stream is supported.</p>
1380      * <p>The image format for a input stream can be any supported format returned by {@link android.hardware.camera2.params.StreamConfigurationMap#getInputFormats }. When using an
1381      * input stream, there must be at least one output stream configured to to receive the
1382      * reprocessed images.</p>
1383      * <p>When an input stream and some output streams are used in a reprocessing request,
1384      * only the input buffer will be used to produce these output stream buffers, and a
1385      * new sensor image will not be captured.</p>
1386      * <p>For example, for Zero Shutter Lag (ZSL) still capture use case, the input
1387      * stream image format will be PRIVATE, the associated output stream image format
1388      * should be JPEG.</p>
1389      * <p><b>Range of valid values:</b><br></p>
1390      * <p>0 or 1.</p>
1391      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1392      * <p><b>Full capability</b> -
1393      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1394      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1395      *
1396      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1397      */
1398     @PublicKey
1399     public static final Key<Integer> REQUEST_MAX_NUM_INPUT_STREAMS =
1400             new Key<Integer>("android.request.maxNumInputStreams", int.class);
1401 
1402     /**
1403      * <p>Specifies the number of maximum pipeline stages a frame
1404      * has to go through from when it's exposed to when it's available
1405      * to the framework.</p>
1406      * <p>A typical minimum value for this is 2 (one stage to expose,
1407      * one stage to readout) from the sensor. The ISP then usually adds
1408      * its own stages to do custom HW processing. Further stages may be
1409      * added by SW processing.</p>
1410      * <p>Depending on what settings are used (e.g. YUV, JPEG) and what
1411      * processing is enabled (e.g. face detection), the actual pipeline
1412      * depth (specified by {@link CaptureResult#REQUEST_PIPELINE_DEPTH android.request.pipelineDepth}) may be less than
1413      * the max pipeline depth.</p>
1414      * <p>A pipeline depth of X stages is equivalent to a pipeline latency of
1415      * X frame intervals.</p>
1416      * <p>This value will normally be 8 or less, however, for high speed capture session,
1417      * the max pipeline depth will be up to 8 x size of high speed capture request list.</p>
1418      * <p>This key is available on all devices.</p>
1419      *
1420      * @see CaptureResult#REQUEST_PIPELINE_DEPTH
1421      */
1422     @PublicKey
1423     public static final Key<Byte> REQUEST_PIPELINE_MAX_DEPTH =
1424             new Key<Byte>("android.request.pipelineMaxDepth", byte.class);
1425 
1426     /**
1427      * <p>Defines how many sub-components
1428      * a result will be composed of.</p>
1429      * <p>In order to combat the pipeline latency, partial results
1430      * may be delivered to the application layer from the camera device as
1431      * soon as they are available.</p>
1432      * <p>Optional; defaults to 1. A value of 1 means that partial
1433      * results are not supported, and only the final TotalCaptureResult will
1434      * be produced by the camera device.</p>
1435      * <p>A typical use case for this might be: after requesting an
1436      * auto-focus (AF) lock the new AF state might be available 50%
1437      * of the way through the pipeline.  The camera device could
1438      * then immediately dispatch this state via a partial result to
1439      * the application, and the rest of the metadata via later
1440      * partial results.</p>
1441      * <p><b>Range of valid values:</b><br>
1442      * &gt;= 1</p>
1443      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1444      */
1445     @PublicKey
1446     public static final Key<Integer> REQUEST_PARTIAL_RESULT_COUNT =
1447             new Key<Integer>("android.request.partialResultCount", int.class);
1448 
1449     /**
1450      * <p>List of capabilities that this camera device
1451      * advertises as fully supporting.</p>
1452      * <p>A capability is a contract that the camera device makes in order
1453      * to be able to satisfy one or more use cases.</p>
1454      * <p>Listing a capability guarantees that the whole set of features
1455      * required to support a common use will all be available.</p>
1456      * <p>Using a subset of the functionality provided by an unsupported
1457      * capability may be possible on a specific camera device implementation;
1458      * to do this query each of android.request.availableRequestKeys,
1459      * android.request.availableResultKeys,
1460      * android.request.availableCharacteristicsKeys.</p>
1461      * <p>The following capabilities are guaranteed to be available on
1462      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} <code>==</code> FULL devices:</p>
1463      * <ul>
1464      * <li>MANUAL_SENSOR</li>
1465      * <li>MANUAL_POST_PROCESSING</li>
1466      * </ul>
1467      * <p>Other capabilities may be available on either FULL or LIMITED
1468      * devices, but the application should query this key to be sure.</p>
1469      * <p><b>Possible values:</b>
1470      * <ul>
1471      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE BACKWARD_COMPATIBLE}</li>
1472      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR MANUAL_SENSOR}</li>
1473      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING MANUAL_POST_PROCESSING}</li>
1474      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_RAW RAW}</li>
1475      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING PRIVATE_REPROCESSING}</li>
1476      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS READ_SENSOR_SETTINGS}</li>
1477      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE BURST_CAPTURE}</li>
1478      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING YUV_REPROCESSING}</li>
1479      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT DEPTH_OUTPUT}</li>
1480      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO CONSTRAINED_HIGH_SPEED_VIDEO}</li>
1481      * </ul></p>
1482      * <p>This key is available on all devices.</p>
1483      *
1484      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1485      * @see #REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE
1486      * @see #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR
1487      * @see #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING
1488      * @see #REQUEST_AVAILABLE_CAPABILITIES_RAW
1489      * @see #REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING
1490      * @see #REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS
1491      * @see #REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE
1492      * @see #REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING
1493      * @see #REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT
1494      * @see #REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO
1495      */
1496     @PublicKey
1497     public static final Key<int[]> REQUEST_AVAILABLE_CAPABILITIES =
1498             new Key<int[]>("android.request.availableCapabilities", int[].class);
1499 
1500     /**
1501      * <p>A list of all keys that the camera device has available
1502      * to use with {@link android.hardware.camera2.CaptureRequest }.</p>
1503      * <p>Attempting to set a key into a CaptureRequest that is not
1504      * listed here will result in an invalid request and will be rejected
1505      * by the camera device.</p>
1506      * <p>This field can be used to query the feature set of a camera device
1507      * at a more granular level than capabilities. This is especially
1508      * important for optional keys that are not listed under any capability
1509      * in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.</p>
1510      * <p>This key is available on all devices.</p>
1511      *
1512      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1513      * @hide
1514      */
1515     public static final Key<int[]> REQUEST_AVAILABLE_REQUEST_KEYS =
1516             new Key<int[]>("android.request.availableRequestKeys", int[].class);
1517 
1518     /**
1519      * <p>A list of all keys that the camera device has available
1520      * to use with {@link android.hardware.camera2.CaptureResult }.</p>
1521      * <p>Attempting to get a key from a CaptureResult that is not
1522      * listed here will always return a <code>null</code> value. Getting a key from
1523      * a CaptureResult that is listed here will generally never return a <code>null</code>
1524      * value.</p>
1525      * <p>The following keys may return <code>null</code> unless they are enabled:</p>
1526      * <ul>
1527      * <li>android.statistics.lensShadingMap (non-null iff {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON)</li>
1528      * </ul>
1529      * <p>(Those sometimes-null keys will nevertheless be listed here
1530      * if they are available.)</p>
1531      * <p>This field can be used to query the feature set of a camera device
1532      * at a more granular level than capabilities. This is especially
1533      * important for optional keys that are not listed under any capability
1534      * in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.</p>
1535      * <p>This key is available on all devices.</p>
1536      *
1537      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1538      * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
1539      * @hide
1540      */
1541     public static final Key<int[]> REQUEST_AVAILABLE_RESULT_KEYS =
1542             new Key<int[]>("android.request.availableResultKeys", int[].class);
1543 
1544     /**
1545      * <p>A list of all keys that the camera device has available
1546      * to use with {@link android.hardware.camera2.CameraCharacteristics }.</p>
1547      * <p>This entry follows the same rules as
1548      * android.request.availableResultKeys (except that it applies for
1549      * CameraCharacteristics instead of CaptureResult). See above for more
1550      * details.</p>
1551      * <p>This key is available on all devices.</p>
1552      * @hide
1553      */
1554     public static final Key<int[]> REQUEST_AVAILABLE_CHARACTERISTICS_KEYS =
1555             new Key<int[]>("android.request.availableCharacteristicsKeys", int[].class);
1556 
1557     /**
1558      * <p>The list of image formats that are supported by this
1559      * camera device for output streams.</p>
1560      * <p>All camera devices will support JPEG and YUV_420_888 formats.</p>
1561      * <p>When set to YUV_420_888, application can access the YUV420 data directly.</p>
1562      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1563      * @deprecated
1564      * @hide
1565      */
1566     @Deprecated
1567     public static final Key<int[]> SCALER_AVAILABLE_FORMATS =
1568             new Key<int[]>("android.scaler.availableFormats", int[].class);
1569 
1570     /**
1571      * <p>The minimum frame duration that is supported
1572      * for each resolution in android.scaler.availableJpegSizes.</p>
1573      * <p>This corresponds to the minimum steady-state frame duration when only
1574      * that JPEG stream is active and captured in a burst, with all
1575      * processing (typically in android.*.mode) set to FAST.</p>
1576      * <p>When multiple streams are configured, the minimum
1577      * frame duration will be &gt;= max(individual stream min
1578      * durations)</p>
1579      * <p><b>Units</b>: Nanoseconds</p>
1580      * <p><b>Range of valid values:</b><br>
1581      * TODO: Remove property.</p>
1582      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1583      * @deprecated
1584      * @hide
1585      */
1586     @Deprecated
1587     public static final Key<long[]> SCALER_AVAILABLE_JPEG_MIN_DURATIONS =
1588             new Key<long[]>("android.scaler.availableJpegMinDurations", long[].class);
1589 
1590     /**
1591      * <p>The JPEG resolutions that are supported by this camera device.</p>
1592      * <p>The resolutions are listed as <code>(width, height)</code> pairs. All camera devices will support
1593      * sensor maximum resolution (defined by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}).</p>
1594      * <p><b>Range of valid values:</b><br>
1595      * TODO: Remove property.</p>
1596      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1597      *
1598      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
1599      * @deprecated
1600      * @hide
1601      */
1602     @Deprecated
1603     public static final Key<android.util.Size[]> SCALER_AVAILABLE_JPEG_SIZES =
1604             new Key<android.util.Size[]>("android.scaler.availableJpegSizes", android.util.Size[].class);
1605 
1606     /**
1607      * <p>The maximum ratio between both active area width
1608      * and crop region width, and active area height and
1609      * crop region height, for {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
1610      * <p>This represents the maximum amount of zooming possible by
1611      * the camera device, or equivalently, the minimum cropping
1612      * window size.</p>
1613      * <p>Crop regions that have a width or height that is smaller
1614      * than this ratio allows will be rounded up to the minimum
1615      * allowed size by the camera device.</p>
1616      * <p><b>Units</b>: Zoom scale factor</p>
1617      * <p><b>Range of valid values:</b><br>
1618      * &gt;=1</p>
1619      * <p>This key is available on all devices.</p>
1620      *
1621      * @see CaptureRequest#SCALER_CROP_REGION
1622      */
1623     @PublicKey
1624     public static final Key<Float> SCALER_AVAILABLE_MAX_DIGITAL_ZOOM =
1625             new Key<Float>("android.scaler.availableMaxDigitalZoom", float.class);
1626 
1627     /**
1628      * <p>For each available processed output size (defined in
1629      * android.scaler.availableProcessedSizes), this property lists the
1630      * minimum supportable frame duration for that size.</p>
1631      * <p>This should correspond to the frame duration when only that processed
1632      * stream is active, with all processing (typically in android.*.mode)
1633      * set to FAST.</p>
1634      * <p>When multiple streams are configured, the minimum frame duration will
1635      * be &gt;= max(individual stream min durations).</p>
1636      * <p><b>Units</b>: Nanoseconds</p>
1637      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1638      * @deprecated
1639      * @hide
1640      */
1641     @Deprecated
1642     public static final Key<long[]> SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS =
1643             new Key<long[]>("android.scaler.availableProcessedMinDurations", long[].class);
1644 
1645     /**
1646      * <p>The resolutions available for use with
1647      * processed output streams, such as YV12, NV12, and
1648      * platform opaque YUV/RGB streams to the GPU or video
1649      * encoders.</p>
1650      * <p>The resolutions are listed as <code>(width, height)</code> pairs.</p>
1651      * <p>For a given use case, the actual maximum supported resolution
1652      * may be lower than what is listed here, depending on the destination
1653      * Surface for the image data. For example, for recording video,
1654      * the video encoder chosen may have a maximum size limit (e.g. 1080p)
1655      * smaller than what the camera (e.g. maximum resolution is 3264x2448)
1656      * can provide.</p>
1657      * <p>Please reference the documentation for the image data destination to
1658      * check if it limits the maximum size for image data.</p>
1659      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1660      * @deprecated
1661      * @hide
1662      */
1663     @Deprecated
1664     public static final Key<android.util.Size[]> SCALER_AVAILABLE_PROCESSED_SIZES =
1665             new Key<android.util.Size[]>("android.scaler.availableProcessedSizes", android.util.Size[].class);
1666 
1667     /**
1668      * <p>The mapping of image formats that are supported by this
1669      * camera device for input streams, to their corresponding output formats.</p>
1670      * <p>All camera devices with at least 1
1671      * {@link CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS android.request.maxNumInputStreams} will have at least one
1672      * available input format.</p>
1673      * <p>The camera device will support the following map of formats,
1674      * if its dependent capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}) is supported:</p>
1675      * <table>
1676      * <thead>
1677      * <tr>
1678      * <th align="left">Input Format</th>
1679      * <th align="left">Output Format</th>
1680      * <th align="left">Capability</th>
1681      * </tr>
1682      * </thead>
1683      * <tbody>
1684      * <tr>
1685      * <td align="left">{@link android.graphics.ImageFormat#PRIVATE }</td>
1686      * <td align="left">{@link android.graphics.ImageFormat#JPEG }</td>
1687      * <td align="left">PRIVATE_REPROCESSING</td>
1688      * </tr>
1689      * <tr>
1690      * <td align="left">{@link android.graphics.ImageFormat#PRIVATE }</td>
1691      * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
1692      * <td align="left">PRIVATE_REPROCESSING</td>
1693      * </tr>
1694      * <tr>
1695      * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
1696      * <td align="left">{@link android.graphics.ImageFormat#JPEG }</td>
1697      * <td align="left">YUV_REPROCESSING</td>
1698      * </tr>
1699      * <tr>
1700      * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
1701      * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
1702      * <td align="left">YUV_REPROCESSING</td>
1703      * </tr>
1704      * </tbody>
1705      * </table>
1706      * <p>PRIVATE refers to a device-internal format that is not directly application-visible.  A
1707      * PRIVATE input surface can be acquired by {@link android.media.ImageReader#newInstance }
1708      * with {@link android.graphics.ImageFormat#PRIVATE } as the format.</p>
1709      * <p>For a PRIVATE_REPROCESSING-capable camera device, using the PRIVATE format as either input
1710      * or output will never hurt maximum frame rate (i.e.  {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration getOutputStallDuration(ImageFormat.PRIVATE, size)} is always 0),</p>
1711      * <p>Attempting to configure an input stream with output streams not
1712      * listed as available in this map is not valid.</p>
1713      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1714      *
1715      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1716      * @see CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS
1717      * @hide
1718      */
1719     public static final Key<android.hardware.camera2.params.ReprocessFormatsMap> SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP =
1720             new Key<android.hardware.camera2.params.ReprocessFormatsMap>("android.scaler.availableInputOutputFormatsMap", android.hardware.camera2.params.ReprocessFormatsMap.class);
1721 
1722     /**
1723      * <p>The available stream configurations that this
1724      * camera device supports
1725      * (i.e. format, width, height, output/input stream).</p>
1726      * <p>The configurations are listed as <code>(format, width, height, input?)</code>
1727      * tuples.</p>
1728      * <p>For a given use case, the actual maximum supported resolution
1729      * may be lower than what is listed here, depending on the destination
1730      * Surface for the image data. For example, for recording video,
1731      * the video encoder chosen may have a maximum size limit (e.g. 1080p)
1732      * smaller than what the camera (e.g. maximum resolution is 3264x2448)
1733      * can provide.</p>
1734      * <p>Please reference the documentation for the image data destination to
1735      * check if it limits the maximum size for image data.</p>
1736      * <p>Not all output formats may be supported in a configuration with
1737      * an input stream of a particular format. For more details, see
1738      * android.scaler.availableInputOutputFormatsMap.</p>
1739      * <p>The following table describes the minimum required output stream
1740      * configurations based on the hardware level
1741      * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}):</p>
1742      * <table>
1743      * <thead>
1744      * <tr>
1745      * <th align="center">Format</th>
1746      * <th align="center">Size</th>
1747      * <th align="center">Hardware Level</th>
1748      * <th align="center">Notes</th>
1749      * </tr>
1750      * </thead>
1751      * <tbody>
1752      * <tr>
1753      * <td align="center">JPEG</td>
1754      * <td align="center">{@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</td>
1755      * <td align="center">Any</td>
1756      * <td align="center"></td>
1757      * </tr>
1758      * <tr>
1759      * <td align="center">JPEG</td>
1760      * <td align="center">1920x1080 (1080p)</td>
1761      * <td align="center">Any</td>
1762      * <td align="center">if 1080p &lt;= activeArraySize</td>
1763      * </tr>
1764      * <tr>
1765      * <td align="center">JPEG</td>
1766      * <td align="center">1280x720 (720)</td>
1767      * <td align="center">Any</td>
1768      * <td align="center">if 720p &lt;= activeArraySize</td>
1769      * </tr>
1770      * <tr>
1771      * <td align="center">JPEG</td>
1772      * <td align="center">640x480 (480p)</td>
1773      * <td align="center">Any</td>
1774      * <td align="center">if 480p &lt;= activeArraySize</td>
1775      * </tr>
1776      * <tr>
1777      * <td align="center">JPEG</td>
1778      * <td align="center">320x240 (240p)</td>
1779      * <td align="center">Any</td>
1780      * <td align="center">if 240p &lt;= activeArraySize</td>
1781      * </tr>
1782      * <tr>
1783      * <td align="center">YUV_420_888</td>
1784      * <td align="center">all output sizes available for JPEG</td>
1785      * <td align="center">FULL</td>
1786      * <td align="center"></td>
1787      * </tr>
1788      * <tr>
1789      * <td align="center">YUV_420_888</td>
1790      * <td align="center">all output sizes available for JPEG, up to the maximum video size</td>
1791      * <td align="center">LIMITED</td>
1792      * <td align="center"></td>
1793      * </tr>
1794      * <tr>
1795      * <td align="center">IMPLEMENTATION_DEFINED</td>
1796      * <td align="center">same as YUV_420_888</td>
1797      * <td align="center">Any</td>
1798      * <td align="center"></td>
1799      * </tr>
1800      * </tbody>
1801      * </table>
1802      * <p>Refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} for additional
1803      * mandatory stream configurations on a per-capability basis.</p>
1804      * <p>This key is available on all devices.</p>
1805      *
1806      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1807      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1808      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
1809      * @hide
1810      */
1811     public static final Key<android.hardware.camera2.params.StreamConfiguration[]> SCALER_AVAILABLE_STREAM_CONFIGURATIONS =
1812             new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.scaler.availableStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
1813 
1814     /**
1815      * <p>This lists the minimum frame duration for each
1816      * format/size combination.</p>
1817      * <p>This should correspond to the frame duration when only that
1818      * stream is active, with all processing (typically in android.*.mode)
1819      * set to either OFF or FAST.</p>
1820      * <p>When multiple streams are used in a request, the minimum frame
1821      * duration will be max(individual stream min durations).</p>
1822      * <p>The minimum frame duration of a stream (of a particular format, size)
1823      * is the same regardless of whether the stream is input or output.</p>
1824      * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
1825      * android.scaler.availableStallDurations for more details about
1826      * calculating the max frame rate.</p>
1827      * <p>(Keep in sync with
1828      * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration })</p>
1829      * <p><b>Units</b>: (format, width, height, ns) x n</p>
1830      * <p>This key is available on all devices.</p>
1831      *
1832      * @see CaptureRequest#SENSOR_FRAME_DURATION
1833      * @hide
1834      */
1835     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> SCALER_AVAILABLE_MIN_FRAME_DURATIONS =
1836             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.scaler.availableMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
1837 
1838     /**
1839      * <p>This lists the maximum stall duration for each
1840      * output format/size combination.</p>
1841      * <p>A stall duration is how much extra time would get added
1842      * to the normal minimum frame duration for a repeating request
1843      * that has streams with non-zero stall.</p>
1844      * <p>For example, consider JPEG captures which have the following
1845      * characteristics:</p>
1846      * <ul>
1847      * <li>JPEG streams act like processed YUV streams in requests for which
1848      * they are not included; in requests in which they are directly
1849      * referenced, they act as JPEG streams. This is because supporting a
1850      * JPEG stream requires the underlying YUV data to always be ready for
1851      * use by a JPEG encoder, but the encoder will only be used (and impact
1852      * frame duration) on requests that actually reference a JPEG stream.</li>
1853      * <li>The JPEG processor can run concurrently to the rest of the camera
1854      * pipeline, but cannot process more than 1 capture at a time.</li>
1855      * </ul>
1856      * <p>In other words, using a repeating YUV request would result
1857      * in a steady frame rate (let's say it's 30 FPS). If a single
1858      * JPEG request is submitted periodically, the frame rate will stay
1859      * at 30 FPS (as long as we wait for the previous JPEG to return each
1860      * time). If we try to submit a repeating YUV + JPEG request, then
1861      * the frame rate will drop from 30 FPS.</p>
1862      * <p>In general, submitting a new request with a non-0 stall time
1863      * stream will <em>not</em> cause a frame rate drop unless there are still
1864      * outstanding buffers for that stream from previous requests.</p>
1865      * <p>Submitting a repeating request with streams (call this <code>S</code>)
1866      * is the same as setting the minimum frame duration from
1867      * the normal minimum frame duration corresponding to <code>S</code>, added with
1868      * the maximum stall duration for <code>S</code>.</p>
1869      * <p>If interleaving requests with and without a stall duration,
1870      * a request will stall by the maximum of the remaining times
1871      * for each can-stall stream with outstanding buffers.</p>
1872      * <p>This means that a stalling request will not have an exposure start
1873      * until the stall has completed.</p>
1874      * <p>This should correspond to the stall duration when only that stream is
1875      * active, with all processing (typically in android.*.mode) set to FAST
1876      * or OFF. Setting any of the processing modes to HIGH_QUALITY
1877      * effectively results in an indeterminate stall duration for all
1878      * streams in a request (the regular stall calculation rules are
1879      * ignored).</p>
1880      * <p>The following formats may always have a stall duration:</p>
1881      * <ul>
1882      * <li>{@link android.graphics.ImageFormat#JPEG }</li>
1883      * <li>{@link android.graphics.ImageFormat#RAW_SENSOR }</li>
1884      * </ul>
1885      * <p>The following formats will never have a stall duration:</p>
1886      * <ul>
1887      * <li>{@link android.graphics.ImageFormat#YUV_420_888 }</li>
1888      * <li>{@link android.graphics.ImageFormat#RAW10 }</li>
1889      * </ul>
1890      * <p>All other formats may or may not have an allowed stall duration on
1891      * a per-capability basis; refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
1892      * for more details.</p>
1893      * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} for more information about
1894      * calculating the max frame rate (absent stalls).</p>
1895      * <p>(Keep up to date with
1896      * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } )</p>
1897      * <p><b>Units</b>: (format, width, height, ns) x n</p>
1898      * <p>This key is available on all devices.</p>
1899      *
1900      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1901      * @see CaptureRequest#SENSOR_FRAME_DURATION
1902      * @hide
1903      */
1904     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> SCALER_AVAILABLE_STALL_DURATIONS =
1905             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.scaler.availableStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
1906 
1907     /**
1908      * <p>The available stream configurations that this
1909      * camera device supports; also includes the minimum frame durations
1910      * and the stall durations for each format/size combination.</p>
1911      * <p>All camera devices will support sensor maximum resolution (defined by
1912      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}) for the JPEG format.</p>
1913      * <p>For a given use case, the actual maximum supported resolution
1914      * may be lower than what is listed here, depending on the destination
1915      * Surface for the image data. For example, for recording video,
1916      * the video encoder chosen may have a maximum size limit (e.g. 1080p)
1917      * smaller than what the camera (e.g. maximum resolution is 3264x2448)
1918      * can provide.</p>
1919      * <p>Please reference the documentation for the image data destination to
1920      * check if it limits the maximum size for image data.</p>
1921      * <p>The following table describes the minimum required output stream
1922      * configurations based on the hardware level
1923      * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}):</p>
1924      * <table>
1925      * <thead>
1926      * <tr>
1927      * <th align="center">Format</th>
1928      * <th align="center">Size</th>
1929      * <th align="center">Hardware Level</th>
1930      * <th align="center">Notes</th>
1931      * </tr>
1932      * </thead>
1933      * <tbody>
1934      * <tr>
1935      * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
1936      * <td align="center">{@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} (*1)</td>
1937      * <td align="center">Any</td>
1938      * <td align="center"></td>
1939      * </tr>
1940      * <tr>
1941      * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
1942      * <td align="center">1920x1080 (1080p)</td>
1943      * <td align="center">Any</td>
1944      * <td align="center">if 1080p &lt;= activeArraySize</td>
1945      * </tr>
1946      * <tr>
1947      * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
1948      * <td align="center">1280x720 (720p)</td>
1949      * <td align="center">Any</td>
1950      * <td align="center">if 720p &lt;= activeArraySize</td>
1951      * </tr>
1952      * <tr>
1953      * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
1954      * <td align="center">640x480 (480p)</td>
1955      * <td align="center">Any</td>
1956      * <td align="center">if 480p &lt;= activeArraySize</td>
1957      * </tr>
1958      * <tr>
1959      * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
1960      * <td align="center">320x240 (240p)</td>
1961      * <td align="center">Any</td>
1962      * <td align="center">if 240p &lt;= activeArraySize</td>
1963      * </tr>
1964      * <tr>
1965      * <td align="center">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
1966      * <td align="center">all output sizes available for JPEG</td>
1967      * <td align="center">FULL</td>
1968      * <td align="center"></td>
1969      * </tr>
1970      * <tr>
1971      * <td align="center">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
1972      * <td align="center">all output sizes available for JPEG, up to the maximum video size</td>
1973      * <td align="center">LIMITED</td>
1974      * <td align="center"></td>
1975      * </tr>
1976      * <tr>
1977      * <td align="center">{@link android.graphics.ImageFormat#PRIVATE }</td>
1978      * <td align="center">same as YUV_420_888</td>
1979      * <td align="center">Any</td>
1980      * <td align="center"></td>
1981      * </tr>
1982      * </tbody>
1983      * </table>
1984      * <p>Refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} and {@link android.hardware.camera2.CameraDevice#createCaptureSession } for additional mandatory
1985      * stream configurations on a per-capability basis.</p>
1986      * <p>*1: For JPEG format, the sizes may be restricted by below conditions:</p>
1987      * <ul>
1988      * <li>The HAL may choose the aspect ratio of each Jpeg size to be one of well known ones
1989      * (e.g. 4:3, 16:9, 3:2 etc.). If the sensor maximum resolution
1990      * (defined by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}) has an aspect ratio other than these,
1991      * it does not have to be included in the supported JPEG sizes.</li>
1992      * <li>Some hardware JPEG encoders may have pixel boundary alignment requirements, such as
1993      * the dimensions being a multiple of 16.
1994      * Therefore, the maximum JPEG size may be smaller than sensor maximum resolution.
1995      * However, the largest JPEG size will be as close as possible to the sensor maximum
1996      * resolution given above constraints. It is required that after aspect ratio adjustments,
1997      * additional size reduction due to other issues must be less than 3% in area. For example,
1998      * if the sensor maximum resolution is 3280x2464, if the maximum JPEG size has aspect
1999      * ratio 4:3, and the JPEG encoder alignment requirement is 16, the maximum JPEG size will be
2000      * 3264x2448.</li>
2001      * </ul>
2002      * <p>This key is available on all devices.</p>
2003      *
2004      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2005      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
2006      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2007      */
2008     @PublicKey
2009     @SyntheticKey
2010     public static final Key<android.hardware.camera2.params.StreamConfigurationMap> SCALER_STREAM_CONFIGURATION_MAP =
2011             new Key<android.hardware.camera2.params.StreamConfigurationMap>("android.scaler.streamConfigurationMap", android.hardware.camera2.params.StreamConfigurationMap.class);
2012 
2013     /**
2014      * <p>The crop type that this camera device supports.</p>
2015      * <p>When passing a non-centered crop region ({@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}) to a camera
2016      * device that only supports CENTER_ONLY cropping, the camera device will move the
2017      * crop region to the center of the sensor active array ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize})
2018      * and keep the crop region width and height unchanged. The camera device will return the
2019      * final used crop region in metadata result {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
2020      * <p>Camera devices that support FREEFORM cropping will support any crop region that
2021      * is inside of the active array. The camera device will apply the same crop region and
2022      * return the final used crop region in capture result metadata {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
2023      * <p>LEGACY capability devices will only support CENTER_ONLY cropping.</p>
2024      * <p><b>Possible values:</b>
2025      * <ul>
2026      *   <li>{@link #SCALER_CROPPING_TYPE_CENTER_ONLY CENTER_ONLY}</li>
2027      *   <li>{@link #SCALER_CROPPING_TYPE_FREEFORM FREEFORM}</li>
2028      * </ul></p>
2029      * <p>This key is available on all devices.</p>
2030      *
2031      * @see CaptureRequest#SCALER_CROP_REGION
2032      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2033      * @see #SCALER_CROPPING_TYPE_CENTER_ONLY
2034      * @see #SCALER_CROPPING_TYPE_FREEFORM
2035      */
2036     @PublicKey
2037     public static final Key<Integer> SCALER_CROPPING_TYPE =
2038             new Key<Integer>("android.scaler.croppingType", int.class);
2039 
2040     /**
2041      * <p>The area of the image sensor which corresponds to active pixels after any geometric
2042      * distortion correction has been applied.</p>
2043      * <p>This is the rectangle representing the size of the active region of the sensor (i.e.
2044      * the region that actually receives light from the scene) after any geometric correction
2045      * has been applied, and should be treated as the maximum size in pixels of any of the
2046      * image output formats aside from the raw formats.</p>
2047      * <p>This rectangle is defined relative to the full pixel array; (0,0) is the top-left of
2048      * the full pixel array, and the size of the full pixel array is given by
2049      * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
2050      * <p>The coordinate system for most other keys that list pixel coordinates, including
2051      * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, is defined relative to the active array rectangle given in
2052      * this field, with <code>(0, 0)</code> being the top-left of this rectangle.</p>
2053      * <p>The active array may be smaller than the full pixel array, since the full array may
2054      * include black calibration pixels or other inactive regions, and geometric correction
2055      * resulting in scaling or cropping may have been applied.</p>
2056      * <p><b>Units</b>: Pixel coordinates on the image sensor</p>
2057      * <p>This key is available on all devices.</p>
2058      *
2059      * @see CaptureRequest#SCALER_CROP_REGION
2060      * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
2061      */
2062     @PublicKey
2063     public static final Key<android.graphics.Rect> SENSOR_INFO_ACTIVE_ARRAY_SIZE =
2064             new Key<android.graphics.Rect>("android.sensor.info.activeArraySize", android.graphics.Rect.class);
2065 
2066     /**
2067      * <p>Range of sensitivities for {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} supported by this
2068      * camera device.</p>
2069      * <p>The values are the standard ISO sensitivity values,
2070      * as defined in ISO 12232:2006.</p>
2071      * <p><b>Range of valid values:</b><br>
2072      * Min &lt;= 100, Max &gt;= 800</p>
2073      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2074      * <p><b>Full capability</b> -
2075      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2076      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2077      *
2078      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2079      * @see CaptureRequest#SENSOR_SENSITIVITY
2080      */
2081     @PublicKey
2082     public static final Key<android.util.Range<Integer>> SENSOR_INFO_SENSITIVITY_RANGE =
2083             new Key<android.util.Range<Integer>>("android.sensor.info.sensitivityRange", new TypeReference<android.util.Range<Integer>>() {{ }});
2084 
2085     /**
2086      * <p>The arrangement of color filters on sensor;
2087      * represents the colors in the top-left 2x2 section of
2088      * the sensor, in reading order.</p>
2089      * <p><b>Possible values:</b>
2090      * <ul>
2091      *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB RGGB}</li>
2092      *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG GRBG}</li>
2093      *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG GBRG}</li>
2094      *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR BGGR}</li>
2095      *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB RGB}</li>
2096      * </ul></p>
2097      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2098      * <p><b>Full capability</b> -
2099      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2100      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2101      *
2102      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2103      * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB
2104      * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG
2105      * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG
2106      * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR
2107      * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB
2108      */
2109     @PublicKey
2110     public static final Key<Integer> SENSOR_INFO_COLOR_FILTER_ARRANGEMENT =
2111             new Key<Integer>("android.sensor.info.colorFilterArrangement", int.class);
2112 
2113     /**
2114      * <p>The range of image exposure times for {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} supported
2115      * by this camera device.</p>
2116      * <p><b>Units</b>: Nanoseconds</p>
2117      * <p><b>Range of valid values:</b><br>
2118      * The minimum exposure time will be less than 100 us. For FULL
2119      * capability devices ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL),
2120      * the maximum exposure time will be greater than 100ms.</p>
2121      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2122      * <p><b>Full capability</b> -
2123      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2124      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2125      *
2126      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2127      * @see CaptureRequest#SENSOR_EXPOSURE_TIME
2128      */
2129     @PublicKey
2130     public static final Key<android.util.Range<Long>> SENSOR_INFO_EXPOSURE_TIME_RANGE =
2131             new Key<android.util.Range<Long>>("android.sensor.info.exposureTimeRange", new TypeReference<android.util.Range<Long>>() {{ }});
2132 
2133     /**
2134      * <p>The maximum possible frame duration (minimum frame rate) for
2135      * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} that is supported this camera device.</p>
2136      * <p>Attempting to use frame durations beyond the maximum will result in the frame
2137      * duration being clipped to the maximum. See that control for a full definition of frame
2138      * durations.</p>
2139      * <p>Refer to {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }
2140      * for the minimum frame duration values.</p>
2141      * <p><b>Units</b>: Nanoseconds</p>
2142      * <p><b>Range of valid values:</b><br>
2143      * For FULL capability devices
2144      * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL), at least 100ms.</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#SENSOR_FRAME_DURATION
2152      */
2153     @PublicKey
2154     public static final Key<Long> SENSOR_INFO_MAX_FRAME_DURATION =
2155             new Key<Long>("android.sensor.info.maxFrameDuration", long.class);
2156 
2157     /**
2158      * <p>The physical dimensions of the full pixel
2159      * array.</p>
2160      * <p>This is the physical size of the sensor pixel
2161      * array defined by {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
2162      * <p><b>Units</b>: Millimeters</p>
2163      * <p>This key is available on all devices.</p>
2164      *
2165      * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
2166      */
2167     @PublicKey
2168     public static final Key<android.util.SizeF> SENSOR_INFO_PHYSICAL_SIZE =
2169             new Key<android.util.SizeF>("android.sensor.info.physicalSize", android.util.SizeF.class);
2170 
2171     /**
2172      * <p>Dimensions of the full pixel array, possibly
2173      * including black calibration pixels.</p>
2174      * <p>The pixel count of the full pixel array of the image sensor, which covers
2175      * {@link CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE android.sensor.info.physicalSize} area.  This represents the full pixel dimensions of
2176      * the raw buffers produced by this sensor.</p>
2177      * <p>If a camera device supports raw sensor formats, either this or
2178      * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} is the maximum dimensions for the raw
2179      * output formats listed in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} (this depends on
2180      * whether or not the image sensor returns buffers containing pixels that are not
2181      * part of the active array region for blacklevel calibration or other purposes).</p>
2182      * <p>Some parts of the full pixel array may not receive light from the scene,
2183      * or be otherwise inactive.  The {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} key
2184      * defines the rectangle of active pixels that will be included in processed image
2185      * formats.</p>
2186      * <p><b>Units</b>: Pixels</p>
2187      * <p>This key is available on all devices.</p>
2188      *
2189      * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
2190      * @see CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE
2191      * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
2192      */
2193     @PublicKey
2194     public static final Key<android.util.Size> SENSOR_INFO_PIXEL_ARRAY_SIZE =
2195             new Key<android.util.Size>("android.sensor.info.pixelArraySize", android.util.Size.class);
2196 
2197     /**
2198      * <p>Maximum raw value output by sensor.</p>
2199      * <p>This specifies the fully-saturated encoding level for the raw
2200      * sample values from the sensor.  This is typically caused by the
2201      * sensor becoming highly non-linear or clipping. The minimum for
2202      * each channel is specified by the offset in the
2203      * {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} key.</p>
2204      * <p>The white level is typically determined either by sensor bit depth
2205      * (8-14 bits is expected), or by the point where the sensor response
2206      * becomes too non-linear to be useful.  The default value for this is
2207      * maximum representable value for a 16-bit raw sample (2^16 - 1).</p>
2208      * <p>The white level values of captured images may vary for different
2209      * capture settings (e.g., {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}). This key
2210      * represents a coarse approximation for such case. It is recommended
2211      * to use {@link CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL android.sensor.dynamicWhiteLevel} for captures when supported
2212      * by the camera device, which provides more accurate white level values.</p>
2213      * <p><b>Range of valid values:</b><br>
2214      * &gt; 255 (8-bit output)</p>
2215      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2216      *
2217      * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
2218      * @see CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL
2219      * @see CaptureRequest#SENSOR_SENSITIVITY
2220      */
2221     @PublicKey
2222     public static final Key<Integer> SENSOR_INFO_WHITE_LEVEL =
2223             new Key<Integer>("android.sensor.info.whiteLevel", int.class);
2224 
2225     /**
2226      * <p>The time base source for sensor capture start timestamps.</p>
2227      * <p>The timestamps provided for captures are always in nanoseconds and monotonic, but
2228      * may not based on a time source that can be compared to other system time sources.</p>
2229      * <p>This characteristic defines the source for the timestamps, and therefore whether they
2230      * can be compared against other system time sources/timestamps.</p>
2231      * <p><b>Possible values:</b>
2232      * <ul>
2233      *   <li>{@link #SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN UNKNOWN}</li>
2234      *   <li>{@link #SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME REALTIME}</li>
2235      * </ul></p>
2236      * <p>This key is available on all devices.</p>
2237      * @see #SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN
2238      * @see #SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME
2239      */
2240     @PublicKey
2241     public static final Key<Integer> SENSOR_INFO_TIMESTAMP_SOURCE =
2242             new Key<Integer>("android.sensor.info.timestampSource", int.class);
2243 
2244     /**
2245      * <p>Whether the RAW images output from this camera device are subject to
2246      * lens shading correction.</p>
2247      * <p>If TRUE, all images produced by the camera device in the RAW image formats will
2248      * have lens shading correction already applied to it. If FALSE, the images will
2249      * not be adjusted for lens shading correction.
2250      * See {@link CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW android.request.maxNumOutputRaw} for a list of RAW image formats.</p>
2251      * <p>This key will be <code>null</code> for all devices do not report this information.
2252      * Devices with RAW capability will always report this information in this key.</p>
2253      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2254      *
2255      * @see CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW
2256      */
2257     @PublicKey
2258     public static final Key<Boolean> SENSOR_INFO_LENS_SHADING_APPLIED =
2259             new Key<Boolean>("android.sensor.info.lensShadingApplied", boolean.class);
2260 
2261     /**
2262      * <p>The area of the image sensor which corresponds to active pixels prior to the
2263      * application of any geometric distortion correction.</p>
2264      * <p>This is the rectangle representing the size of the active region of the sensor (i.e.
2265      * the region that actually receives light from the scene) before any geometric correction
2266      * has been applied, and should be treated as the active region rectangle for any of the
2267      * raw formats.  All metadata associated with raw processing (e.g. the lens shading
2268      * correction map, and radial distortion fields) treats the top, left of this rectangle as
2269      * the origin, (0,0).</p>
2270      * <p>The size of this region determines the maximum field of view and the maximum number of
2271      * pixels that an image from this sensor can contain, prior to the application of
2272      * geometric distortion correction. The effective maximum pixel dimensions of a
2273      * post-distortion-corrected image is given by the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}
2274      * field, and the effective maximum field of view for a post-distortion-corrected image
2275      * can be calculated by applying the geometric distortion correction fields to this
2276      * rectangle, and cropping to the rectangle given in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
2277      * <p>E.g. to calculate position of a pixel, (x,y), in a processed YUV output image with the
2278      * dimensions in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} given the position of a pixel,
2279      * (x', y'), in the raw pixel array with dimensions give in
2280      * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}:</p>
2281      * <ol>
2282      * <li>Choose a pixel (x', y') within the active array region of the raw buffer given in
2283      * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, otherwise this pixel is considered
2284      * to be outside of the FOV, and will not be shown in the processed output image.</li>
2285      * <li>Apply geometric distortion correction to get the post-distortion pixel coordinate,
2286      * (x_i, y_i). When applying geometric correction metadata, note that metadata for raw
2287      * buffers is defined relative to the top, left of the
2288      * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} rectangle.</li>
2289      * <li>If the resulting corrected pixel coordinate is within the region given in
2290      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, then the position of this pixel in the
2291      * processed output image buffer is <code>(x_i - activeArray.left, y_i - activeArray.top)</code>,
2292      * when the top, left coordinate of that buffer is treated as (0, 0).</li>
2293      * </ol>
2294      * <p>Thus, for pixel x',y' = (25, 25) on a sensor where {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}
2295      * is (100,100), {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} is (10, 10, 100, 100),
2296      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} is (20, 20, 80, 80), and the geometric distortion
2297      * correction doesn't change the pixel coordinate, the resulting pixel selected in
2298      * pixel coordinates would be x,y = (25, 25) relative to the top,left of the raw buffer
2299      * with dimensions given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}, and would be (5, 5)
2300      * relative to the top,left of post-processed YUV output buffer with dimensions given in
2301      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
2302      * <p>The currently supported fields that correct for geometric distortion are:</p>
2303      * <ol>
2304      * <li>{@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion}.</li>
2305      * </ol>
2306      * <p>If all of the geometric distortion fields are no-ops, this rectangle will be the same
2307      * as the post-distortion-corrected rectangle given in
2308      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
2309      * <p>This rectangle is defined relative to the full pixel array; (0,0) is the top-left of
2310      * the full pixel array, and the size of the full pixel array is given by
2311      * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
2312      * <p>The pre-correction active array may be smaller than the full pixel array, since the
2313      * full array may include black calibration pixels or other inactive regions.</p>
2314      * <p><b>Units</b>: Pixel coordinates on the image sensor</p>
2315      * <p>This key is available on all devices.</p>
2316      *
2317      * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
2318      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2319      * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
2320      * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
2321      */
2322     @PublicKey
2323     public static final Key<android.graphics.Rect> SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE =
2324             new Key<android.graphics.Rect>("android.sensor.info.preCorrectionActiveArraySize", android.graphics.Rect.class);
2325 
2326     /**
2327      * <p>The standard reference illuminant used as the scene light source when
2328      * calculating the {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM1 android.sensor.colorTransform1},
2329      * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1 android.sensor.calibrationTransform1}, and
2330      * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX1 android.sensor.forwardMatrix1} matrices.</p>
2331      * <p>The values in this key correspond to the values defined for the
2332      * EXIF LightSource tag. These illuminants are standard light sources
2333      * that are often used calibrating camera devices.</p>
2334      * <p>If this key is present, then {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM1 android.sensor.colorTransform1},
2335      * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1 android.sensor.calibrationTransform1}, and
2336      * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX1 android.sensor.forwardMatrix1} will also be present.</p>
2337      * <p>Some devices may choose to provide a second set of calibration
2338      * information for improved quality, including
2339      * {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2} and its corresponding matrices.</p>
2340      * <p><b>Possible values:</b>
2341      * <ul>
2342      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT DAYLIGHT}</li>
2343      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT FLUORESCENT}</li>
2344      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN TUNGSTEN}</li>
2345      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FLASH FLASH}</li>
2346      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER FINE_WEATHER}</li>
2347      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER CLOUDY_WEATHER}</li>
2348      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_SHADE SHADE}</li>
2349      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT DAYLIGHT_FLUORESCENT}</li>
2350      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT DAY_WHITE_FLUORESCENT}</li>
2351      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT COOL_WHITE_FLUORESCENT}</li>
2352      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT WHITE_FLUORESCENT}</li>
2353      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A STANDARD_A}</li>
2354      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B STANDARD_B}</li>
2355      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C STANDARD_C}</li>
2356      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D55 D55}</li>
2357      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D65 D65}</li>
2358      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D75 D75}</li>
2359      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D50 D50}</li>
2360      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN ISO_STUDIO_TUNGSTEN}</li>
2361      * </ul></p>
2362      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2363      *
2364      * @see CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1
2365      * @see CameraCharacteristics#SENSOR_COLOR_TRANSFORM1
2366      * @see CameraCharacteristics#SENSOR_FORWARD_MATRIX1
2367      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
2368      * @see #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT
2369      * @see #SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT
2370      * @see #SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN
2371      * @see #SENSOR_REFERENCE_ILLUMINANT1_FLASH
2372      * @see #SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER
2373      * @see #SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER
2374      * @see #SENSOR_REFERENCE_ILLUMINANT1_SHADE
2375      * @see #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT
2376      * @see #SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT
2377      * @see #SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT
2378      * @see #SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT
2379      * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A
2380      * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B
2381      * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C
2382      * @see #SENSOR_REFERENCE_ILLUMINANT1_D55
2383      * @see #SENSOR_REFERENCE_ILLUMINANT1_D65
2384      * @see #SENSOR_REFERENCE_ILLUMINANT1_D75
2385      * @see #SENSOR_REFERENCE_ILLUMINANT1_D50
2386      * @see #SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN
2387      */
2388     @PublicKey
2389     public static final Key<Integer> SENSOR_REFERENCE_ILLUMINANT1 =
2390             new Key<Integer>("android.sensor.referenceIlluminant1", int.class);
2391 
2392     /**
2393      * <p>The standard reference illuminant used as the scene light source when
2394      * calculating the {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM2 android.sensor.colorTransform2},
2395      * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2 android.sensor.calibrationTransform2}, and
2396      * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX2 android.sensor.forwardMatrix2} matrices.</p>
2397      * <p>See {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1} for more details.</p>
2398      * <p>If this key is present, then {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM2 android.sensor.colorTransform2},
2399      * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2 android.sensor.calibrationTransform2}, and
2400      * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX2 android.sensor.forwardMatrix2} will also be present.</p>
2401      * <p><b>Range of valid values:</b><br>
2402      * Any value listed in {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}</p>
2403      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2404      *
2405      * @see CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2
2406      * @see CameraCharacteristics#SENSOR_COLOR_TRANSFORM2
2407      * @see CameraCharacteristics#SENSOR_FORWARD_MATRIX2
2408      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
2409      */
2410     @PublicKey
2411     public static final Key<Byte> SENSOR_REFERENCE_ILLUMINANT2 =
2412             new Key<Byte>("android.sensor.referenceIlluminant2", byte.class);
2413 
2414     /**
2415      * <p>A per-device calibration transform matrix that maps from the
2416      * reference sensor colorspace to the actual device sensor colorspace.</p>
2417      * <p>This matrix is used to correct for per-device variations in the
2418      * sensor colorspace, and is used for processing raw buffer data.</p>
2419      * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
2420      * contains a per-device calibration transform that maps colors
2421      * from reference sensor color space (i.e. the "golden module"
2422      * colorspace) into this camera device's native sensor color
2423      * space under the first reference illuminant
2424      * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}).</p>
2425      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2426      *
2427      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
2428      */
2429     @PublicKey
2430     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_CALIBRATION_TRANSFORM1 =
2431             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.calibrationTransform1", android.hardware.camera2.params.ColorSpaceTransform.class);
2432 
2433     /**
2434      * <p>A per-device calibration transform matrix that maps from the
2435      * reference sensor colorspace to the actual device sensor colorspace
2436      * (this is the colorspace of the raw buffer data).</p>
2437      * <p>This matrix is used to correct for per-device variations in the
2438      * sensor colorspace, and is used for processing raw buffer data.</p>
2439      * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
2440      * contains a per-device calibration transform that maps colors
2441      * from reference sensor color space (i.e. the "golden module"
2442      * colorspace) into this camera device's native sensor color
2443      * space under the second reference illuminant
2444      * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2}).</p>
2445      * <p>This matrix will only be present if the second reference
2446      * illuminant is present.</p>
2447      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2448      *
2449      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
2450      */
2451     @PublicKey
2452     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_CALIBRATION_TRANSFORM2 =
2453             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.calibrationTransform2", android.hardware.camera2.params.ColorSpaceTransform.class);
2454 
2455     /**
2456      * <p>A matrix that transforms color values from CIE XYZ color space to
2457      * reference sensor color space.</p>
2458      * <p>This matrix is used to convert from the standard CIE XYZ color
2459      * space to the reference sensor colorspace, and is used when processing
2460      * raw buffer data.</p>
2461      * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
2462      * contains a color transform matrix that maps colors from the CIE
2463      * XYZ color space to the reference sensor color space (i.e. the
2464      * "golden module" colorspace) under the first reference illuminant
2465      * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}).</p>
2466      * <p>The white points chosen in both the reference sensor color space
2467      * and the CIE XYZ colorspace when calculating this transform will
2468      * match the standard white point for the first reference illuminant
2469      * (i.e. no chromatic adaptation will be applied by this transform).</p>
2470      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2471      *
2472      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
2473      */
2474     @PublicKey
2475     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_COLOR_TRANSFORM1 =
2476             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.colorTransform1", android.hardware.camera2.params.ColorSpaceTransform.class);
2477 
2478     /**
2479      * <p>A matrix that transforms color values from CIE XYZ color space to
2480      * reference sensor color space.</p>
2481      * <p>This matrix is used to convert from the standard CIE XYZ color
2482      * space to the reference sensor colorspace, and is used when processing
2483      * raw buffer data.</p>
2484      * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
2485      * contains a color transform matrix that maps colors from the CIE
2486      * XYZ color space to the reference sensor color space (i.e. the
2487      * "golden module" colorspace) under the second reference illuminant
2488      * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2}).</p>
2489      * <p>The white points chosen in both the reference sensor color space
2490      * and the CIE XYZ colorspace when calculating this transform will
2491      * match the standard white point for the second reference illuminant
2492      * (i.e. no chromatic adaptation will be applied by this transform).</p>
2493      * <p>This matrix will only be present if the second reference
2494      * illuminant is present.</p>
2495      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2496      *
2497      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
2498      */
2499     @PublicKey
2500     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_COLOR_TRANSFORM2 =
2501             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.colorTransform2", android.hardware.camera2.params.ColorSpaceTransform.class);
2502 
2503     /**
2504      * <p>A matrix that transforms white balanced camera colors from the reference
2505      * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.</p>
2506      * <p>This matrix is used to convert to the standard CIE XYZ colorspace, and
2507      * is used when processing raw buffer data.</p>
2508      * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and contains
2509      * a color transform matrix that maps white balanced colors from the
2510      * reference sensor color space to the CIE XYZ color space with a D50 white
2511      * point.</p>
2512      * <p>Under the first reference illuminant ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1})
2513      * this matrix is chosen so that the standard white point for this reference
2514      * illuminant in the reference sensor colorspace is mapped to D50 in the
2515      * CIE XYZ colorspace.</p>
2516      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2517      *
2518      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
2519      */
2520     @PublicKey
2521     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_FORWARD_MATRIX1 =
2522             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.forwardMatrix1", android.hardware.camera2.params.ColorSpaceTransform.class);
2523 
2524     /**
2525      * <p>A matrix that transforms white balanced camera colors from the reference
2526      * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.</p>
2527      * <p>This matrix is used to convert to the standard CIE XYZ colorspace, and
2528      * is used when processing raw buffer data.</p>
2529      * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and contains
2530      * a color transform matrix that maps white balanced colors from the
2531      * reference sensor color space to the CIE XYZ color space with a D50 white
2532      * point.</p>
2533      * <p>Under the second reference illuminant ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2})
2534      * this matrix is chosen so that the standard white point for this reference
2535      * illuminant in the reference sensor colorspace is mapped to D50 in the
2536      * CIE XYZ colorspace.</p>
2537      * <p>This matrix will only be present if the second reference
2538      * illuminant is present.</p>
2539      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2540      *
2541      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
2542      */
2543     @PublicKey
2544     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_FORWARD_MATRIX2 =
2545             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.forwardMatrix2", android.hardware.camera2.params.ColorSpaceTransform.class);
2546 
2547     /**
2548      * <p>A fixed black level offset for each of the color filter arrangement
2549      * (CFA) mosaic channels.</p>
2550      * <p>This key specifies the zero light value for each of the CFA mosaic
2551      * channels in the camera sensor.  The maximal value output by the
2552      * sensor is represented by the value in {@link CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL android.sensor.info.whiteLevel}.</p>
2553      * <p>The values are given in the same order as channels listed for the CFA
2554      * layout key (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}), i.e. the
2555      * nth value given corresponds to the black level offset for the nth
2556      * color channel listed in the CFA.</p>
2557      * <p>The black level values of captured images may vary for different
2558      * capture settings (e.g., {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}). This key
2559      * represents a coarse approximation for such case. It is recommended to
2560      * use {@link CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL android.sensor.dynamicBlackLevel} or use pixels from
2561      * {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} directly for captures when
2562      * supported by the camera device, which provides more accurate black
2563      * level values. For raw capture in particular, it is recommended to use
2564      * pixels from {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} to calculate black
2565      * level values for each frame.</p>
2566      * <p><b>Range of valid values:</b><br>
2567      * &gt;= 0 for each.</p>
2568      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2569      *
2570      * @see CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL
2571      * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
2572      * @see CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL
2573      * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS
2574      * @see CaptureRequest#SENSOR_SENSITIVITY
2575      */
2576     @PublicKey
2577     public static final Key<android.hardware.camera2.params.BlackLevelPattern> SENSOR_BLACK_LEVEL_PATTERN =
2578             new Key<android.hardware.camera2.params.BlackLevelPattern>("android.sensor.blackLevelPattern", android.hardware.camera2.params.BlackLevelPattern.class);
2579 
2580     /**
2581      * <p>Maximum sensitivity that is implemented
2582      * purely through analog gain.</p>
2583      * <p>For {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} values less than or
2584      * equal to this, all applied gain must be analog. For
2585      * values above this, the gain applied can be a mix of analog and
2586      * digital.</p>
2587      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2588      * <p><b>Full capability</b> -
2589      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2590      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2591      *
2592      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2593      * @see CaptureRequest#SENSOR_SENSITIVITY
2594      */
2595     @PublicKey
2596     public static final Key<Integer> SENSOR_MAX_ANALOG_SENSITIVITY =
2597             new Key<Integer>("android.sensor.maxAnalogSensitivity", int.class);
2598 
2599     /**
2600      * <p>Clockwise angle through which the output image needs to be rotated to be
2601      * upright on the device screen in its native orientation.</p>
2602      * <p>Also defines the direction of rolling shutter readout, which is from top to bottom in
2603      * the sensor's coordinate system.</p>
2604      * <p><b>Units</b>: Degrees of clockwise rotation; always a multiple of
2605      * 90</p>
2606      * <p><b>Range of valid values:</b><br>
2607      * 0, 90, 180, 270</p>
2608      * <p>This key is available on all devices.</p>
2609      */
2610     @PublicKey
2611     public static final Key<Integer> SENSOR_ORIENTATION =
2612             new Key<Integer>("android.sensor.orientation", int.class);
2613 
2614     /**
2615      * <p>List of sensor test pattern modes for {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode}
2616      * supported by this camera device.</p>
2617      * <p>Defaults to OFF, and always includes OFF if defined.</p>
2618      * <p><b>Range of valid values:</b><br>
2619      * Any value listed in {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode}</p>
2620      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2621      *
2622      * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
2623      */
2624     @PublicKey
2625     public static final Key<int[]> SENSOR_AVAILABLE_TEST_PATTERN_MODES =
2626             new Key<int[]>("android.sensor.availableTestPatternModes", int[].class);
2627 
2628     /**
2629      * <p>List of disjoint rectangles indicating the sensor
2630      * optically shielded black pixel regions.</p>
2631      * <p>In most camera sensors, the active array is surrounded by some
2632      * optically shielded pixel areas. By blocking light, these pixels
2633      * provides a reliable black reference for black level compensation
2634      * in active array region.</p>
2635      * <p>This key provides a list of disjoint rectangles specifying the
2636      * regions of optically shielded (with metal shield) black pixel
2637      * regions if the camera device is capable of reading out these black
2638      * pixels in the output raw images. In comparison to the fixed black
2639      * level values reported by {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern}, this key
2640      * may provide a more accurate way for the application to calculate
2641      * black level of each captured raw images.</p>
2642      * <p>When this key is reported, the {@link CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL android.sensor.dynamicBlackLevel} and
2643      * {@link CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL android.sensor.dynamicWhiteLevel} will also be reported.</p>
2644      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2645      *
2646      * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
2647      * @see CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL
2648      * @see CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL
2649      */
2650     @PublicKey
2651     public static final Key<android.graphics.Rect[]> SENSOR_OPTICAL_BLACK_REGIONS =
2652             new Key<android.graphics.Rect[]>("android.sensor.opticalBlackRegions", android.graphics.Rect[].class);
2653 
2654     /**
2655      * <p>List of lens shading modes for {@link CaptureRequest#SHADING_MODE android.shading.mode} that are supported by this camera device.</p>
2656      * <p>This list contains lens shading modes that can be set for the camera device.
2657      * Camera devices that support the MANUAL_POST_PROCESSING capability will always
2658      * list OFF and FAST mode. This includes all FULL level devices.
2659      * LEGACY devices will always only support FAST mode.</p>
2660      * <p><b>Range of valid values:</b><br>
2661      * Any value listed in {@link CaptureRequest#SHADING_MODE android.shading.mode}</p>
2662      * <p>This key is available on all devices.</p>
2663      *
2664      * @see CaptureRequest#SHADING_MODE
2665      */
2666     @PublicKey
2667     public static final Key<int[]> SHADING_AVAILABLE_MODES =
2668             new Key<int[]>("android.shading.availableModes", int[].class);
2669 
2670     /**
2671      * <p>List of face detection modes for {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} that are
2672      * supported by this camera device.</p>
2673      * <p>OFF is always supported.</p>
2674      * <p><b>Range of valid values:</b><br>
2675      * Any value listed in {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode}</p>
2676      * <p>This key is available on all devices.</p>
2677      *
2678      * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
2679      */
2680     @PublicKey
2681     public static final Key<int[]> STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES =
2682             new Key<int[]>("android.statistics.info.availableFaceDetectModes", int[].class);
2683 
2684     /**
2685      * <p>The maximum number of simultaneously detectable
2686      * faces.</p>
2687      * <p><b>Range of valid values:</b><br>
2688      * 0 for cameras without available face detection; otherwise:
2689      * <code>&gt;=4</code> for LIMITED or FULL hwlevel devices or
2690      * <code>&gt;0</code> for LEGACY devices.</p>
2691      * <p>This key is available on all devices.</p>
2692      */
2693     @PublicKey
2694     public static final Key<Integer> STATISTICS_INFO_MAX_FACE_COUNT =
2695             new Key<Integer>("android.statistics.info.maxFaceCount", int.class);
2696 
2697     /**
2698      * <p>List of hot pixel map output modes for {@link CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE android.statistics.hotPixelMapMode} that are
2699      * supported by this camera device.</p>
2700      * <p>If no hotpixel map output is available for this camera device, this will contain only
2701      * <code>false</code>.</p>
2702      * <p>ON is always supported on devices with the RAW capability.</p>
2703      * <p><b>Range of valid values:</b><br>
2704      * Any value listed in {@link CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE android.statistics.hotPixelMapMode}</p>
2705      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2706      *
2707      * @see CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE
2708      */
2709     @PublicKey
2710     public static final Key<boolean[]> STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES =
2711             new Key<boolean[]>("android.statistics.info.availableHotPixelMapModes", boolean[].class);
2712 
2713     /**
2714      * <p>List of lens shading map output modes for {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} that
2715      * are supported by this camera device.</p>
2716      * <p>If no lens shading map output is available for this camera device, this key will
2717      * contain only OFF.</p>
2718      * <p>ON is always supported on devices with the RAW capability.
2719      * LEGACY mode devices will always only support OFF.</p>
2720      * <p><b>Range of valid values:</b><br>
2721      * Any value listed in {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode}</p>
2722      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2723      *
2724      * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
2725      */
2726     @PublicKey
2727     public static final Key<int[]> STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES =
2728             new Key<int[]>("android.statistics.info.availableLensShadingMapModes", int[].class);
2729 
2730     /**
2731      * <p>Maximum number of supported points in the
2732      * tonemap curve that can be used for {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.</p>
2733      * <p>If the actual number of points provided by the application (in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}*) is
2734      * less than this maximum, the camera device will resample the curve to its internal
2735      * representation, using linear interpolation.</p>
2736      * <p>The output curves in the result metadata may have a different number
2737      * of points than the input curves, and will represent the actual
2738      * hardware curves used as closely as possible when linearly interpolated.</p>
2739      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2740      * <p><b>Full capability</b> -
2741      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2742      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2743      *
2744      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2745      * @see CaptureRequest#TONEMAP_CURVE
2746      */
2747     @PublicKey
2748     public static final Key<Integer> TONEMAP_MAX_CURVE_POINTS =
2749             new Key<Integer>("android.tonemap.maxCurvePoints", int.class);
2750 
2751     /**
2752      * <p>List of tonemapping modes for {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} that are supported by this camera
2753      * device.</p>
2754      * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always contain
2755      * at least one of below mode combinations:</p>
2756      * <ul>
2757      * <li>CONTRAST_CURVE, FAST and HIGH_QUALITY</li>
2758      * <li>GAMMA_VALUE, PRESET_CURVE, FAST and HIGH_QUALITY</li>
2759      * </ul>
2760      * <p>This includes all FULL level devices.</p>
2761      * <p><b>Range of valid values:</b><br>
2762      * Any value listed in {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}</p>
2763      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2764      * <p><b>Full capability</b> -
2765      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2766      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2767      *
2768      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2769      * @see CaptureRequest#TONEMAP_MODE
2770      */
2771     @PublicKey
2772     public static final Key<int[]> TONEMAP_AVAILABLE_TONE_MAP_MODES =
2773             new Key<int[]>("android.tonemap.availableToneMapModes", int[].class);
2774 
2775     /**
2776      * <p>A list of camera LEDs that are available on this system.</p>
2777      * <p><b>Possible values:</b>
2778      * <ul>
2779      *   <li>{@link #LED_AVAILABLE_LEDS_TRANSMIT TRANSMIT}</li>
2780      * </ul></p>
2781      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2782      * @see #LED_AVAILABLE_LEDS_TRANSMIT
2783      * @hide
2784      */
2785     public static final Key<int[]> LED_AVAILABLE_LEDS =
2786             new Key<int[]>("android.led.availableLeds", int[].class);
2787 
2788     /**
2789      * <p>Generally classifies the overall set of the camera device functionality.</p>
2790      * <p>The supported hardware level is a high-level description of the camera device's
2791      * capabilities, summarizing several capabilities into one field.  Each level adds additional
2792      * features to the previous one, and is always a strict superset of the previous level.
2793      * The ordering is <code>LEGACY &lt; LIMITED &lt; FULL &lt; LEVEL_3</code>.</p>
2794      * <p>Starting from <code>LEVEL_3</code>, the level enumerations are guaranteed to be in increasing
2795      * numerical value as well. To check if a given device is at least at a given hardware level,
2796      * the following code snippet can be used:</p>
2797      * <pre><code>// Returns true if the device supports the required hardware level, or better.
2798      * boolean isHardwareLevelSupported(CameraCharacteristics c, int requiredLevel) {
2799      *     int deviceLevel = c.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL);
2800      *     if (deviceLevel == CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY) {
2801      *         return requiredLevel == deviceLevel;
2802      *     }
2803      *     // deviceLevel is not LEGACY, can use numerical sort
2804      *     return requiredLevel &lt;= deviceLevel;
2805      * }
2806      * </code></pre>
2807      * <p>At a high level, the levels are:</p>
2808      * <ul>
2809      * <li><code>LEGACY</code> devices operate in a backwards-compatibility mode for older
2810      *   Android devices, and have very limited capabilities.</li>
2811      * <li><code>LIMITED</code> devices represent the
2812      *   baseline feature set, and may also include additional capabilities that are
2813      *   subsets of <code>FULL</code>.</li>
2814      * <li><code>FULL</code> devices additionally support per-frame manual control of sensor, flash, lens and
2815      *   post-processing settings, and image capture at a high rate.</li>
2816      * <li><code>LEVEL_3</code> devices additionally support YUV reprocessing and RAW image capture, along
2817      *   with additional output stream configurations.</li>
2818      * </ul>
2819      * <p>See the individual level enums for full descriptions of the supported capabilities.  The
2820      * {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} entry describes the device's capabilities at a
2821      * finer-grain level, if needed. In addition, many controls have their available settings or
2822      * ranges defined in individual {@link android.hardware.camera2.CameraCharacteristics } entries.</p>
2823      * <p>Some features are not part of any particular hardware level or capability and must be
2824      * queried separately. These include:</p>
2825      * <ul>
2826      * <li>Calibrated timestamps ({@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME)</li>
2827      * <li>Precision lens control ({@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} <code>==</code> CALIBRATED)</li>
2828      * <li>Face detection ({@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes})</li>
2829      * <li>Optical or electrical image stabilization
2830      *   ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization},
2831      *    {@link CameraCharacteristics#CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES android.control.availableVideoStabilizationModes})</li>
2832      * </ul>
2833      * <p><b>Possible values:</b>
2834      * <ul>
2835      *   <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED}</li>
2836      *   <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL}</li>
2837      *   <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY LEGACY}</li>
2838      *   <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_3 3}</li>
2839      * </ul></p>
2840      * <p>This key is available on all devices.</p>
2841      *
2842      * @see CameraCharacteristics#CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES
2843      * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
2844      * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
2845      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
2846      * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
2847      * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
2848      * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED
2849      * @see #INFO_SUPPORTED_HARDWARE_LEVEL_FULL
2850      * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY
2851      * @see #INFO_SUPPORTED_HARDWARE_LEVEL_3
2852      */
2853     @PublicKey
2854     public static final Key<Integer> INFO_SUPPORTED_HARDWARE_LEVEL =
2855             new Key<Integer>("android.info.supportedHardwareLevel", int.class);
2856 
2857     /**
2858      * <p>The maximum number of frames that can occur after a request
2859      * (different than the previous) has been submitted, and before the
2860      * result's state becomes synchronized.</p>
2861      * <p>This defines the maximum distance (in number of metadata results),
2862      * between the frame number of the request that has new controls to apply
2863      * and the frame number of the result that has all the controls applied.</p>
2864      * <p>In other words this acts as an upper boundary for how many frames
2865      * must occur before the camera device knows for a fact that the new
2866      * submitted camera settings have been applied in outgoing frames.</p>
2867      * <p><b>Units</b>: Frame counts</p>
2868      * <p><b>Possible values:</b>
2869      * <ul>
2870      *   <li>{@link #SYNC_MAX_LATENCY_PER_FRAME_CONTROL PER_FRAME_CONTROL}</li>
2871      *   <li>{@link #SYNC_MAX_LATENCY_UNKNOWN UNKNOWN}</li>
2872      * </ul></p>
2873      * <p><b>Available values for this device:</b><br>
2874      * A positive value, PER_FRAME_CONTROL, or UNKNOWN.</p>
2875      * <p>This key is available on all devices.</p>
2876      * @see #SYNC_MAX_LATENCY_PER_FRAME_CONTROL
2877      * @see #SYNC_MAX_LATENCY_UNKNOWN
2878      */
2879     @PublicKey
2880     public static final Key<Integer> SYNC_MAX_LATENCY =
2881             new Key<Integer>("android.sync.maxLatency", int.class);
2882 
2883     /**
2884      * <p>The maximal camera capture pipeline stall (in unit of frame count) introduced by a
2885      * reprocess capture request.</p>
2886      * <p>The key describes the maximal interference that one reprocess (input) request
2887      * can introduce to the camera simultaneous streaming of regular (output) capture
2888      * requests, including repeating requests.</p>
2889      * <p>When a reprocessing capture request is submitted while a camera output repeating request
2890      * (e.g. preview) is being served by the camera device, it may preempt the camera capture
2891      * pipeline for at least one frame duration so that the camera device is unable to process
2892      * the following capture request in time for the next sensor start of exposure boundary.
2893      * When this happens, the application may observe a capture time gap (longer than one frame
2894      * duration) between adjacent capture output frames, which usually exhibits as preview
2895      * glitch if the repeating request output targets include a preview surface. This key gives
2896      * the worst-case number of frame stall introduced by one reprocess request with any kind of
2897      * formats/sizes combination.</p>
2898      * <p>If this key reports 0, it means a reprocess request doesn't introduce any glitch to the
2899      * ongoing camera repeating request outputs, as if this reprocess request is never issued.</p>
2900      * <p>This key is supported if the camera device supports PRIVATE or YUV reprocessing (
2901      * i.e. {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains PRIVATE_REPROCESSING or
2902      * YUV_REPROCESSING).</p>
2903      * <p><b>Units</b>: Number of frames.</p>
2904      * <p><b>Range of valid values:</b><br>
2905      * &lt;= 4</p>
2906      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2907      * <p><b>Limited capability</b> -
2908      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2909      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2910      *
2911      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2912      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
2913      */
2914     @PublicKey
2915     public static final Key<Integer> REPROCESS_MAX_CAPTURE_STALL =
2916             new Key<Integer>("android.reprocess.maxCaptureStall", int.class);
2917 
2918     /**
2919      * <p>The available depth dataspace stream
2920      * configurations that this camera device supports
2921      * (i.e. format, width, height, output/input stream).</p>
2922      * <p>These are output stream configurations for use with
2923      * dataSpace HAL_DATASPACE_DEPTH. The configurations are
2924      * listed as <code>(format, width, height, input?)</code> tuples.</p>
2925      * <p>Only devices that support depth output for at least
2926      * the HAL_PIXEL_FORMAT_Y16 dense depth map may include
2927      * this entry.</p>
2928      * <p>A device that also supports the HAL_PIXEL_FORMAT_BLOB
2929      * sparse depth point cloud must report a single entry for
2930      * the format in this list as <code>(HAL_PIXEL_FORMAT_BLOB,
2931      * android.depth.maxDepthSamples, 1, OUTPUT)</code> in addition to
2932      * the entries for HAL_PIXEL_FORMAT_Y16.</p>
2933      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2934      * <p><b>Limited capability</b> -
2935      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2936      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2937      *
2938      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2939      * @hide
2940      */
2941     public static final Key<android.hardware.camera2.params.StreamConfiguration[]> DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS =
2942             new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.depth.availableDepthStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
2943 
2944     /**
2945      * <p>This lists the minimum frame duration for each
2946      * format/size combination for depth output formats.</p>
2947      * <p>This should correspond to the frame duration when only that
2948      * stream is active, with all processing (typically in android.*.mode)
2949      * set to either OFF or FAST.</p>
2950      * <p>When multiple streams are used in a request, the minimum frame
2951      * duration will be max(individual stream min durations).</p>
2952      * <p>The minimum frame duration of a stream (of a particular format, size)
2953      * is the same regardless of whether the stream is input or output.</p>
2954      * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
2955      * android.scaler.availableStallDurations for more details about
2956      * calculating the max frame rate.</p>
2957      * <p>(Keep in sync with {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration })</p>
2958      * <p><b>Units</b>: (format, width, height, ns) x n</p>
2959      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2960      * <p><b>Limited capability</b> -
2961      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2962      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2963      *
2964      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2965      * @see CaptureRequest#SENSOR_FRAME_DURATION
2966      * @hide
2967      */
2968     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS =
2969             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDepthMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
2970 
2971     /**
2972      * <p>This lists the maximum stall duration for each
2973      * output format/size combination for depth streams.</p>
2974      * <p>A stall duration is how much extra time would get added
2975      * to the normal minimum frame duration for a repeating request
2976      * that has streams with non-zero stall.</p>
2977      * <p>This functions similarly to
2978      * android.scaler.availableStallDurations for depth
2979      * streams.</p>
2980      * <p>All depth output stream formats may have a nonzero stall
2981      * duration.</p>
2982      * <p><b>Units</b>: (format, width, height, ns) x n</p>
2983      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2984      * <p><b>Limited capability</b> -
2985      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2986      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2987      *
2988      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2989      * @hide
2990      */
2991     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS =
2992             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDepthStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
2993 
2994     /**
2995      * <p>Indicates whether a capture request may target both a
2996      * DEPTH16 / DEPTH_POINT_CLOUD output, and normal color outputs (such as
2997      * YUV_420_888, JPEG, or RAW) simultaneously.</p>
2998      * <p>If TRUE, including both depth and color outputs in a single
2999      * capture request is not supported. An application must interleave color
3000      * and depth requests.  If FALSE, a single request can target both types
3001      * of output.</p>
3002      * <p>Typically, this restriction exists on camera devices that
3003      * need to emit a specific pattern or wavelength of light to
3004      * measure depth values, which causes the color image to be
3005      * corrupted during depth measurement.</p>
3006      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3007      * <p><b>Limited capability</b> -
3008      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3009      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3010      *
3011      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3012      */
3013     @PublicKey
3014     public static final Key<Boolean> DEPTH_DEPTH_IS_EXCLUSIVE =
3015             new Key<Boolean>("android.depth.depthIsExclusive", boolean.class);
3016 
3017     /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
3018      * End generated code
3019      *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
3020 
3021 
3022 
3023 }
3024