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.compat.annotation.UnsupportedAppUsage;
22 import android.hardware.camera2.impl.CameraMetadataNative;
23 import android.hardware.camera2.impl.PublicKey;
24 import android.hardware.camera2.impl.SyntheticKey;
25 import android.hardware.camera2.params.RecommendedStreamConfigurationMap;
26 import android.hardware.camera2.params.SessionConfiguration;
27 import android.hardware.camera2.utils.ArrayUtils;
28 import android.hardware.camera2.utils.TypeReference;
29 import android.util.Rational;
30 
31 import java.util.ArrayList;
32 import java.util.Arrays;
33 import java.util.Collections;
34 import java.util.HashSet;
35 import java.util.List;
36 import java.util.Set;
37 
38 /**
39  * <p>The properties describing a
40  * {@link CameraDevice CameraDevice}.</p>
41  *
42  * <p>These properties are fixed for a given CameraDevice, and can be queried
43  * through the {@link CameraManager CameraManager}
44  * interface with {@link CameraManager#getCameraCharacteristics}.</p>
45  *
46  * <p>{@link CameraCharacteristics} objects are immutable.</p>
47  *
48  * @see CameraDevice
49  * @see CameraManager
50  */
51 public final class CameraCharacteristics extends CameraMetadata<CameraCharacteristics.Key<?>> {
52 
53     /**
54      * A {@code Key} is used to do camera characteristics field lookups with
55      * {@link CameraCharacteristics#get}.
56      *
57      * <p>For example, to get the stream configuration map:
58      * <code><pre>
59      * StreamConfigurationMap map = cameraCharacteristics.get(
60      *      CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
61      * </pre></code>
62      * </p>
63      *
64      * <p>To enumerate over all possible keys for {@link CameraCharacteristics}, see
65      * {@link CameraCharacteristics#getKeys()}.</p>
66      *
67      * @see CameraCharacteristics#get
68      * @see CameraCharacteristics#getKeys()
69      */
70     public static final class Key<T> {
71         private final CameraMetadataNative.Key<T> mKey;
72 
73         /**
74          * Visible for testing and vendor extensions only.
75          *
76          * @hide
77          */
78         @UnsupportedAppUsage
Key(String name, Class<T> type, long vendorId)79         public Key(String name, Class<T> type, long vendorId) {
80             mKey = new CameraMetadataNative.Key<T>(name,  type, vendorId);
81         }
82 
83         /**
84          * Visible for testing and vendor extensions only.
85          *
86          * @hide
87          */
Key(String name, String fallbackName, Class<T> type)88         public Key(String name, String fallbackName, Class<T> type) {
89             mKey = new CameraMetadataNative.Key<T>(name,  fallbackName, type);
90         }
91 
92         /**
93          * Construct a new Key with a given name and type.
94          *
95          * <p>Normally, applications should use the existing Key definitions in
96          * {@link CameraCharacteristics}, and not need to construct their own Key objects. However,
97          * they may be useful for testing purposes and for defining custom camera
98          * characteristics.</p>
99          */
Key(@onNull String name, @NonNull Class<T> type)100         public Key(@NonNull String name, @NonNull Class<T> type) {
101             mKey = new CameraMetadataNative.Key<T>(name,  type);
102         }
103 
104         /**
105          * Visible for testing and vendor extensions only.
106          *
107          * @hide
108          */
109         @UnsupportedAppUsage
Key(String name, TypeReference<T> typeReference)110         public Key(String name, TypeReference<T> typeReference) {
111             mKey = new CameraMetadataNative.Key<T>(name,  typeReference);
112         }
113 
114         /**
115          * Return a camelCase, period separated name formatted like:
116          * {@code "root.section[.subsections].name"}.
117          *
118          * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
119          * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
120          *
121          * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
122          * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
123          * specific key might look like {@code "com.google.nexus.data.private"}.</p>
124          *
125          * @return String representation of the key name
126          */
127         @NonNull
getName()128         public String getName() {
129             return mKey.getName();
130         }
131 
132         /**
133          * Return vendor tag id.
134          *
135          * @hide
136          */
getVendorId()137         public long getVendorId() {
138             return mKey.getVendorId();
139         }
140 
141         /**
142          * {@inheritDoc}
143          */
144         @Override
hashCode()145         public final int hashCode() {
146             return mKey.hashCode();
147         }
148 
149         /**
150          * {@inheritDoc}
151          */
152         @SuppressWarnings("unchecked")
153         @Override
equals(Object o)154         public final boolean equals(Object o) {
155             return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
156         }
157 
158         /**
159          * Return this {@link Key} as a string representation.
160          *
161          * <p>{@code "CameraCharacteristics.Key(%s)"}, where {@code %s} represents
162          * the name of this key as returned by {@link #getName}.</p>
163          *
164          * @return string representation of {@link Key}
165          */
166         @NonNull
167         @Override
toString()168         public String toString() {
169             return String.format("CameraCharacteristics.Key(%s)", mKey.getName());
170         }
171 
172         /**
173          * Visible for CameraMetadataNative implementation only; do not use.
174          *
175          * TODO: Make this private or remove it altogether.
176          *
177          * @hide
178          */
179         @UnsupportedAppUsage
getNativeKey()180         public CameraMetadataNative.Key<T> getNativeKey() {
181             return mKey;
182         }
183 
184         @SuppressWarnings({
185                 "unused", "unchecked"
186         })
Key(CameraMetadataNative.Key<?> nativeKey)187         private Key(CameraMetadataNative.Key<?> nativeKey) {
188             mKey = (CameraMetadataNative.Key<T>) nativeKey;
189         }
190     }
191 
192     @UnsupportedAppUsage
193     private final CameraMetadataNative mProperties;
194     private List<CameraCharacteristics.Key<?>> mKeys;
195     private List<CameraCharacteristics.Key<?>> mKeysNeedingPermission;
196     private List<CaptureRequest.Key<?>> mAvailableRequestKeys;
197     private List<CaptureRequest.Key<?>> mAvailableSessionKeys;
198     private List<CaptureRequest.Key<?>> mAvailablePhysicalRequestKeys;
199     private List<CaptureResult.Key<?>> mAvailableResultKeys;
200     private ArrayList<RecommendedStreamConfigurationMap> mRecommendedConfigurations;
201 
202     /**
203      * Takes ownership of the passed-in properties object
204      * @hide
205      */
CameraCharacteristics(CameraMetadataNative properties)206     public CameraCharacteristics(CameraMetadataNative properties) {
207         mProperties = CameraMetadataNative.move(properties);
208         setNativeInstance(mProperties);
209     }
210 
211     /**
212      * Returns a copy of the underlying {@link CameraMetadataNative}.
213      * @hide
214      */
getNativeCopy()215     public CameraMetadataNative getNativeCopy() {
216         return new CameraMetadataNative(mProperties);
217     }
218 
219     /**
220      * Get a camera characteristics field value.
221      *
222      * <p>The field definitions can be
223      * found in {@link CameraCharacteristics}.</p>
224      *
225      * <p>Querying the value for the same key more than once will return a value
226      * which is equal to the previous queried value.</p>
227      *
228      * @throws IllegalArgumentException if the key was not valid
229      *
230      * @param key The characteristics field to read.
231      * @return The value of that key, or {@code null} if the field is not set.
232      */
233     @Nullable
get(Key<T> key)234     public <T> T get(Key<T> key) {
235         return mProperties.get(key);
236     }
237 
238     /**
239      * {@inheritDoc}
240      * @hide
241      */
242     @SuppressWarnings("unchecked")
243     @Override
getProtected(Key<?> key)244     protected <T> T getProtected(Key<?> key) {
245         return (T) mProperties.get(key);
246     }
247 
248     /**
249      * {@inheritDoc}
250      * @hide
251      */
252     @SuppressWarnings("unchecked")
253     @Override
getKeyClass()254     protected Class<Key<?>> getKeyClass() {
255         Object thisClass = Key.class;
256         return (Class<Key<?>>)thisClass;
257     }
258 
259     /**
260      * {@inheritDoc}
261      */
262     @NonNull
263     @Override
getKeys()264     public List<Key<?>> getKeys() {
265         // List of keys is immutable; cache the results after we calculate them
266         if (mKeys != null) {
267             return mKeys;
268         }
269 
270         int[] filterTags = get(REQUEST_AVAILABLE_CHARACTERISTICS_KEYS);
271         if (filterTags == null) {
272             throw new AssertionError("android.request.availableCharacteristicsKeys must be non-null"
273                     + " in the characteristics");
274         }
275 
276         mKeys = Collections.unmodifiableList(
277                 getKeys(getClass(), getKeyClass(), this, filterTags, true));
278         return mKeys;
279     }
280 
281     /**
282      * <p>Returns a subset of the list returned by {@link #getKeys} with all keys that
283      * require camera clients to obtain the {@link android.Manifest.permission#CAMERA} permission.
284      * </p>
285      *
286      * <p>If an application calls {@link CameraManager#getCameraCharacteristics} without holding the
287      * {@link android.Manifest.permission#CAMERA} permission,
288      * all keys in this list will not be available, and calling {@link #get} will
289      * return null for those keys. If the application obtains the
290      * {@link android.Manifest.permission#CAMERA} permission, then the
291      * CameraCharacteristics from a call to a subsequent
292      * {@link CameraManager#getCameraCharacteristics} will have the keys available.</p>
293      *
294      * <p>The list returned is not modifiable, so any attempts to modify it will throw
295      * a {@code UnsupportedOperationException}.</p>
296      *
297      * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
298      *
299      * @return List of camera characteristic keys that require the
300      *         {@link android.Manifest.permission#CAMERA} permission. The list can be empty in case
301      *         there are no currently present keys that need additional permission.
302      */
getKeysNeedingPermission()303     public @NonNull List<Key<?>> getKeysNeedingPermission() {
304         if (mKeysNeedingPermission == null) {
305             Object crKey = CameraCharacteristics.Key.class;
306             Class<CameraCharacteristics.Key<?>> crKeyTyped =
307                 (Class<CameraCharacteristics.Key<?>>)crKey;
308 
309             int[] filterTags = get(REQUEST_CHARACTERISTIC_KEYS_NEEDING_PERMISSION);
310             if (filterTags == null) {
311                 mKeysNeedingPermission = Collections.unmodifiableList(
312                         new ArrayList<CameraCharacteristics.Key<?>> ());
313                 return mKeysNeedingPermission;
314             }
315             mKeysNeedingPermission =
316                 getAvailableKeyList(CameraCharacteristics.class, crKeyTyped, filterTags,
317                         /*includeSynthetic*/ false);
318         }
319         return mKeysNeedingPermission;
320     }
321 
322     /**
323      * <p>Retrieve camera device recommended stream configuration map
324      * {@link RecommendedStreamConfigurationMap} for a given use case.</p>
325      *
326      * <p>The stream configurations advertised here are efficient in terms of power and performance
327      * for common use cases like preview, video, snapshot, etc. The recommended maps are usually
328      * only small subsets of the exhaustive list provided in
329      * {@link #SCALER_STREAM_CONFIGURATION_MAP} and suggested for a particular use case by the
330      * camera device implementation. For further information about the expected configurations in
331      * various scenarios please refer to:
332      * <ul>
333      * <li>{@link RecommendedStreamConfigurationMap#USECASE_PREVIEW}</li>
334      * <li>{@link RecommendedStreamConfigurationMap#USECASE_RECORD}</li>
335      * <li>{@link RecommendedStreamConfigurationMap#USECASE_VIDEO_SNAPSHOT}</li>
336      * <li>{@link RecommendedStreamConfigurationMap#USECASE_SNAPSHOT}</li>
337      * <li>{@link RecommendedStreamConfigurationMap#USECASE_RAW}</li>
338      * <li>{@link RecommendedStreamConfigurationMap#USECASE_ZSL}</li>
339      * <li>{@link RecommendedStreamConfigurationMap#USECASE_LOW_LATENCY_SNAPSHOT}</li>
340      * </ul>
341      * </p>
342      *
343      * <p>For example on how this can be used by camera clients to find out the maximum recommended
344      * preview and snapshot resolution, consider the following pseudo-code:
345      * </p>
346      * <pre><code>
347      * public static Size getMaxSize(Size... sizes) {
348      *     if (sizes == null || sizes.length == 0) {
349      *         throw new IllegalArgumentException("sizes was empty");
350      *     }
351      *
352      *     Size sz = sizes[0];
353      *     for (Size size : sizes) {
354      *         if (size.getWidth() * size.getHeight() &gt; sz.getWidth() * sz.getHeight()) {
355      *             sz = size;
356      *         }
357      *     }
358      *
359      *     return sz;
360      * }
361      *
362      * CameraCharacteristics characteristics =
363      *         cameraManager.getCameraCharacteristics(cameraId);
364      * RecommendedStreamConfigurationMap previewConfig =
365      *         characteristics.getRecommendedStreamConfigurationMap(
366      *                  RecommendedStreamConfigurationMap.USECASE_PREVIEW);
367      * RecommendedStreamConfigurationMap snapshotConfig =
368      *         characteristics.getRecommendedStreamConfigurationMap(
369      *                  RecommendedStreamConfigurationMap.USECASE_SNAPSHOT);
370      *
371      * if ((previewConfig != null) &amp;&amp; (snapshotConfig != null)) {
372      *
373      *      Set<Size> snapshotSizeSet = snapshotConfig.getOutputSizes(
374      *              ImageFormat.JPEG);
375      *      Size[] snapshotSizes = new Size[snapshotSizeSet.size()];
376      *      snapshotSizes = snapshotSizeSet.toArray(snapshotSizes);
377      *      Size suggestedMaxJpegSize = getMaxSize(snapshotSizes);
378      *
379      *      Set<Size> previewSizeSet = snapshotConfig.getOutputSizes(
380      *              ImageFormat.PRIVATE);
381      *      Size[] previewSizes = new Size[previewSizeSet.size()];
382      *      previewSizes = previewSizeSet.toArray(previewSizes);
383      *      Size suggestedMaxPreviewSize = getMaxSize(previewSizes);
384      * }
385      *
386      * </code></pre>
387      *
388      * <p>Similar logic can be used for other use cases as well.</p>
389      *
390      * <p>Support for recommended stream configurations is optional. In case there a no
391      * suggested configurations for the particular use case, please refer to
392      * {@link #SCALER_STREAM_CONFIGURATION_MAP} for the exhaustive available list.</p>
393      *
394      * @param usecase Use case id.
395      *
396      * @throws IllegalArgumentException In case the use case argument is invalid.
397      * @return Valid {@link RecommendedStreamConfigurationMap} or null in case the camera device
398      *         doesn't have any recommendation for this use case or the recommended configurations
399      *         are invalid.
400      */
getRecommendedStreamConfigurationMap( @ecommendedStreamConfigurationMap.RecommendedUsecase int usecase)401     public @Nullable RecommendedStreamConfigurationMap getRecommendedStreamConfigurationMap(
402             @RecommendedStreamConfigurationMap.RecommendedUsecase int usecase) {
403         if (((usecase >= RecommendedStreamConfigurationMap.USECASE_PREVIEW) &&
404                 (usecase <= RecommendedStreamConfigurationMap.USECASE_LOW_LATENCY_SNAPSHOT)) ||
405                 ((usecase >= RecommendedStreamConfigurationMap.USECASE_VENDOR_START) &&
406                 (usecase < RecommendedStreamConfigurationMap.MAX_USECASE_COUNT))) {
407             if (mRecommendedConfigurations == null) {
408                 mRecommendedConfigurations = mProperties.getRecommendedStreamConfigurations();
409                 if (mRecommendedConfigurations == null) {
410                     return null;
411                 }
412             }
413 
414             return mRecommendedConfigurations.get(usecase);
415         }
416 
417         throw new IllegalArgumentException(String.format("Invalid use case: %d", usecase));
418     }
419 
420     /**
421      * <p>Returns a subset of {@link #getAvailableCaptureRequestKeys} keys that the
422      * camera device can pass as part of the capture session initialization.</p>
423      *
424      * <p>This list includes keys that are difficult to apply per-frame and
425      * can result in unexpected delays when modified during the capture session
426      * lifetime. Typical examples include parameters that require a
427      * time-consuming hardware re-configuration or internal camera pipeline
428      * change. For performance reasons we suggest clients to pass their initial
429      * values as part of {@link SessionConfiguration#setSessionParameters}. Once
430      * the camera capture session is enabled it is also recommended to avoid
431      * changing them from their initial values set in
432      * {@link SessionConfiguration#setSessionParameters }.
433      * Control over session parameters can still be exerted in capture requests
434      * but clients should be aware and expect delays during their application.
435      * An example usage scenario could look like this:</p>
436      * <ul>
437      * <li>The camera client starts by querying the session parameter key list via
438      *   {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys }.</li>
439      * <li>Before triggering the capture session create sequence, a capture request
440      *   must be built via {@link CameraDevice#createCaptureRequest } using an
441      *   appropriate template matching the particular use case.</li>
442      * <li>The client should go over the list of session parameters and check
443      *   whether some of the keys listed matches with the parameters that
444      *   they intend to modify as part of the first capture request.</li>
445      * <li>If there is no such match, the capture request can be  passed
446      *   unmodified to {@link SessionConfiguration#setSessionParameters }.</li>
447      * <li>If matches do exist, the client should update the respective values
448      *   and pass the request to {@link SessionConfiguration#setSessionParameters }.</li>
449      * <li>After the capture session initialization completes the session parameter
450      *   key list can continue to serve as reference when posting or updating
451      *   further requests. As mentioned above further changes to session
452      *   parameters should ideally be avoided, if updates are necessary
453      *   however clients could expect a delay/glitch during the
454      *   parameter switch.</li>
455      * </ul>
456      *
457      * <p>The list returned is not modifiable, so any attempts to modify it will throw
458      * a {@code UnsupportedOperationException}.</p>
459      *
460      * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
461      *
462      * @return List of keys that can be passed during capture session initialization. In case the
463      * camera device doesn't support such keys the list can be null.
464      */
465     @SuppressWarnings({"unchecked"})
getAvailableSessionKeys()466     public List<CaptureRequest.Key<?>> getAvailableSessionKeys() {
467         if (mAvailableSessionKeys == null) {
468             Object crKey = CaptureRequest.Key.class;
469             Class<CaptureRequest.Key<?>> crKeyTyped = (Class<CaptureRequest.Key<?>>)crKey;
470 
471             int[] filterTags = get(REQUEST_AVAILABLE_SESSION_KEYS);
472             if (filterTags == null) {
473                 return null;
474             }
475             mAvailableSessionKeys =
476                     getAvailableKeyList(CaptureRequest.class, crKeyTyped, filterTags,
477                             /*includeSynthetic*/ false);
478         }
479         return mAvailableSessionKeys;
480     }
481 
482     /**
483      * <p>Returns a subset of {@link #getAvailableCaptureRequestKeys} keys that can
484      * be overridden for physical devices backing a logical multi-camera.</p>
485      *
486      * <p>This is a subset of android.request.availableRequestKeys which contains a list
487      * of keys that can be overridden using {@link CaptureRequest.Builder#setPhysicalCameraKey }.
488      * The respective value of such request key can be obtained by calling
489      * {@link CaptureRequest.Builder#getPhysicalCameraKey }. Capture requests that contain
490      * individual physical device requests must be built via
491      * {@link android.hardware.camera2.CameraDevice#createCaptureRequest(int, Set)}.
492      * Such extended capture requests can be passed only to
493      * {@link CameraCaptureSession#capture } or {@link CameraCaptureSession#captureBurst } and
494      * not to {@link CameraCaptureSession#setRepeatingRequest } or
495      * {@link CameraCaptureSession#setRepeatingBurst }.</p>
496      *
497      * <p>The list returned is not modifiable, so any attempts to modify it will throw
498      * a {@code UnsupportedOperationException}.</p>
499      *
500      * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
501      *
502      * @return List of keys that can be overridden in individual physical device requests.
503      * In case the camera device doesn't support such keys the list can be null.
504      */
505     @SuppressWarnings({"unchecked"})
getAvailablePhysicalCameraRequestKeys()506     public List<CaptureRequest.Key<?>> getAvailablePhysicalCameraRequestKeys() {
507         if (mAvailablePhysicalRequestKeys == null) {
508             Object crKey = CaptureRequest.Key.class;
509             Class<CaptureRequest.Key<?>> crKeyTyped = (Class<CaptureRequest.Key<?>>)crKey;
510 
511             int[] filterTags = get(REQUEST_AVAILABLE_PHYSICAL_CAMERA_REQUEST_KEYS);
512             if (filterTags == null) {
513                 return null;
514             }
515             mAvailablePhysicalRequestKeys =
516                     getAvailableKeyList(CaptureRequest.class, crKeyTyped, filterTags,
517                             /*includeSynthetic*/ false);
518         }
519         return mAvailablePhysicalRequestKeys;
520     }
521 
522     /**
523      * Returns the list of keys supported by this {@link CameraDevice} for querying
524      * with a {@link CaptureRequest}.
525      *
526      * <p>The list returned is not modifiable, so any attempts to modify it will throw
527      * a {@code UnsupportedOperationException}.</p>
528      *
529      * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
530      *
531      * <p>Note that there is no {@code getAvailableCameraCharacteristicsKeys()} -- use
532      * {@link #getKeys()} instead.</p>
533      *
534      * @return List of keys supported by this CameraDevice for CaptureRequests.
535      */
536     @SuppressWarnings({"unchecked"})
537     @NonNull
getAvailableCaptureRequestKeys()538     public List<CaptureRequest.Key<?>> getAvailableCaptureRequestKeys() {
539         if (mAvailableRequestKeys == null) {
540             Object crKey = CaptureRequest.Key.class;
541             Class<CaptureRequest.Key<?>> crKeyTyped = (Class<CaptureRequest.Key<?>>)crKey;
542 
543             int[] filterTags = get(REQUEST_AVAILABLE_REQUEST_KEYS);
544             if (filterTags == null) {
545                 throw new AssertionError("android.request.availableRequestKeys must be non-null "
546                         + "in the characteristics");
547             }
548             mAvailableRequestKeys =
549                     getAvailableKeyList(CaptureRequest.class, crKeyTyped, filterTags,
550                             /*includeSynthetic*/ true);
551         }
552         return mAvailableRequestKeys;
553     }
554 
555     /**
556      * Returns the list of keys supported by this {@link CameraDevice} for querying
557      * with a {@link CaptureResult}.
558      *
559      * <p>The list returned is not modifiable, so any attempts to modify it will throw
560      * a {@code UnsupportedOperationException}.</p>
561      *
562      * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
563      *
564      * <p>Note that there is no {@code getAvailableCameraCharacteristicsKeys()} -- use
565      * {@link #getKeys()} instead.</p>
566      *
567      * @return List of keys supported by this CameraDevice for CaptureResults.
568      */
569     @SuppressWarnings({"unchecked"})
570     @NonNull
getAvailableCaptureResultKeys()571     public List<CaptureResult.Key<?>> getAvailableCaptureResultKeys() {
572         if (mAvailableResultKeys == null) {
573             Object crKey = CaptureResult.Key.class;
574             Class<CaptureResult.Key<?>> crKeyTyped = (Class<CaptureResult.Key<?>>)crKey;
575 
576             int[] filterTags = get(REQUEST_AVAILABLE_RESULT_KEYS);
577             if (filterTags == null) {
578                 throw new AssertionError("android.request.availableResultKeys must be non-null "
579                         + "in the characteristics");
580             }
581             mAvailableResultKeys = getAvailableKeyList(CaptureResult.class, crKeyTyped, filterTags,
582                     /*includeSynthetic*/ true);
583         }
584         return mAvailableResultKeys;
585     }
586 
587     /**
588      * Returns the list of keys supported by this {@link CameraDevice} by metadataClass.
589      *
590      * <p>The list returned is not modifiable, so any attempts to modify it will throw
591      * a {@code UnsupportedOperationException}.</p>
592      *
593      * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
594      *
595      * @param metadataClass The subclass of CameraMetadata that you want to get the keys for.
596      * @param keyClass The class of the metadata key, e.g. CaptureRequest.Key.class
597      * @param filterTags An array of tags to be used for filtering
598      * @param includeSynthetic Include public syntethic tag by default.
599      *
600      * @return List of keys supported by this CameraDevice for metadataClass.
601      *
602      * @throws IllegalArgumentException if metadataClass is not a subclass of CameraMetadata
603      */
604     private <TKey> List<TKey>
getAvailableKeyList(Class<?> metadataClass, Class<TKey> keyClass, int[] filterTags, boolean includeSynthetic)605     getAvailableKeyList(Class<?> metadataClass, Class<TKey> keyClass, int[] filterTags,
606             boolean includeSynthetic) {
607 
608         if (metadataClass.equals(CameraMetadata.class)) {
609             throw new AssertionError(
610                     "metadataClass must be a strict subclass of CameraMetadata");
611         } else if (!CameraMetadata.class.isAssignableFrom(metadataClass)) {
612             throw new AssertionError(
613                     "metadataClass must be a subclass of CameraMetadata");
614         }
615 
616         List<TKey> staticKeyList = getKeys(
617                 metadataClass, keyClass, /*instance*/null, filterTags, includeSynthetic);
618         return Collections.unmodifiableList(staticKeyList);
619     }
620 
621     /**
622      * Returns the set of physical camera ids that this logical {@link CameraDevice} is
623      * made up of.
624      *
625      * <p>A camera device is a logical camera if it has
626      * REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA capability. If the camera device
627      * doesn't have the capability, the return value will be an empty set. </p>
628      *
629      * <p>Prior to API level 29, all returned IDs are guaranteed to be returned by {@link
630      * CameraManager#getCameraIdList}, and can be opened directly by
631      * {@link CameraManager#openCamera}. Starting from API level 29, for each of the returned ID,
632      * if it's also returned by {@link CameraManager#getCameraIdList}, it can be used as a
633      * standalone camera by {@link CameraManager#openCamera}. Otherwise, the camera ID can only be
634      * used as part of the current logical camera.</p>
635      *
636      * <p>The set returned is not modifiable, so any attempts to modify it will throw
637      * a {@code UnsupportedOperationException}.</p>
638      *
639      * @return Set of physical camera ids for this logical camera device.
640      */
641     @NonNull
getPhysicalCameraIds()642     public Set<String> getPhysicalCameraIds() {
643         int[] availableCapabilities = get(REQUEST_AVAILABLE_CAPABILITIES);
644         if (availableCapabilities == null) {
645             throw new AssertionError("android.request.availableCapabilities must be non-null "
646                         + "in the characteristics");
647         }
648 
649         if (!ArrayUtils.contains(availableCapabilities,
650                 REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA)) {
651             return Collections.emptySet();
652         }
653         byte[] physicalCamIds = get(LOGICAL_MULTI_CAMERA_PHYSICAL_IDS);
654 
655         String physicalCamIdString = null;
656         try {
657             physicalCamIdString = new String(physicalCamIds, "UTF-8");
658         } catch (java.io.UnsupportedEncodingException e) {
659             throw new AssertionError("android.logicalCam.physicalIds must be UTF-8 string");
660         }
661         String[] physicalCameraIdArray = physicalCamIdString.split("\0");
662 
663         return Collections.unmodifiableSet(new HashSet<String>(Arrays.asList(physicalCameraIdArray)));
664     }
665 
666     /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
667      * The key entries below this point are generated from metadata
668      * definitions in /system/media/camera/docs. Do not modify by hand or
669      * modify the comment blocks at the start or end.
670      *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
671 
672     /**
673      * <p>List of aberration correction modes for {@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode} that are
674      * supported by this camera device.</p>
675      * <p>This key lists the valid modes for {@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode}.  If no
676      * aberration correction modes are available for a device, this list will solely include
677      * OFF mode. All camera devices will support either OFF or FAST mode.</p>
678      * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always list
679      * OFF mode. This includes all FULL level devices.</p>
680      * <p>LEGACY devices will always only support FAST mode.</p>
681      * <p><b>Range of valid values:</b><br>
682      * Any value listed in {@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode}</p>
683      * <p>This key is available on all devices.</p>
684      *
685      * @see CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE
686      */
687     @PublicKey
688     @NonNull
689     public static final Key<int[]> COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES =
690             new Key<int[]>("android.colorCorrection.availableAberrationModes", int[].class);
691 
692     /**
693      * <p>List of auto-exposure antibanding modes for {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} that are
694      * supported by this camera device.</p>
695      * <p>Not all of the auto-exposure anti-banding modes may be
696      * supported by a given camera device. This field lists the
697      * valid anti-banding modes that the application may request
698      * for this camera device with the
699      * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} control.</p>
700      * <p><b>Range of valid values:</b><br>
701      * Any value listed in {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode}</p>
702      * <p>This key is available on all devices.</p>
703      *
704      * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
705      */
706     @PublicKey
707     @NonNull
708     public static final Key<int[]> CONTROL_AE_AVAILABLE_ANTIBANDING_MODES =
709             new Key<int[]>("android.control.aeAvailableAntibandingModes", int[].class);
710 
711     /**
712      * <p>List of auto-exposure modes for {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} that are supported by this camera
713      * device.</p>
714      * <p>Not all the auto-exposure modes may be supported by a
715      * given camera device, especially if no flash unit is
716      * available. This entry lists the valid modes for
717      * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} for this camera device.</p>
718      * <p>All camera devices support ON, and all camera devices with flash
719      * units support ON_AUTO_FLASH and ON_ALWAYS_FLASH.</p>
720      * <p>FULL mode camera devices always support OFF mode,
721      * which enables application control of camera exposure time,
722      * sensitivity, and frame duration.</p>
723      * <p>LEGACY mode camera devices never support OFF mode.
724      * LIMITED mode devices support OFF if they support the MANUAL_SENSOR
725      * capability.</p>
726      * <p><b>Range of valid values:</b><br>
727      * Any value listed in {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}</p>
728      * <p>This key is available on all devices.</p>
729      *
730      * @see CaptureRequest#CONTROL_AE_MODE
731      */
732     @PublicKey
733     @NonNull
734     public static final Key<int[]> CONTROL_AE_AVAILABLE_MODES =
735             new Key<int[]>("android.control.aeAvailableModes", int[].class);
736 
737     /**
738      * <p>List of frame rate ranges for {@link CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE android.control.aeTargetFpsRange} supported by
739      * this camera device.</p>
740      * <p>For devices at the LEGACY level or above:</p>
741      * <ul>
742      * <li>
743      * <p>For constant-framerate recording, for each normal
744      * {@link android.media.CamcorderProfile CamcorderProfile}, that is, a
745      * {@link android.media.CamcorderProfile CamcorderProfile} that has
746      * {@link android.media.CamcorderProfile#quality quality} in
747      * the range [{@link android.media.CamcorderProfile#QUALITY_LOW QUALITY_LOW},
748      * {@link android.media.CamcorderProfile#QUALITY_2160P QUALITY_2160P}], if the profile is
749      * supported by the device and has
750      * {@link android.media.CamcorderProfile#videoFrameRate videoFrameRate} <code>x</code>, this list will
751      * always include (<code>x</code>,<code>x</code>).</p>
752      * </li>
753      * <li>
754      * <p>Also, a camera device must either not support any
755      * {@link android.media.CamcorderProfile CamcorderProfile},
756      * or support at least one
757      * normal {@link android.media.CamcorderProfile CamcorderProfile} that has
758      * {@link android.media.CamcorderProfile#videoFrameRate videoFrameRate} <code>x</code> &gt;= 24.</p>
759      * </li>
760      * </ul>
761      * <p>For devices at the LIMITED level or above:</p>
762      * <ul>
763      * <li>For YUV_420_888 burst capture use case, this list will always include (<code>min</code>, <code>max</code>)
764      * and (<code>max</code>, <code>max</code>) where <code>min</code> &lt;= 15 and <code>max</code> = the maximum output frame rate of the
765      * maximum YUV_420_888 output size.</li>
766      * </ul>
767      * <p><b>Units</b>: Frames per second (FPS)</p>
768      * <p>This key is available on all devices.</p>
769      *
770      * @see CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE
771      */
772     @PublicKey
773     @NonNull
774     public static final Key<android.util.Range<Integer>[]> CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES =
775             new Key<android.util.Range<Integer>[]>("android.control.aeAvailableTargetFpsRanges", new TypeReference<android.util.Range<Integer>[]>() {{ }});
776 
777     /**
778      * <p>Maximum and minimum exposure compensation values for
779      * {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation}, in counts of {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep},
780      * that are supported by this camera device.</p>
781      * <p><b>Range of valid values:</b><br></p>
782      * <p>Range [0,0] indicates that exposure compensation is not supported.</p>
783      * <p>For LIMITED and FULL devices, range must follow below requirements if exposure
784      * compensation is supported (<code>range != [0, 0]</code>):</p>
785      * <p><code>Min.exposure compensation * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} &lt;= -2 EV</code></p>
786      * <p><code>Max.exposure compensation * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} &gt;= 2 EV</code></p>
787      * <p>LEGACY devices may support a smaller range than this.</p>
788      * <p>This key is available on all devices.</p>
789      *
790      * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
791      * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
792      */
793     @PublicKey
794     @NonNull
795     public static final Key<android.util.Range<Integer>> CONTROL_AE_COMPENSATION_RANGE =
796             new Key<android.util.Range<Integer>>("android.control.aeCompensationRange", new TypeReference<android.util.Range<Integer>>() {{ }});
797 
798     /**
799      * <p>Smallest step by which the exposure compensation
800      * can be changed.</p>
801      * <p>This is the unit for {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation}. For example, if this key has
802      * 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
803      * that the target EV offset for the auto-exposure routine is -1 EV.</p>
804      * <p>One unit of EV compensation changes the brightness of the captured image by a factor
805      * of two. +1 EV doubles the image brightness, while -1 EV halves the image brightness.</p>
806      * <p><b>Units</b>: Exposure Value (EV)</p>
807      * <p>This key is available on all devices.</p>
808      *
809      * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
810      */
811     @PublicKey
812     @NonNull
813     public static final Key<Rational> CONTROL_AE_COMPENSATION_STEP =
814             new Key<Rational>("android.control.aeCompensationStep", Rational.class);
815 
816     /**
817      * <p>List of auto-focus (AF) modes for {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} that are
818      * supported by this camera device.</p>
819      * <p>Not all the auto-focus modes may be supported by a
820      * given camera device. This entry lists the valid modes for
821      * {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} for this camera device.</p>
822      * <p>All LIMITED and FULL mode camera devices will support OFF mode, and all
823      * camera devices with adjustable focuser units
824      * (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>) will support AUTO mode.</p>
825      * <p>LEGACY devices will support OFF mode only if they support
826      * focusing to infinity (by also setting {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} to
827      * <code>0.0f</code>).</p>
828      * <p><b>Range of valid values:</b><br>
829      * Any value listed in {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}</p>
830      * <p>This key is available on all devices.</p>
831      *
832      * @see CaptureRequest#CONTROL_AF_MODE
833      * @see CaptureRequest#LENS_FOCUS_DISTANCE
834      * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
835      */
836     @PublicKey
837     @NonNull
838     public static final Key<int[]> CONTROL_AF_AVAILABLE_MODES =
839             new Key<int[]>("android.control.afAvailableModes", int[].class);
840 
841     /**
842      * <p>List of color effects for {@link CaptureRequest#CONTROL_EFFECT_MODE android.control.effectMode} that are supported by this camera
843      * device.</p>
844      * <p>This list contains the color effect modes that can be applied to
845      * images produced by the camera device.
846      * Implementations are not expected to be consistent across all devices.
847      * If no color effect modes are available for a device, this will only list
848      * OFF.</p>
849      * <p>A color effect will only be applied if
850      * {@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF.  OFF is always included in this list.</p>
851      * <p>This control has no effect on the operation of other control routines such
852      * as auto-exposure, white balance, or focus.</p>
853      * <p><b>Range of valid values:</b><br>
854      * Any value listed in {@link CaptureRequest#CONTROL_EFFECT_MODE android.control.effectMode}</p>
855      * <p>This key is available on all devices.</p>
856      *
857      * @see CaptureRequest#CONTROL_EFFECT_MODE
858      * @see CaptureRequest#CONTROL_MODE
859      */
860     @PublicKey
861     @NonNull
862     public static final Key<int[]> CONTROL_AVAILABLE_EFFECTS =
863             new Key<int[]>("android.control.availableEffects", int[].class);
864 
865     /**
866      * <p>List of scene modes for {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} that are supported by this camera
867      * device.</p>
868      * <p>This list contains scene modes that can be set for the camera device.
869      * Only scene modes that have been fully implemented for the
870      * camera device may be included here. Implementations are not expected
871      * to be consistent across all devices.</p>
872      * <p>If no scene modes are supported by the camera device, this
873      * will be set to DISABLED. Otherwise DISABLED will not be listed.</p>
874      * <p>FACE_PRIORITY is always listed if face detection is
875      * supported (i.e.<code>{@link CameraCharacteristics#STATISTICS_INFO_MAX_FACE_COUNT android.statistics.info.maxFaceCount} &gt;
876      * 0</code>).</p>
877      * <p><b>Range of valid values:</b><br>
878      * Any value listed in {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode}</p>
879      * <p>This key is available on all devices.</p>
880      *
881      * @see CaptureRequest#CONTROL_SCENE_MODE
882      * @see CameraCharacteristics#STATISTICS_INFO_MAX_FACE_COUNT
883      */
884     @PublicKey
885     @NonNull
886     public static final Key<int[]> CONTROL_AVAILABLE_SCENE_MODES =
887             new Key<int[]>("android.control.availableSceneModes", int[].class);
888 
889     /**
890      * <p>List of video stabilization modes for {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}
891      * that are supported by this camera device.</p>
892      * <p>OFF will always be listed.</p>
893      * <p><b>Range of valid values:</b><br>
894      * Any value listed in {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}</p>
895      * <p>This key is available on all devices.</p>
896      *
897      * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
898      */
899     @PublicKey
900     @NonNull
901     public static final Key<int[]> CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES =
902             new Key<int[]>("android.control.availableVideoStabilizationModes", int[].class);
903 
904     /**
905      * <p>List of auto-white-balance modes for {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} that are supported by this
906      * camera device.</p>
907      * <p>Not all the auto-white-balance modes may be supported by a
908      * given camera device. This entry lists the valid modes for
909      * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} for this camera device.</p>
910      * <p>All camera devices will support ON mode.</p>
911      * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always support OFF
912      * mode, which enables application control of white balance, by using
913      * {@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
914      * mode camera devices.</p>
915      * <p><b>Range of valid values:</b><br>
916      * Any value listed in {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}</p>
917      * <p>This key is available on all devices.</p>
918      *
919      * @see CaptureRequest#COLOR_CORRECTION_GAINS
920      * @see CaptureRequest#COLOR_CORRECTION_MODE
921      * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
922      * @see CaptureRequest#CONTROL_AWB_MODE
923      */
924     @PublicKey
925     @NonNull
926     public static final Key<int[]> CONTROL_AWB_AVAILABLE_MODES =
927             new Key<int[]>("android.control.awbAvailableModes", int[].class);
928 
929     /**
930      * <p>List of the maximum number of regions that can be used for metering in
931      * auto-exposure (AE), auto-white balance (AWB), and auto-focus (AF);
932      * this corresponds to the the maximum number of elements in
933      * {@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}, {@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions},
934      * and {@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}.</p>
935      * <p><b>Range of valid values:</b><br></p>
936      * <p>Value must be &gt;= 0 for each element. For full-capability devices
937      * this value must be &gt;= 1 for AE and AF. The order of the elements is:
938      * <code>(AE, AWB, AF)</code>.</p>
939      * <p>This key is available on all devices.</p>
940      *
941      * @see CaptureRequest#CONTROL_AE_REGIONS
942      * @see CaptureRequest#CONTROL_AF_REGIONS
943      * @see CaptureRequest#CONTROL_AWB_REGIONS
944      * @hide
945      */
946     public static final Key<int[]> CONTROL_MAX_REGIONS =
947             new Key<int[]>("android.control.maxRegions", int[].class);
948 
949     /**
950      * <p>The maximum number of metering regions that can be used by the auto-exposure (AE)
951      * routine.</p>
952      * <p>This corresponds to the the maximum allowed number of elements in
953      * {@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}.</p>
954      * <p><b>Range of valid values:</b><br>
955      * Value will be &gt;= 0. For FULL-capability devices, this
956      * value will be &gt;= 1.</p>
957      * <p>This key is available on all devices.</p>
958      *
959      * @see CaptureRequest#CONTROL_AE_REGIONS
960      */
961     @PublicKey
962     @NonNull
963     @SyntheticKey
964     public static final Key<Integer> CONTROL_MAX_REGIONS_AE =
965             new Key<Integer>("android.control.maxRegionsAe", int.class);
966 
967     /**
968      * <p>The maximum number of metering regions that can be used by the auto-white balance (AWB)
969      * routine.</p>
970      * <p>This corresponds to the the maximum allowed number of elements in
971      * {@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions}.</p>
972      * <p><b>Range of valid values:</b><br>
973      * Value will be &gt;= 0.</p>
974      * <p>This key is available on all devices.</p>
975      *
976      * @see CaptureRequest#CONTROL_AWB_REGIONS
977      */
978     @PublicKey
979     @NonNull
980     @SyntheticKey
981     public static final Key<Integer> CONTROL_MAX_REGIONS_AWB =
982             new Key<Integer>("android.control.maxRegionsAwb", int.class);
983 
984     /**
985      * <p>The maximum number of metering regions that can be used by the auto-focus (AF) routine.</p>
986      * <p>This corresponds to the the maximum allowed number of elements in
987      * {@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}.</p>
988      * <p><b>Range of valid values:</b><br>
989      * Value will be &gt;= 0. For FULL-capability devices, this
990      * value will be &gt;= 1.</p>
991      * <p>This key is available on all devices.</p>
992      *
993      * @see CaptureRequest#CONTROL_AF_REGIONS
994      */
995     @PublicKey
996     @NonNull
997     @SyntheticKey
998     public static final Key<Integer> CONTROL_MAX_REGIONS_AF =
999             new Key<Integer>("android.control.maxRegionsAf", int.class);
1000 
1001     /**
1002      * <p>List of available high speed video size, fps range and max batch size configurations
1003      * supported by the camera device, in the format of (width, height, fps_min, fps_max, batch_size_max).</p>
1004      * <p>When CONSTRAINED_HIGH_SPEED_VIDEO is supported in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities},
1005      * this metadata will list the supported high speed video size, fps range and max batch size
1006      * configurations. All the sizes listed in this configuration will be a subset of the sizes
1007      * reported by {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes }
1008      * for processed non-stalling formats.</p>
1009      * <p>For the high speed video use case, the application must
1010      * select the video size and fps range from this metadata to configure the recording and
1011      * preview streams and setup the recording requests. For example, if the application intends
1012      * to do high speed recording, it can select the maximum size reported by this metadata to
1013      * configure output streams. Once the size is selected, application can filter this metadata
1014      * by selected size and get the supported fps ranges, and use these fps ranges to setup the
1015      * recording requests. Note that for the use case of multiple output streams, application
1016      * must select one unique size from this metadata to use (e.g., preview and recording streams
1017      * must have the same size). Otherwise, the high speed capture session creation will fail.</p>
1018      * <p>The min and max fps will be multiple times of 30fps.</p>
1019      * <p>High speed video streaming extends significant performance pressue to camera hardware,
1020      * to achieve efficient high speed streaming, the camera device may have to aggregate
1021      * multiple frames together and send to camera device for processing where the request
1022      * controls are same for all the frames in this batch. Max batch size indicates
1023      * the max possible number of frames the camera device will group together for this high
1024      * speed stream configuration. This max batch size will be used to generate a high speed
1025      * recording request list by
1026      * {@link android.hardware.camera2.CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList }.
1027      * The max batch size for each configuration will satisfy below conditions:</p>
1028      * <ul>
1029      * <li>Each max batch size will be a divisor of its corresponding fps_max / 30. For example,
1030      * if max_fps is 300, max batch size will only be 1, 2, 5, or 10.</li>
1031      * <li>The camera device may choose smaller internal batch size for each configuration, but
1032      * the actual batch size will be a divisor of max batch size. For example, if the max batch
1033      * size is 8, the actual batch size used by camera device will only be 1, 2, 4, or 8.</li>
1034      * <li>The max batch size in each configuration entry must be no larger than 32.</li>
1035      * </ul>
1036      * <p>The camera device doesn't have to support batch mode to achieve high speed video recording,
1037      * in such case, batch_size_max will be reported as 1 in each configuration entry.</p>
1038      * <p>This fps ranges in this configuration list can only be used to create requests
1039      * that are submitted to a high speed camera capture session created by
1040      * {@link android.hardware.camera2.CameraDevice#createConstrainedHighSpeedCaptureSession }.
1041      * The fps ranges reported in this metadata must not be used to setup capture requests for
1042      * normal capture session, or it will cause request error.</p>
1043      * <p><b>Range of valid values:</b><br></p>
1044      * <p>For each configuration, the fps_max &gt;= 120fps.</p>
1045      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1046      * <p><b>Limited capability</b> -
1047      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1048      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1049      *
1050      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1051      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1052      * @hide
1053      */
1054     public static final Key<android.hardware.camera2.params.HighSpeedVideoConfiguration[]> CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS =
1055             new Key<android.hardware.camera2.params.HighSpeedVideoConfiguration[]>("android.control.availableHighSpeedVideoConfigurations", android.hardware.camera2.params.HighSpeedVideoConfiguration[].class);
1056 
1057     /**
1058      * <p>Whether the camera device supports {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock}</p>
1059      * <p>Devices with MANUAL_SENSOR capability or BURST_CAPTURE capability will always
1060      * list <code>true</code>. This includes FULL devices.</p>
1061      * <p>This key is available on all devices.</p>
1062      *
1063      * @see CaptureRequest#CONTROL_AE_LOCK
1064      */
1065     @PublicKey
1066     @NonNull
1067     public static final Key<Boolean> CONTROL_AE_LOCK_AVAILABLE =
1068             new Key<Boolean>("android.control.aeLockAvailable", boolean.class);
1069 
1070     /**
1071      * <p>Whether the camera device supports {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock}</p>
1072      * <p>Devices with MANUAL_POST_PROCESSING capability or BURST_CAPTURE capability will
1073      * always list <code>true</code>. This includes FULL devices.</p>
1074      * <p>This key is available on all devices.</p>
1075      *
1076      * @see CaptureRequest#CONTROL_AWB_LOCK
1077      */
1078     @PublicKey
1079     @NonNull
1080     public static final Key<Boolean> CONTROL_AWB_LOCK_AVAILABLE =
1081             new Key<Boolean>("android.control.awbLockAvailable", boolean.class);
1082 
1083     /**
1084      * <p>List of control modes for {@link CaptureRequest#CONTROL_MODE android.control.mode} that are supported by this camera
1085      * device.</p>
1086      * <p>This list contains control modes that can be set for the camera device.
1087      * LEGACY mode devices will always support AUTO mode. LIMITED and FULL
1088      * devices will always support OFF, AUTO modes.</p>
1089      * <p><b>Range of valid values:</b><br>
1090      * Any value listed in {@link CaptureRequest#CONTROL_MODE android.control.mode}</p>
1091      * <p>This key is available on all devices.</p>
1092      *
1093      * @see CaptureRequest#CONTROL_MODE
1094      */
1095     @PublicKey
1096     @NonNull
1097     public static final Key<int[]> CONTROL_AVAILABLE_MODES =
1098             new Key<int[]>("android.control.availableModes", int[].class);
1099 
1100     /**
1101      * <p>Range of boosts for {@link CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST android.control.postRawSensitivityBoost} supported
1102      * by this camera device.</p>
1103      * <p>Devices support post RAW sensitivity boost  will advertise
1104      * {@link CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST android.control.postRawSensitivityBoost} key for controling
1105      * post RAW sensitivity boost.</p>
1106      * <p>This key will be <code>null</code> for devices that do not support any RAW format
1107      * outputs. For devices that do support RAW format outputs, this key will always
1108      * present, and if a device does not support post RAW sensitivity boost, it will
1109      * list <code>(100, 100)</code> in this key.</p>
1110      * <p><b>Units</b>: ISO arithmetic units, the same as {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</p>
1111      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1112      *
1113      * @see CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST
1114      * @see CaptureRequest#SENSOR_SENSITIVITY
1115      */
1116     @PublicKey
1117     @NonNull
1118     public static final Key<android.util.Range<Integer>> CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE =
1119             new Key<android.util.Range<Integer>>("android.control.postRawSensitivityBoostRange", new TypeReference<android.util.Range<Integer>>() {{ }});
1120 
1121     /**
1122      * <p>List of edge enhancement modes for {@link CaptureRequest#EDGE_MODE android.edge.mode} that are supported by this camera
1123      * device.</p>
1124      * <p>Full-capability camera devices must always support OFF; camera devices that support
1125      * YUV_REPROCESSING or PRIVATE_REPROCESSING will list ZERO_SHUTTER_LAG; all devices will
1126      * list FAST.</p>
1127      * <p><b>Range of valid values:</b><br>
1128      * Any value listed in {@link CaptureRequest#EDGE_MODE android.edge.mode}</p>
1129      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1130      * <p><b>Full capability</b> -
1131      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1132      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1133      *
1134      * @see CaptureRequest#EDGE_MODE
1135      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1136      */
1137     @PublicKey
1138     @NonNull
1139     public static final Key<int[]> EDGE_AVAILABLE_EDGE_MODES =
1140             new Key<int[]>("android.edge.availableEdgeModes", int[].class);
1141 
1142     /**
1143      * <p>Whether this camera device has a
1144      * flash unit.</p>
1145      * <p>Will be <code>false</code> if no flash is available.</p>
1146      * <p>If there is no flash unit, none of the flash controls do
1147      * anything.
1148      * This key is available on all devices.</p>
1149      */
1150     @PublicKey
1151     @NonNull
1152     public static final Key<Boolean> FLASH_INFO_AVAILABLE =
1153             new Key<Boolean>("android.flash.info.available", boolean.class);
1154 
1155     /**
1156      * <p>List of hot pixel correction modes for {@link CaptureRequest#HOT_PIXEL_MODE android.hotPixel.mode} that are supported by this
1157      * camera device.</p>
1158      * <p>FULL mode camera devices will always support FAST.</p>
1159      * <p><b>Range of valid values:</b><br>
1160      * Any value listed in {@link CaptureRequest#HOT_PIXEL_MODE android.hotPixel.mode}</p>
1161      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1162      *
1163      * @see CaptureRequest#HOT_PIXEL_MODE
1164      */
1165     @PublicKey
1166     @NonNull
1167     public static final Key<int[]> HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES =
1168             new Key<int[]>("android.hotPixel.availableHotPixelModes", int[].class);
1169 
1170     /**
1171      * <p>List of JPEG thumbnail sizes for {@link CaptureRequest#JPEG_THUMBNAIL_SIZE android.jpeg.thumbnailSize} supported by this
1172      * camera device.</p>
1173      * <p>This list will include at least one non-zero resolution, plus <code>(0,0)</code> for indicating no
1174      * thumbnail should be generated.</p>
1175      * <p>Below condiditions will be satisfied for this size list:</p>
1176      * <ul>
1177      * <li>The sizes will be sorted by increasing pixel area (width x height).
1178      * If several resolutions have the same area, they will be sorted by increasing width.</li>
1179      * <li>The aspect ratio of the largest thumbnail size will be same as the
1180      * aspect ratio of largest JPEG output size in android.scaler.availableStreamConfigurations.
1181      * The largest size is defined as the size that has the largest pixel area
1182      * in a given size list.</li>
1183      * <li>Each output JPEG size in android.scaler.availableStreamConfigurations will have at least
1184      * one corresponding size that has the same aspect ratio in availableThumbnailSizes,
1185      * and vice versa.</li>
1186      * <li>All non-<code>(0, 0)</code> sizes will have non-zero widths and heights.</li>
1187      * </ul>
1188      * <p>This list is also used as supported thumbnail sizes for HEIC image format capture.</p>
1189      * <p>This key is available on all devices.</p>
1190      *
1191      * @see CaptureRequest#JPEG_THUMBNAIL_SIZE
1192      */
1193     @PublicKey
1194     @NonNull
1195     public static final Key<android.util.Size[]> JPEG_AVAILABLE_THUMBNAIL_SIZES =
1196             new Key<android.util.Size[]>("android.jpeg.availableThumbnailSizes", android.util.Size[].class);
1197 
1198     /**
1199      * <p>List of aperture size values for {@link CaptureRequest#LENS_APERTURE android.lens.aperture} that are
1200      * supported by this camera device.</p>
1201      * <p>If the camera device doesn't support a variable lens aperture,
1202      * this list will contain only one value, which is the fixed aperture size.</p>
1203      * <p>If the camera device supports a variable aperture, the aperture values
1204      * in this list will be sorted in ascending order.</p>
1205      * <p><b>Units</b>: The aperture f-number</p>
1206      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1207      * <p><b>Full capability</b> -
1208      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1209      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1210      *
1211      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1212      * @see CaptureRequest#LENS_APERTURE
1213      */
1214     @PublicKey
1215     @NonNull
1216     public static final Key<float[]> LENS_INFO_AVAILABLE_APERTURES =
1217             new Key<float[]>("android.lens.info.availableApertures", float[].class);
1218 
1219     /**
1220      * <p>List of neutral density filter values for
1221      * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} that are supported by this camera device.</p>
1222      * <p>If a neutral density filter is not supported by this camera device,
1223      * this list will contain only 0. Otherwise, this list will include every
1224      * filter density supported by the camera device, in ascending order.</p>
1225      * <p><b>Units</b>: Exposure value (EV)</p>
1226      * <p><b>Range of valid values:</b><br></p>
1227      * <p>Values are &gt;= 0</p>
1228      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1229      * <p><b>Full capability</b> -
1230      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1231      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1232      *
1233      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1234      * @see CaptureRequest#LENS_FILTER_DENSITY
1235      */
1236     @PublicKey
1237     @NonNull
1238     public static final Key<float[]> LENS_INFO_AVAILABLE_FILTER_DENSITIES =
1239             new Key<float[]>("android.lens.info.availableFilterDensities", float[].class);
1240 
1241     /**
1242      * <p>List of focal lengths for {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength} that are supported by this camera
1243      * device.</p>
1244      * <p>If optical zoom is not supported, this list will only contain
1245      * a single value corresponding to the fixed focal length of the
1246      * device. Otherwise, this list will include every focal length supported
1247      * by the camera device, in ascending order.</p>
1248      * <p><b>Units</b>: Millimeters</p>
1249      * <p><b>Range of valid values:</b><br></p>
1250      * <p>Values are &gt; 0</p>
1251      * <p>This key is available on all devices.</p>
1252      *
1253      * @see CaptureRequest#LENS_FOCAL_LENGTH
1254      */
1255     @PublicKey
1256     @NonNull
1257     public static final Key<float[]> LENS_INFO_AVAILABLE_FOCAL_LENGTHS =
1258             new Key<float[]>("android.lens.info.availableFocalLengths", float[].class);
1259 
1260     /**
1261      * <p>List of optical image stabilization (OIS) modes for
1262      * {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode} that are supported by this camera device.</p>
1263      * <p>If OIS is not supported by a given camera device, this list will
1264      * contain only OFF.</p>
1265      * <p><b>Range of valid values:</b><br>
1266      * Any value listed in {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}</p>
1267      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1268      * <p><b>Limited capability</b> -
1269      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1270      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1271      *
1272      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1273      * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
1274      */
1275     @PublicKey
1276     @NonNull
1277     public static final Key<int[]> LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION =
1278             new Key<int[]>("android.lens.info.availableOpticalStabilization", int[].class);
1279 
1280     /**
1281      * <p>Hyperfocal distance for this lens.</p>
1282      * <p>If the lens is not fixed focus, the camera device will report this
1283      * field when {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} is APPROXIMATE or CALIBRATED.</p>
1284      * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
1285      * <p><b>Range of valid values:</b><br>
1286      * If lens is fixed focus, &gt;= 0. If lens has focuser unit, the value is
1287      * within <code>(0.0f, {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}]</code></p>
1288      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1289      * <p><b>Limited capability</b> -
1290      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1291      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1292      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
1293      *
1294      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1295      * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
1296      * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
1297      */
1298     @PublicKey
1299     @NonNull
1300     public static final Key<Float> LENS_INFO_HYPERFOCAL_DISTANCE =
1301             new Key<Float>("android.lens.info.hyperfocalDistance", float.class);
1302 
1303     /**
1304      * <p>Shortest distance from frontmost surface
1305      * of the lens that can be brought into sharp focus.</p>
1306      * <p>If the lens is fixed-focus, this will be
1307      * 0.</p>
1308      * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
1309      * <p><b>Range of valid values:</b><br>
1310      * &gt;= 0</p>
1311      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1312      * <p><b>Limited capability</b> -
1313      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1314      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1315      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
1316      *
1317      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1318      * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
1319      */
1320     @PublicKey
1321     @NonNull
1322     public static final Key<Float> LENS_INFO_MINIMUM_FOCUS_DISTANCE =
1323             new Key<Float>("android.lens.info.minimumFocusDistance", float.class);
1324 
1325     /**
1326      * <p>Dimensions of lens shading map.</p>
1327      * <p>The map should be on the order of 30-40 rows and columns, and
1328      * must be smaller than 64x64.</p>
1329      * <p><b>Range of valid values:</b><br>
1330      * Both values &gt;= 1</p>
1331      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1332      * <p><b>Full capability</b> -
1333      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1334      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1335      *
1336      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1337      * @hide
1338      */
1339     public static final Key<android.util.Size> LENS_INFO_SHADING_MAP_SIZE =
1340             new Key<android.util.Size>("android.lens.info.shadingMapSize", android.util.Size.class);
1341 
1342     /**
1343      * <p>The lens focus distance calibration quality.</p>
1344      * <p>The lens focus distance calibration quality determines the reliability of
1345      * focus related metadata entries, i.e. {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
1346      * {@link CaptureResult#LENS_FOCUS_RANGE android.lens.focusRange}, {@link CameraCharacteristics#LENS_INFO_HYPERFOCAL_DISTANCE android.lens.info.hyperfocalDistance}, and
1347      * {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}.</p>
1348      * <p>APPROXIMATE and CALIBRATED devices report the focus metadata in
1349      * units of diopters (1/meter), so <code>0.0f</code> represents focusing at infinity,
1350      * and increasing positive numbers represent focusing closer and closer
1351      * to the camera device. The focus distance control also uses diopters
1352      * on these devices.</p>
1353      * <p>UNCALIBRATED devices do not use units that are directly comparable
1354      * to any real physical measurement, but <code>0.0f</code> still represents farthest
1355      * focus, and {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} represents the
1356      * nearest focus the device can achieve.</p>
1357      * <p><b>Possible values:</b>
1358      * <ul>
1359      *   <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED UNCALIBRATED}</li>
1360      *   <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE APPROXIMATE}</li>
1361      *   <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED CALIBRATED}</li>
1362      * </ul></p>
1363      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1364      * <p><b>Limited capability</b> -
1365      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1366      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1367      *
1368      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1369      * @see CaptureRequest#LENS_FOCUS_DISTANCE
1370      * @see CaptureResult#LENS_FOCUS_RANGE
1371      * @see CameraCharacteristics#LENS_INFO_HYPERFOCAL_DISTANCE
1372      * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
1373      * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED
1374      * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE
1375      * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED
1376      */
1377     @PublicKey
1378     @NonNull
1379     public static final Key<Integer> LENS_INFO_FOCUS_DISTANCE_CALIBRATION =
1380             new Key<Integer>("android.lens.info.focusDistanceCalibration", int.class);
1381 
1382     /**
1383      * <p>Direction the camera faces relative to
1384      * device screen.</p>
1385      * <p><b>Possible values:</b>
1386      * <ul>
1387      *   <li>{@link #LENS_FACING_FRONT FRONT}</li>
1388      *   <li>{@link #LENS_FACING_BACK BACK}</li>
1389      *   <li>{@link #LENS_FACING_EXTERNAL EXTERNAL}</li>
1390      * </ul></p>
1391      * <p>This key is available on all devices.</p>
1392      * @see #LENS_FACING_FRONT
1393      * @see #LENS_FACING_BACK
1394      * @see #LENS_FACING_EXTERNAL
1395      */
1396     @PublicKey
1397     @NonNull
1398     public static final Key<Integer> LENS_FACING =
1399             new Key<Integer>("android.lens.facing", int.class);
1400 
1401     /**
1402      * <p>The orientation of the camera relative to the sensor
1403      * coordinate system.</p>
1404      * <p>The four coefficients that describe the quaternion
1405      * rotation from the Android sensor coordinate system to a
1406      * camera-aligned coordinate system where the X-axis is
1407      * aligned with the long side of the image sensor, the Y-axis
1408      * is aligned with the short side of the image sensor, and
1409      * the Z-axis is aligned with the optical axis of the sensor.</p>
1410      * <p>To convert from the quaternion coefficients <code>(x,y,z,w)</code>
1411      * to the axis of rotation <code>(a_x, a_y, a_z)</code> and rotation
1412      * amount <code>theta</code>, the following formulas can be used:</p>
1413      * <pre><code> theta = 2 * acos(w)
1414      * a_x = x / sin(theta/2)
1415      * a_y = y / sin(theta/2)
1416      * a_z = z / sin(theta/2)
1417      * </code></pre>
1418      * <p>To create a 3x3 rotation matrix that applies the rotation
1419      * defined by this quaternion, the following matrix can be
1420      * used:</p>
1421      * <pre><code>R = [ 1 - 2y^2 - 2z^2,       2xy - 2zw,       2xz + 2yw,
1422      *            2xy + 2zw, 1 - 2x^2 - 2z^2,       2yz - 2xw,
1423      *            2xz - 2yw,       2yz + 2xw, 1 - 2x^2 - 2y^2 ]
1424      * </code></pre>
1425      * <p>This matrix can then be used to apply the rotation to a
1426      *  column vector point with</p>
1427      * <p><code>p' = Rp</code></p>
1428      * <p>where <code>p</code> is in the device sensor coordinate system, and
1429      *  <code>p'</code> is in the camera-oriented coordinate system.</p>
1430      * <p><b>Units</b>:
1431      * Quaternion coefficients</p>
1432      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1433      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
1434      */
1435     @PublicKey
1436     @NonNull
1437     public static final Key<float[]> LENS_POSE_ROTATION =
1438             new Key<float[]>("android.lens.poseRotation", float[].class);
1439 
1440     /**
1441      * <p>Position of the camera optical center.</p>
1442      * <p>The position of the camera device's lens optical center,
1443      * as a three-dimensional vector <code>(x,y,z)</code>.</p>
1444      * <p>Prior to Android P, or when {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is PRIMARY_CAMERA, this position
1445      * is relative to the optical center of the largest camera device facing in the same
1446      * direction as this camera, in the {@link android.hardware.SensorEvent Android sensor
1447      * coordinate axes}. Note that only the axis definitions are shared with the sensor
1448      * coordinate system, but not the origin.</p>
1449      * <p>If this device is the largest or only camera device with a given facing, then this
1450      * position will be <code>(0, 0, 0)</code>; a camera device with a lens optical center located 3 cm
1451      * from the main sensor along the +X axis (to the right from the user's perspective) will
1452      * report <code>(0.03, 0, 0)</code>.  Note that this means that, for many computer vision
1453      * applications, the position needs to be negated to convert it to a translation from the
1454      * camera to the origin.</p>
1455      * <p>To transform a pixel coordinates between two cameras facing the same direction, first
1456      * the source camera {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} must be corrected for.  Then the source
1457      * camera {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} needs to be applied, followed by the
1458      * {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the source camera, the translation of the source camera
1459      * relative to the destination camera, the {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the destination
1460      * camera, and finally the inverse of {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} of the destination
1461      * camera. This obtains a radial-distortion-free coordinate in the destination camera pixel
1462      * coordinates.</p>
1463      * <p>To compare this against a real image from the destination camera, the destination camera
1464      * image then needs to be corrected for radial distortion before comparison or sampling.</p>
1465      * <p>When {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is GYROSCOPE, then this position is relative to
1466      * the center of the primary gyroscope on the device. The axis definitions are the same as
1467      * with PRIMARY_CAMERA.</p>
1468      * <p><b>Units</b>: Meters</p>
1469      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1470      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
1471      *
1472      * @see CameraCharacteristics#LENS_DISTORTION
1473      * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
1474      * @see CameraCharacteristics#LENS_POSE_REFERENCE
1475      * @see CameraCharacteristics#LENS_POSE_ROTATION
1476      */
1477     @PublicKey
1478     @NonNull
1479     public static final Key<float[]> LENS_POSE_TRANSLATION =
1480             new Key<float[]>("android.lens.poseTranslation", float[].class);
1481 
1482     /**
1483      * <p>The parameters for this camera device's intrinsic
1484      * calibration.</p>
1485      * <p>The five calibration parameters that describe the
1486      * transform from camera-centric 3D coordinates to sensor
1487      * pixel coordinates:</p>
1488      * <pre><code>[f_x, f_y, c_x, c_y, s]
1489      * </code></pre>
1490      * <p>Where <code>f_x</code> and <code>f_y</code> are the horizontal and vertical
1491      * focal lengths, <code>[c_x, c_y]</code> is the position of the optical
1492      * axis, and <code>s</code> is a skew parameter for the sensor plane not
1493      * being aligned with the lens plane.</p>
1494      * <p>These are typically used within a transformation matrix K:</p>
1495      * <pre><code>K = [ f_x,   s, c_x,
1496      *        0, f_y, c_y,
1497      *        0    0,   1 ]
1498      * </code></pre>
1499      * <p>which can then be combined with the camera pose rotation
1500      * <code>R</code> and translation <code>t</code> ({@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} and
1501      * {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}, respectively) to calculate the
1502      * complete transform from world coordinates to pixel
1503      * coordinates:</p>
1504      * <pre><code>P = [ K 0   * [ R -Rt
1505      *      0 1 ]      0 1 ]
1506      * </code></pre>
1507      * <p>(Note the negation of poseTranslation when mapping from camera
1508      * to world coordinates, and multiplication by the rotation).</p>
1509      * <p>With <code>p_w</code> being a point in the world coordinate system
1510      * and <code>p_s</code> being a point in the camera active pixel array
1511      * coordinate system, and with the mapping including the
1512      * homogeneous division by z:</p>
1513      * <pre><code> p_h = (x_h, y_h, z_h) = P p_w
1514      * p_s = p_h / z_h
1515      * </code></pre>
1516      * <p>so <code>[x_s, y_s]</code> is the pixel coordinates of the world
1517      * point, <code>z_s = 1</code>, and <code>w_s</code> is a measurement of disparity
1518      * (depth) in pixel coordinates.</p>
1519      * <p>Note that the coordinate system for this transform is the
1520      * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} system,
1521      * where <code>(0,0)</code> is the top-left of the
1522      * preCorrectionActiveArraySize rectangle. Once the pose and
1523      * intrinsic calibration transforms have been applied to a
1524      * world point, then the {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion}
1525      * transform needs to be applied, and the result adjusted to
1526      * be in the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} coordinate
1527      * system (where <code>(0, 0)</code> is the top-left of the
1528      * activeArraySize rectangle), to determine the final pixel
1529      * coordinate of the world point for processed (non-RAW)
1530      * output buffers.</p>
1531      * <p>For camera devices, the center of pixel <code>(x,y)</code> is located at
1532      * coordinate <code>(x + 0.5, y + 0.5)</code>.  So on a device with a
1533      * precorrection active array of size <code>(10,10)</code>, the valid pixel
1534      * indices go from <code>(0,0)-(9,9)</code>, and an perfectly-built camera would
1535      * have an optical center at the exact center of the pixel grid, at
1536      * coordinates <code>(5.0, 5.0)</code>, which is the top-left corner of pixel
1537      * <code>(5,5)</code>.</p>
1538      * <p><b>Units</b>:
1539      * Pixels in the
1540      * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}
1541      * coordinate system.</p>
1542      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1543      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
1544      *
1545      * @see CameraCharacteristics#LENS_DISTORTION
1546      * @see CameraCharacteristics#LENS_POSE_ROTATION
1547      * @see CameraCharacteristics#LENS_POSE_TRANSLATION
1548      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
1549      * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
1550      */
1551     @PublicKey
1552     @NonNull
1553     public static final Key<float[]> LENS_INTRINSIC_CALIBRATION =
1554             new Key<float[]>("android.lens.intrinsicCalibration", float[].class);
1555 
1556     /**
1557      * <p>The correction coefficients to correct for this camera device's
1558      * radial and tangential lens distortion.</p>
1559      * <p>Four radial distortion coefficients <code>[kappa_0, kappa_1, kappa_2,
1560      * kappa_3]</code> and two tangential distortion coefficients
1561      * <code>[kappa_4, kappa_5]</code> that can be used to correct the
1562      * lens's geometric distortion with the mapping equations:</p>
1563      * <pre><code> x_c = x_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
1564      *        kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
1565      *  y_c = y_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
1566      *        kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
1567      * </code></pre>
1568      * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
1569      * input image that correspond to the pixel values in the
1570      * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
1571      * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
1572      * </code></pre>
1573      * <p>The pixel coordinates are defined in a normalized
1574      * coordinate system related to the
1575      * {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} calibration fields.
1576      * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code> have <code>(0,0)</code> at the
1577      * lens optical center <code>[c_x, c_y]</code>. The maximum magnitudes
1578      * of both x and y coordinates are normalized to be 1 at the
1579      * edge further from the optical center, so the range
1580      * for both dimensions is <code>-1 &lt;= x &lt;= 1</code>.</p>
1581      * <p>Finally, <code>r</code> represents the radial distance from the
1582      * optical center, <code>r^2 = x_i^2 + y_i^2</code>, and its magnitude
1583      * is therefore no larger than <code>|r| &lt;= sqrt(2)</code>.</p>
1584      * <p>The distortion model used is the Brown-Conrady model.</p>
1585      * <p><b>Units</b>:
1586      * Unitless coefficients.</p>
1587      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1588      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
1589      *
1590      * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
1591      * @deprecated
1592      * <p>This field was inconsistently defined in terms of its
1593      * normalization. Use {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} instead.</p>
1594      *
1595      * @see CameraCharacteristics#LENS_DISTORTION
1596 
1597      */
1598     @Deprecated
1599     @PublicKey
1600     @NonNull
1601     public static final Key<float[]> LENS_RADIAL_DISTORTION =
1602             new Key<float[]>("android.lens.radialDistortion", float[].class);
1603 
1604     /**
1605      * <p>The origin for {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}.</p>
1606      * <p>Different calibration methods and use cases can produce better or worse results
1607      * depending on the selected coordinate origin.</p>
1608      * <p><b>Possible values:</b>
1609      * <ul>
1610      *   <li>{@link #LENS_POSE_REFERENCE_PRIMARY_CAMERA PRIMARY_CAMERA}</li>
1611      *   <li>{@link #LENS_POSE_REFERENCE_GYROSCOPE GYROSCOPE}</li>
1612      * </ul></p>
1613      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1614      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
1615      *
1616      * @see CameraCharacteristics#LENS_POSE_TRANSLATION
1617      * @see #LENS_POSE_REFERENCE_PRIMARY_CAMERA
1618      * @see #LENS_POSE_REFERENCE_GYROSCOPE
1619      */
1620     @PublicKey
1621     @NonNull
1622     public static final Key<Integer> LENS_POSE_REFERENCE =
1623             new Key<Integer>("android.lens.poseReference", int.class);
1624 
1625     /**
1626      * <p>The correction coefficients to correct for this camera device's
1627      * radial and tangential lens distortion.</p>
1628      * <p>Replaces the deprecated {@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion} field, which was
1629      * inconsistently defined.</p>
1630      * <p>Three radial distortion coefficients <code>[kappa_1, kappa_2,
1631      * kappa_3]</code> and two tangential distortion coefficients
1632      * <code>[kappa_4, kappa_5]</code> that can be used to correct the
1633      * lens's geometric distortion with the mapping equations:</p>
1634      * <pre><code> x_c = x_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
1635      *        kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
1636      *  y_c = y_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
1637      *        kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
1638      * </code></pre>
1639      * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
1640      * input image that correspond to the pixel values in the
1641      * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
1642      * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
1643      * </code></pre>
1644      * <p>The pixel coordinates are defined in a coordinate system
1645      * related to the {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration}
1646      * calibration fields; see that entry for details of the mapping stages.
1647      * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code>
1648      * have <code>(0,0)</code> at the lens optical center <code>[c_x, c_y]</code>, and
1649      * the range of the coordinates depends on the focal length
1650      * terms of the intrinsic calibration.</p>
1651      * <p>Finally, <code>r</code> represents the radial distance from the
1652      * optical center, <code>r^2 = x_i^2 + y_i^2</code>.</p>
1653      * <p>The distortion model used is the Brown-Conrady model.</p>
1654      * <p><b>Units</b>:
1655      * Unitless coefficients.</p>
1656      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1657      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
1658      *
1659      * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
1660      * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
1661      */
1662     @PublicKey
1663     @NonNull
1664     public static final Key<float[]> LENS_DISTORTION =
1665             new Key<float[]>("android.lens.distortion", float[].class);
1666 
1667     /**
1668      * <p>List of noise reduction modes for {@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} that are supported
1669      * by this camera device.</p>
1670      * <p>Full-capability camera devices will always support OFF and FAST.</p>
1671      * <p>Camera devices that support YUV_REPROCESSING or PRIVATE_REPROCESSING will support
1672      * ZERO_SHUTTER_LAG.</p>
1673      * <p>Legacy-capability camera devices will only support FAST mode.</p>
1674      * <p><b>Range of valid values:</b><br>
1675      * Any value listed in {@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}</p>
1676      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1677      * <p><b>Limited capability</b> -
1678      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1679      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1680      *
1681      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1682      * @see CaptureRequest#NOISE_REDUCTION_MODE
1683      */
1684     @PublicKey
1685     @NonNull
1686     public static final Key<int[]> NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES =
1687             new Key<int[]>("android.noiseReduction.availableNoiseReductionModes", int[].class);
1688 
1689     /**
1690      * <p>If set to 1, the HAL will always split result
1691      * metadata for a single capture into multiple buffers,
1692      * returned using multiple process_capture_result calls.</p>
1693      * <p>Does not need to be listed in static
1694      * metadata. Support for partial results will be reworked in
1695      * future versions of camera service. This quirk will stop
1696      * working at that point; DO NOT USE without careful
1697      * consideration of future support.</p>
1698      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1699      * @deprecated
1700      * <p>Not used in HALv3 or newer; replaced by better partials mechanism</p>
1701 
1702      * @hide
1703      */
1704     @Deprecated
1705     public static final Key<Byte> QUIRKS_USE_PARTIAL_RESULT =
1706             new Key<Byte>("android.quirks.usePartialResult", byte.class);
1707 
1708     /**
1709      * <p>The maximum numbers of different types of output streams
1710      * that can be configured and used simultaneously by a camera device.</p>
1711      * <p>This is a 3 element tuple that contains the max number of output simultaneous
1712      * streams for raw sensor, processed (but not stalling), and processed (and stalling)
1713      * formats respectively. For example, assuming that JPEG is typically a processed and
1714      * stalling stream, if max raw sensor format output stream number is 1, max YUV streams
1715      * number is 3, and max JPEG stream number is 2, then this tuple should be <code>(1, 3, 2)</code>.</p>
1716      * <p>This lists the upper bound of the number of output streams supported by
1717      * the camera device. Using more streams simultaneously may require more hardware and
1718      * CPU resources that will consume more power. The image format for an output stream can
1719      * be any supported format provided by android.scaler.availableStreamConfigurations.
1720      * The formats defined in android.scaler.availableStreamConfigurations can be catergorized
1721      * into the 3 stream types as below:</p>
1722      * <ul>
1723      * <li>Processed (but stalling): any non-RAW format with a stallDurations &gt; 0.
1724      *   Typically {@link android.graphics.ImageFormat#JPEG JPEG format}.</li>
1725      * <li>Raw formats: {@link android.graphics.ImageFormat#RAW_SENSOR RAW_SENSOR}, {@link android.graphics.ImageFormat#RAW10 RAW10}, or
1726      *   {@link android.graphics.ImageFormat#RAW12 RAW12}.</li>
1727      * <li>Processed (but not-stalling): any non-RAW format without a stall duration.  Typically
1728      *   {@link android.graphics.ImageFormat#YUV_420_888 YUV_420_888},
1729      *   {@link android.graphics.ImageFormat#NV21 NV21}, {@link android.graphics.ImageFormat#YV12 YV12}, or {@link android.graphics.ImageFormat#Y8 Y8} .</li>
1730      * </ul>
1731      * <p><b>Range of valid values:</b><br></p>
1732      * <p>For processed (and stalling) format streams, &gt;= 1.</p>
1733      * <p>For Raw format (either stalling or non-stalling) streams, &gt;= 0.</p>
1734      * <p>For processed (but not stalling) format streams, &gt;= 3
1735      * for FULL mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL</code>);
1736      * &gt;= 2 for LIMITED mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == LIMITED</code>).</p>
1737      * <p>This key is available on all devices.</p>
1738      *
1739      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1740      * @hide
1741      */
1742     public static final Key<int[]> REQUEST_MAX_NUM_OUTPUT_STREAMS =
1743             new Key<int[]>("android.request.maxNumOutputStreams", int[].class);
1744 
1745     /**
1746      * <p>The maximum numbers of different types of output streams
1747      * that can be configured and used simultaneously by a camera device
1748      * for any <code>RAW</code> formats.</p>
1749      * <p>This value contains the max number of output simultaneous
1750      * streams from the raw sensor.</p>
1751      * <p>This lists the upper bound of the number of output streams supported by
1752      * the camera device. Using more streams simultaneously may require more hardware and
1753      * CPU resources that will consume more power. The image format for this kind of an output stream can
1754      * be any <code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
1755      * <p>In particular, a <code>RAW</code> format is typically one of:</p>
1756      * <ul>
1757      * <li>{@link android.graphics.ImageFormat#RAW_SENSOR RAW_SENSOR}</li>
1758      * <li>{@link android.graphics.ImageFormat#RAW10 RAW10}</li>
1759      * <li>{@link android.graphics.ImageFormat#RAW12 RAW12}</li>
1760      * </ul>
1761      * <p>LEGACY mode devices ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} <code>==</code> LEGACY)
1762      * never support raw streams.</p>
1763      * <p><b>Range of valid values:</b><br></p>
1764      * <p>&gt;= 0</p>
1765      * <p>This key is available on all devices.</p>
1766      *
1767      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1768      * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
1769      */
1770     @PublicKey
1771     @NonNull
1772     @SyntheticKey
1773     public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_RAW =
1774             new Key<Integer>("android.request.maxNumOutputRaw", int.class);
1775 
1776     /**
1777      * <p>The maximum numbers of different types of output streams
1778      * that can be configured and used simultaneously by a camera device
1779      * for any processed (but not-stalling) formats.</p>
1780      * <p>This value contains the max number of output simultaneous
1781      * streams for any processed (but not-stalling) formats.</p>
1782      * <p>This lists the upper bound of the number of output streams supported by
1783      * the camera device. Using more streams simultaneously may require more hardware and
1784      * CPU resources that will consume more power. The image format for this kind of an output stream can
1785      * be any non-<code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
1786      * <p>Processed (but not-stalling) is defined as any non-RAW format without a stall duration.
1787      * Typically:</p>
1788      * <ul>
1789      * <li>{@link android.graphics.ImageFormat#YUV_420_888 YUV_420_888}</li>
1790      * <li>{@link android.graphics.ImageFormat#NV21 NV21}</li>
1791      * <li>{@link android.graphics.ImageFormat#YV12 YV12}</li>
1792      * <li>Implementation-defined formats, i.e. {@link android.hardware.camera2.params.StreamConfigurationMap#isOutputSupportedFor(Class) }</li>
1793      * <li>{@link android.graphics.ImageFormat#Y8 Y8}</li>
1794      * </ul>
1795      * <p>For full guarantees, query {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } with a
1796      * processed format -- it will return 0 for a non-stalling stream.</p>
1797      * <p>LEGACY devices will support at least 2 processing/non-stalling streams.</p>
1798      * <p><b>Range of valid values:</b><br></p>
1799      * <p>&gt;= 3
1800      * for FULL mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL</code>);
1801      * &gt;= 2 for LIMITED mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == LIMITED</code>).</p>
1802      * <p>This key is available on all devices.</p>
1803      *
1804      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1805      * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
1806      */
1807     @PublicKey
1808     @NonNull
1809     @SyntheticKey
1810     public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_PROC =
1811             new Key<Integer>("android.request.maxNumOutputProc", int.class);
1812 
1813     /**
1814      * <p>The maximum numbers of different types of output streams
1815      * that can be configured and used simultaneously by a camera device
1816      * for any processed (and stalling) formats.</p>
1817      * <p>This value contains the max number of output simultaneous
1818      * streams for any processed (but not-stalling) formats.</p>
1819      * <p>This lists the upper bound of the number of output streams supported by
1820      * the camera device. Using more streams simultaneously may require more hardware and
1821      * CPU resources that will consume more power. The image format for this kind of an output stream can
1822      * be any non-<code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
1823      * <p>A processed and stalling format is defined as any non-RAW format with a stallDurations
1824      * &gt; 0.  Typically only the {@link android.graphics.ImageFormat#JPEG JPEG format} is a stalling format.</p>
1825      * <p>For full guarantees, query {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } with a
1826      * processed format -- it will return a non-0 value for a stalling stream.</p>
1827      * <p>LEGACY devices will support up to 1 processing/stalling stream.</p>
1828      * <p><b>Range of valid values:</b><br></p>
1829      * <p>&gt;= 1</p>
1830      * <p>This key is available on all devices.</p>
1831      *
1832      * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
1833      */
1834     @PublicKey
1835     @NonNull
1836     @SyntheticKey
1837     public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_PROC_STALLING =
1838             new Key<Integer>("android.request.maxNumOutputProcStalling", int.class);
1839 
1840     /**
1841      * <p>The maximum numbers of any type of input streams
1842      * that can be configured and used simultaneously by a camera device.</p>
1843      * <p>When set to 0, it means no input stream is supported.</p>
1844      * <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
1845      * input stream, there must be at least one output stream configured to to receive the
1846      * reprocessed images.</p>
1847      * <p>When an input stream and some output streams are used in a reprocessing request,
1848      * only the input buffer will be used to produce these output stream buffers, and a
1849      * new sensor image will not be captured.</p>
1850      * <p>For example, for Zero Shutter Lag (ZSL) still capture use case, the input
1851      * stream image format will be PRIVATE, the associated output stream image format
1852      * should be JPEG.</p>
1853      * <p><b>Range of valid values:</b><br></p>
1854      * <p>0 or 1.</p>
1855      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1856      * <p><b>Full capability</b> -
1857      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1858      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1859      *
1860      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1861      */
1862     @PublicKey
1863     @NonNull
1864     public static final Key<Integer> REQUEST_MAX_NUM_INPUT_STREAMS =
1865             new Key<Integer>("android.request.maxNumInputStreams", int.class);
1866 
1867     /**
1868      * <p>Specifies the number of maximum pipeline stages a frame
1869      * has to go through from when it's exposed to when it's available
1870      * to the framework.</p>
1871      * <p>A typical minimum value for this is 2 (one stage to expose,
1872      * one stage to readout) from the sensor. The ISP then usually adds
1873      * its own stages to do custom HW processing. Further stages may be
1874      * added by SW processing.</p>
1875      * <p>Depending on what settings are used (e.g. YUV, JPEG) and what
1876      * processing is enabled (e.g. face detection), the actual pipeline
1877      * depth (specified by {@link CaptureResult#REQUEST_PIPELINE_DEPTH android.request.pipelineDepth}) may be less than
1878      * the max pipeline depth.</p>
1879      * <p>A pipeline depth of X stages is equivalent to a pipeline latency of
1880      * X frame intervals.</p>
1881      * <p>This value will normally be 8 or less, however, for high speed capture session,
1882      * the max pipeline depth will be up to 8 x size of high speed capture request list.</p>
1883      * <p>This key is available on all devices.</p>
1884      *
1885      * @see CaptureResult#REQUEST_PIPELINE_DEPTH
1886      */
1887     @PublicKey
1888     @NonNull
1889     public static final Key<Byte> REQUEST_PIPELINE_MAX_DEPTH =
1890             new Key<Byte>("android.request.pipelineMaxDepth", byte.class);
1891 
1892     /**
1893      * <p>Defines how many sub-components
1894      * a result will be composed of.</p>
1895      * <p>In order to combat the pipeline latency, partial results
1896      * may be delivered to the application layer from the camera device as
1897      * soon as they are available.</p>
1898      * <p>Optional; defaults to 1. A value of 1 means that partial
1899      * results are not supported, and only the final TotalCaptureResult will
1900      * be produced by the camera device.</p>
1901      * <p>A typical use case for this might be: after requesting an
1902      * auto-focus (AF) lock the new AF state might be available 50%
1903      * of the way through the pipeline.  The camera device could
1904      * then immediately dispatch this state via a partial result to
1905      * the application, and the rest of the metadata via later
1906      * partial results.</p>
1907      * <p><b>Range of valid values:</b><br>
1908      * &gt;= 1</p>
1909      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1910      */
1911     @PublicKey
1912     @NonNull
1913     public static final Key<Integer> REQUEST_PARTIAL_RESULT_COUNT =
1914             new Key<Integer>("android.request.partialResultCount", int.class);
1915 
1916     /**
1917      * <p>List of capabilities that this camera device
1918      * advertises as fully supporting.</p>
1919      * <p>A capability is a contract that the camera device makes in order
1920      * to be able to satisfy one or more use cases.</p>
1921      * <p>Listing a capability guarantees that the whole set of features
1922      * required to support a common use will all be available.</p>
1923      * <p>Using a subset of the functionality provided by an unsupported
1924      * capability may be possible on a specific camera device implementation;
1925      * to do this query each of android.request.availableRequestKeys,
1926      * android.request.availableResultKeys,
1927      * android.request.availableCharacteristicsKeys.</p>
1928      * <p>The following capabilities are guaranteed to be available on
1929      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} <code>==</code> FULL devices:</p>
1930      * <ul>
1931      * <li>MANUAL_SENSOR</li>
1932      * <li>MANUAL_POST_PROCESSING</li>
1933      * </ul>
1934      * <p>Other capabilities may be available on either FULL or LIMITED
1935      * devices, but the application should query this key to be sure.</p>
1936      * <p><b>Possible values:</b>
1937      * <ul>
1938      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE BACKWARD_COMPATIBLE}</li>
1939      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR MANUAL_SENSOR}</li>
1940      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING MANUAL_POST_PROCESSING}</li>
1941      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_RAW RAW}</li>
1942      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING PRIVATE_REPROCESSING}</li>
1943      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS READ_SENSOR_SETTINGS}</li>
1944      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE BURST_CAPTURE}</li>
1945      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING YUV_REPROCESSING}</li>
1946      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT DEPTH_OUTPUT}</li>
1947      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO CONSTRAINED_HIGH_SPEED_VIDEO}</li>
1948      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING MOTION_TRACKING}</li>
1949      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA LOGICAL_MULTI_CAMERA}</li>
1950      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME MONOCHROME}</li>
1951      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_SECURE_IMAGE_DATA SECURE_IMAGE_DATA}</li>
1952      * </ul></p>
1953      * <p>This key is available on all devices.</p>
1954      *
1955      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1956      * @see #REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE
1957      * @see #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR
1958      * @see #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING
1959      * @see #REQUEST_AVAILABLE_CAPABILITIES_RAW
1960      * @see #REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING
1961      * @see #REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS
1962      * @see #REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE
1963      * @see #REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING
1964      * @see #REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT
1965      * @see #REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO
1966      * @see #REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING
1967      * @see #REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA
1968      * @see #REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME
1969      * @see #REQUEST_AVAILABLE_CAPABILITIES_SECURE_IMAGE_DATA
1970      */
1971     @PublicKey
1972     @NonNull
1973     public static final Key<int[]> REQUEST_AVAILABLE_CAPABILITIES =
1974             new Key<int[]>("android.request.availableCapabilities", int[].class);
1975 
1976     /**
1977      * <p>A list of all keys that the camera device has available
1978      * to use with {@link android.hardware.camera2.CaptureRequest }.</p>
1979      * <p>Attempting to set a key into a CaptureRequest that is not
1980      * listed here will result in an invalid request and will be rejected
1981      * by the camera device.</p>
1982      * <p>This field can be used to query the feature set of a camera device
1983      * at a more granular level than capabilities. This is especially
1984      * important for optional keys that are not listed under any capability
1985      * in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.</p>
1986      * <p>This key is available on all devices.</p>
1987      *
1988      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1989      * @hide
1990      */
1991     public static final Key<int[]> REQUEST_AVAILABLE_REQUEST_KEYS =
1992             new Key<int[]>("android.request.availableRequestKeys", int[].class);
1993 
1994     /**
1995      * <p>A list of all keys that the camera device has available to use with {@link android.hardware.camera2.CaptureResult }.</p>
1996      * <p>Attempting to get a key from a CaptureResult that is not
1997      * listed here will always return a <code>null</code> value. Getting a key from
1998      * a CaptureResult that is listed here will generally never return a <code>null</code>
1999      * value.</p>
2000      * <p>The following keys may return <code>null</code> unless they are enabled:</p>
2001      * <ul>
2002      * <li>android.statistics.lensShadingMap (non-null iff {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON)</li>
2003      * </ul>
2004      * <p>(Those sometimes-null keys will nevertheless be listed here
2005      * if they are available.)</p>
2006      * <p>This field can be used to query the feature set of a camera device
2007      * at a more granular level than capabilities. This is especially
2008      * important for optional keys that are not listed under any capability
2009      * in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.</p>
2010      * <p>This key is available on all devices.</p>
2011      *
2012      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
2013      * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
2014      * @hide
2015      */
2016     public static final Key<int[]> REQUEST_AVAILABLE_RESULT_KEYS =
2017             new Key<int[]>("android.request.availableResultKeys", int[].class);
2018 
2019     /**
2020      * <p>A list of all keys that the camera device has available to use with {@link android.hardware.camera2.CameraCharacteristics }.</p>
2021      * <p>This entry follows the same rules as
2022      * android.request.availableResultKeys (except that it applies for
2023      * CameraCharacteristics instead of CaptureResult). See above for more
2024      * details.</p>
2025      * <p>This key is available on all devices.</p>
2026      * @hide
2027      */
2028     public static final Key<int[]> REQUEST_AVAILABLE_CHARACTERISTICS_KEYS =
2029             new Key<int[]>("android.request.availableCharacteristicsKeys", int[].class);
2030 
2031     /**
2032      * <p>A subset of the available request keys that the camera device
2033      * can pass as part of the capture session initialization.</p>
2034      * <p>This is a subset of android.request.availableRequestKeys which
2035      * contains a list of keys that are difficult to apply per-frame and
2036      * can result in unexpected delays when modified during the capture session
2037      * lifetime. Typical examples include parameters that require a
2038      * time-consuming hardware re-configuration or internal camera pipeline
2039      * change. For performance reasons we advise clients to pass their initial
2040      * values as part of
2041      * {@link SessionConfiguration#setSessionParameters }.
2042      * Once the camera capture session is enabled it is also recommended to avoid
2043      * changing them from their initial values set in
2044      * {@link SessionConfiguration#setSessionParameters }.
2045      * Control over session parameters can still be exerted in capture requests
2046      * but clients should be aware and expect delays during their application.
2047      * An example usage scenario could look like this:</p>
2048      * <ul>
2049      * <li>The camera client starts by quering the session parameter key list via
2050      *   {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys }.</li>
2051      * <li>Before triggering the capture session create sequence, a capture request
2052      *   must be built via
2053      *   {@link CameraDevice#createCaptureRequest }
2054      *   using an appropriate template matching the particular use case.</li>
2055      * <li>The client should go over the list of session parameters and check
2056      *   whether some of the keys listed matches with the parameters that
2057      *   they intend to modify as part of the first capture request.</li>
2058      * <li>If there is no such match, the capture request can be  passed
2059      *   unmodified to
2060      *   {@link SessionConfiguration#setSessionParameters }.</li>
2061      * <li>If matches do exist, the client should update the respective values
2062      *   and pass the request to
2063      *   {@link SessionConfiguration#setSessionParameters }.</li>
2064      * <li>After the capture session initialization completes the session parameter
2065      *   key list can continue to serve as reference when posting or updating
2066      *   further requests. As mentioned above further changes to session
2067      *   parameters should ideally be avoided, if updates are necessary
2068      *   however clients could expect a delay/glitch during the
2069      *   parameter switch.</li>
2070      * </ul>
2071      * <p>This key is available on all devices.</p>
2072      * @hide
2073      */
2074     public static final Key<int[]> REQUEST_AVAILABLE_SESSION_KEYS =
2075             new Key<int[]>("android.request.availableSessionKeys", int[].class);
2076 
2077     /**
2078      * <p>A subset of the available request keys that can be overridden for
2079      * physical devices backing a logical multi-camera.</p>
2080      * <p>This is a subset of android.request.availableRequestKeys which contains a list
2081      * of keys that can be overridden using {@link CaptureRequest.Builder#setPhysicalCameraKey }.
2082      * The respective value of such request key can be obtained by calling
2083      * {@link CaptureRequest.Builder#getPhysicalCameraKey }. Capture requests that contain
2084      * individual physical device requests must be built via
2085      * {@link android.hardware.camera2.CameraDevice#createCaptureRequest(int, Set)}.</p>
2086      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2087      * <p><b>Limited capability</b> -
2088      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2089      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2090      *
2091      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2092      * @hide
2093      */
2094     public static final Key<int[]> REQUEST_AVAILABLE_PHYSICAL_CAMERA_REQUEST_KEYS =
2095             new Key<int[]>("android.request.availablePhysicalCameraRequestKeys", int[].class);
2096 
2097     /**
2098      * <p>A list of camera characteristics keys that are only available
2099      * in case the camera client has camera permission.</p>
2100      * <p>The entry contains a subset of
2101      * {@link android.hardware.camera2.CameraCharacteristics#getKeys } that require camera clients
2102      * to acquire the {@link android.Manifest.permission#CAMERA } permission before calling
2103      * {@link android.hardware.camera2.CameraManager#getCameraCharacteristics }. If the
2104      * permission is not held by the camera client, then the values of the repsective properties
2105      * will not be present in {@link android.hardware.camera2.CameraCharacteristics }.</p>
2106      * <p>This key is available on all devices.</p>
2107      * @hide
2108      */
2109     public static final Key<int[]> REQUEST_CHARACTERISTIC_KEYS_NEEDING_PERMISSION =
2110             new Key<int[]>("android.request.characteristicKeysNeedingPermission", int[].class);
2111 
2112     /**
2113      * <p>The list of image formats that are supported by this
2114      * camera device for output streams.</p>
2115      * <p>All camera devices will support JPEG and YUV_420_888 formats.</p>
2116      * <p>When set to YUV_420_888, application can access the YUV420 data directly.</p>
2117      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2118      * @deprecated
2119      * <p>Not used in HALv3 or newer</p>
2120 
2121      * @hide
2122      */
2123     @Deprecated
2124     public static final Key<int[]> SCALER_AVAILABLE_FORMATS =
2125             new Key<int[]>("android.scaler.availableFormats", int[].class);
2126 
2127     /**
2128      * <p>The minimum frame duration that is supported
2129      * for each resolution in android.scaler.availableJpegSizes.</p>
2130      * <p>This corresponds to the minimum steady-state frame duration when only
2131      * that JPEG stream is active and captured in a burst, with all
2132      * processing (typically in android.*.mode) set to FAST.</p>
2133      * <p>When multiple streams are configured, the minimum
2134      * frame duration will be &gt;= max(individual stream min
2135      * durations)</p>
2136      * <p><b>Units</b>: Nanoseconds</p>
2137      * <p><b>Range of valid values:</b><br>
2138      * TODO: Remove property.</p>
2139      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2140      * @deprecated
2141      * <p>Not used in HALv3 or newer</p>
2142 
2143      * @hide
2144      */
2145     @Deprecated
2146     public static final Key<long[]> SCALER_AVAILABLE_JPEG_MIN_DURATIONS =
2147             new Key<long[]>("android.scaler.availableJpegMinDurations", long[].class);
2148 
2149     /**
2150      * <p>The JPEG resolutions that are supported by this camera device.</p>
2151      * <p>The resolutions are listed as <code>(width, height)</code> pairs. All camera devices will support
2152      * sensor maximum resolution (defined by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}).</p>
2153      * <p><b>Range of valid values:</b><br>
2154      * TODO: Remove property.</p>
2155      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2156      *
2157      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2158      * @deprecated
2159      * <p>Not used in HALv3 or newer</p>
2160 
2161      * @hide
2162      */
2163     @Deprecated
2164     public static final Key<android.util.Size[]> SCALER_AVAILABLE_JPEG_SIZES =
2165             new Key<android.util.Size[]>("android.scaler.availableJpegSizes", android.util.Size[].class);
2166 
2167     /**
2168      * <p>The maximum ratio between both active area width
2169      * and crop region width, and active area height and
2170      * crop region height, for {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
2171      * <p>This represents the maximum amount of zooming possible by
2172      * the camera device, or equivalently, the minimum cropping
2173      * window size.</p>
2174      * <p>Crop regions that have a width or height that is smaller
2175      * than this ratio allows will be rounded up to the minimum
2176      * allowed size by the camera device.</p>
2177      * <p><b>Units</b>: Zoom scale factor</p>
2178      * <p><b>Range of valid values:</b><br>
2179      * &gt;=1</p>
2180      * <p>This key is available on all devices.</p>
2181      *
2182      * @see CaptureRequest#SCALER_CROP_REGION
2183      */
2184     @PublicKey
2185     @NonNull
2186     public static final Key<Float> SCALER_AVAILABLE_MAX_DIGITAL_ZOOM =
2187             new Key<Float>("android.scaler.availableMaxDigitalZoom", float.class);
2188 
2189     /**
2190      * <p>For each available processed output size (defined in
2191      * android.scaler.availableProcessedSizes), this property lists the
2192      * minimum supportable frame duration for that size.</p>
2193      * <p>This should correspond to the frame duration when only that processed
2194      * stream is active, with all processing (typically in android.*.mode)
2195      * set to FAST.</p>
2196      * <p>When multiple streams are configured, the minimum frame duration will
2197      * be &gt;= max(individual stream min durations).</p>
2198      * <p><b>Units</b>: Nanoseconds</p>
2199      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2200      * @deprecated
2201      * <p>Not used in HALv3 or newer</p>
2202 
2203      * @hide
2204      */
2205     @Deprecated
2206     public static final Key<long[]> SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS =
2207             new Key<long[]>("android.scaler.availableProcessedMinDurations", long[].class);
2208 
2209     /**
2210      * <p>The resolutions available for use with
2211      * processed output streams, such as YV12, NV12, and
2212      * platform opaque YUV/RGB streams to the GPU or video
2213      * encoders.</p>
2214      * <p>The resolutions are listed as <code>(width, height)</code> pairs.</p>
2215      * <p>For a given use case, the actual maximum supported resolution
2216      * may be lower than what is listed here, depending on the destination
2217      * Surface for the image data. For example, for recording video,
2218      * the video encoder chosen may have a maximum size limit (e.g. 1080p)
2219      * smaller than what the camera (e.g. maximum resolution is 3264x2448)
2220      * can provide.</p>
2221      * <p>Please reference the documentation for the image data destination to
2222      * check if it limits the maximum size for image data.</p>
2223      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2224      * @deprecated
2225      * <p>Not used in HALv3 or newer</p>
2226 
2227      * @hide
2228      */
2229     @Deprecated
2230     public static final Key<android.util.Size[]> SCALER_AVAILABLE_PROCESSED_SIZES =
2231             new Key<android.util.Size[]>("android.scaler.availableProcessedSizes", android.util.Size[].class);
2232 
2233     /**
2234      * <p>The mapping of image formats that are supported by this
2235      * camera device for input streams, to their corresponding output formats.</p>
2236      * <p>All camera devices with at least 1
2237      * {@link CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS android.request.maxNumInputStreams} will have at least one
2238      * available input format.</p>
2239      * <p>The camera device will support the following map of formats,
2240      * if its dependent capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}) is supported:</p>
2241      * <table>
2242      * <thead>
2243      * <tr>
2244      * <th align="left">Input Format</th>
2245      * <th align="left">Output Format</th>
2246      * <th align="left">Capability</th>
2247      * </tr>
2248      * </thead>
2249      * <tbody>
2250      * <tr>
2251      * <td align="left">{@link android.graphics.ImageFormat#PRIVATE }</td>
2252      * <td align="left">{@link android.graphics.ImageFormat#JPEG }</td>
2253      * <td align="left">PRIVATE_REPROCESSING</td>
2254      * </tr>
2255      * <tr>
2256      * <td align="left">{@link android.graphics.ImageFormat#PRIVATE }</td>
2257      * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
2258      * <td align="left">PRIVATE_REPROCESSING</td>
2259      * </tr>
2260      * <tr>
2261      * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
2262      * <td align="left">{@link android.graphics.ImageFormat#JPEG }</td>
2263      * <td align="left">YUV_REPROCESSING</td>
2264      * </tr>
2265      * <tr>
2266      * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
2267      * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
2268      * <td align="left">YUV_REPROCESSING</td>
2269      * </tr>
2270      * </tbody>
2271      * </table>
2272      * <p>PRIVATE refers to a device-internal format that is not directly application-visible.  A
2273      * PRIVATE input surface can be acquired by {@link android.media.ImageReader#newInstance }
2274      * with {@link android.graphics.ImageFormat#PRIVATE } as the format.</p>
2275      * <p>For a PRIVATE_REPROCESSING-capable camera device, using the PRIVATE format as either input
2276      * 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>
2277      * <p>Attempting to configure an input stream with output streams not
2278      * listed as available in this map is not valid.</p>
2279      * <p>Additionally, if the camera device is MONOCHROME with Y8 support, it will also support
2280      * the following map of formats if its dependent capability
2281      * ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}) is supported:</p>
2282      * <table>
2283      * <thead>
2284      * <tr>
2285      * <th align="left">Input Format</th>
2286      * <th align="left">Output Format</th>
2287      * <th align="left">Capability</th>
2288      * </tr>
2289      * </thead>
2290      * <tbody>
2291      * <tr>
2292      * <td align="left">{@link android.graphics.ImageFormat#PRIVATE }</td>
2293      * <td align="left">{@link android.graphics.ImageFormat#Y8 }</td>
2294      * <td align="left">PRIVATE_REPROCESSING</td>
2295      * </tr>
2296      * <tr>
2297      * <td align="left">{@link android.graphics.ImageFormat#Y8 }</td>
2298      * <td align="left">{@link android.graphics.ImageFormat#JPEG }</td>
2299      * <td align="left">YUV_REPROCESSING</td>
2300      * </tr>
2301      * <tr>
2302      * <td align="left">{@link android.graphics.ImageFormat#Y8 }</td>
2303      * <td align="left">{@link android.graphics.ImageFormat#Y8 }</td>
2304      * <td align="left">YUV_REPROCESSING</td>
2305      * </tr>
2306      * </tbody>
2307      * </table>
2308      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2309      *
2310      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
2311      * @see CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS
2312      * @hide
2313      */
2314     public static final Key<android.hardware.camera2.params.ReprocessFormatsMap> SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP =
2315             new Key<android.hardware.camera2.params.ReprocessFormatsMap>("android.scaler.availableInputOutputFormatsMap", android.hardware.camera2.params.ReprocessFormatsMap.class);
2316 
2317     /**
2318      * <p>The available stream configurations that this
2319      * camera device supports
2320      * (i.e. format, width, height, output/input stream).</p>
2321      * <p>The configurations are listed as <code>(format, width, height, input?)</code>
2322      * tuples.</p>
2323      * <p>For a given use case, the actual maximum supported resolution
2324      * may be lower than what is listed here, depending on the destination
2325      * Surface for the image data. For example, for recording video,
2326      * the video encoder chosen may have a maximum size limit (e.g. 1080p)
2327      * smaller than what the camera (e.g. maximum resolution is 3264x2448)
2328      * can provide.</p>
2329      * <p>Please reference the documentation for the image data destination to
2330      * check if it limits the maximum size for image data.</p>
2331      * <p>Not all output formats may be supported in a configuration with
2332      * an input stream of a particular format. For more details, see
2333      * android.scaler.availableInputOutputFormatsMap.</p>
2334      * <p>The following table describes the minimum required output stream
2335      * configurations based on the hardware level
2336      * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}):</p>
2337      * <table>
2338      * <thead>
2339      * <tr>
2340      * <th align="center">Format</th>
2341      * <th align="center">Size</th>
2342      * <th align="center">Hardware Level</th>
2343      * <th align="center">Notes</th>
2344      * </tr>
2345      * </thead>
2346      * <tbody>
2347      * <tr>
2348      * <td align="center">JPEG</td>
2349      * <td align="center">{@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</td>
2350      * <td align="center">Any</td>
2351      * <td align="center"></td>
2352      * </tr>
2353      * <tr>
2354      * <td align="center">JPEG</td>
2355      * <td align="center">1920x1080 (1080p)</td>
2356      * <td align="center">Any</td>
2357      * <td align="center">if 1080p &lt;= activeArraySize</td>
2358      * </tr>
2359      * <tr>
2360      * <td align="center">JPEG</td>
2361      * <td align="center">1280x720 (720)</td>
2362      * <td align="center">Any</td>
2363      * <td align="center">if 720p &lt;= activeArraySize</td>
2364      * </tr>
2365      * <tr>
2366      * <td align="center">JPEG</td>
2367      * <td align="center">640x480 (480p)</td>
2368      * <td align="center">Any</td>
2369      * <td align="center">if 480p &lt;= activeArraySize</td>
2370      * </tr>
2371      * <tr>
2372      * <td align="center">JPEG</td>
2373      * <td align="center">320x240 (240p)</td>
2374      * <td align="center">Any</td>
2375      * <td align="center">if 240p &lt;= activeArraySize</td>
2376      * </tr>
2377      * <tr>
2378      * <td align="center">YUV_420_888</td>
2379      * <td align="center">all output sizes available for JPEG</td>
2380      * <td align="center">FULL</td>
2381      * <td align="center"></td>
2382      * </tr>
2383      * <tr>
2384      * <td align="center">YUV_420_888</td>
2385      * <td align="center">all output sizes available for JPEG, up to the maximum video size</td>
2386      * <td align="center">LIMITED</td>
2387      * <td align="center"></td>
2388      * </tr>
2389      * <tr>
2390      * <td align="center">IMPLEMENTATION_DEFINED</td>
2391      * <td align="center">same as YUV_420_888</td>
2392      * <td align="center">Any</td>
2393      * <td align="center"></td>
2394      * </tr>
2395      * </tbody>
2396      * </table>
2397      * <p>Refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} for additional
2398      * mandatory stream configurations on a per-capability basis.</p>
2399      * <p>Exception on 176x144 (QCIF) resolution: camera devices usually have a fixed capability for
2400      * downscaling from larger resolution to smaller, and the QCIF resolution sometimes is not
2401      * fully supported due to this limitation on devices with high-resolution image sensors.
2402      * Therefore, trying to configure a QCIF resolution stream together with any other
2403      * stream larger than 1920x1080 resolution (either width or height) might not be supported,
2404      * and capture session creation will fail if it is not.</p>
2405      * <p>This key is available on all devices.</p>
2406      *
2407      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2408      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
2409      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2410      * @hide
2411      */
2412     public static final Key<android.hardware.camera2.params.StreamConfiguration[]> SCALER_AVAILABLE_STREAM_CONFIGURATIONS =
2413             new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.scaler.availableStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
2414 
2415     /**
2416      * <p>This lists the minimum frame duration for each
2417      * format/size combination.</p>
2418      * <p>This should correspond to the frame duration when only that
2419      * stream is active, with all processing (typically in android.*.mode)
2420      * set to either OFF or FAST.</p>
2421      * <p>When multiple streams are used in a request, the minimum frame
2422      * duration will be max(individual stream min durations).</p>
2423      * <p>The minimum frame duration of a stream (of a particular format, size)
2424      * is the same regardless of whether the stream is input or output.</p>
2425      * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
2426      * android.scaler.availableStallDurations for more details about
2427      * calculating the max frame rate.</p>
2428      * <p><b>Units</b>: (format, width, height, ns) x n</p>
2429      * <p>This key is available on all devices.</p>
2430      *
2431      * @see CaptureRequest#SENSOR_FRAME_DURATION
2432      * @hide
2433      */
2434     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> SCALER_AVAILABLE_MIN_FRAME_DURATIONS =
2435             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.scaler.availableMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
2436 
2437     /**
2438      * <p>This lists the maximum stall duration for each
2439      * output format/size combination.</p>
2440      * <p>A stall duration is how much extra time would get added
2441      * to the normal minimum frame duration for a repeating request
2442      * that has streams with non-zero stall.</p>
2443      * <p>For example, consider JPEG captures which have the following
2444      * characteristics:</p>
2445      * <ul>
2446      * <li>JPEG streams act like processed YUV streams in requests for which
2447      * they are not included; in requests in which they are directly
2448      * referenced, they act as JPEG streams. This is because supporting a
2449      * JPEG stream requires the underlying YUV data to always be ready for
2450      * use by a JPEG encoder, but the encoder will only be used (and impact
2451      * frame duration) on requests that actually reference a JPEG stream.</li>
2452      * <li>The JPEG processor can run concurrently to the rest of the camera
2453      * pipeline, but cannot process more than 1 capture at a time.</li>
2454      * </ul>
2455      * <p>In other words, using a repeating YUV request would result
2456      * in a steady frame rate (let's say it's 30 FPS). If a single
2457      * JPEG request is submitted periodically, the frame rate will stay
2458      * at 30 FPS (as long as we wait for the previous JPEG to return each
2459      * time). If we try to submit a repeating YUV + JPEG request, then
2460      * the frame rate will drop from 30 FPS.</p>
2461      * <p>In general, submitting a new request with a non-0 stall time
2462      * stream will <em>not</em> cause a frame rate drop unless there are still
2463      * outstanding buffers for that stream from previous requests.</p>
2464      * <p>Submitting a repeating request with streams (call this <code>S</code>)
2465      * is the same as setting the minimum frame duration from
2466      * the normal minimum frame duration corresponding to <code>S</code>, added with
2467      * the maximum stall duration for <code>S</code>.</p>
2468      * <p>If interleaving requests with and without a stall duration,
2469      * a request will stall by the maximum of the remaining times
2470      * for each can-stall stream with outstanding buffers.</p>
2471      * <p>This means that a stalling request will not have an exposure start
2472      * until the stall has completed.</p>
2473      * <p>This should correspond to the stall duration when only that stream is
2474      * active, with all processing (typically in android.*.mode) set to FAST
2475      * or OFF. Setting any of the processing modes to HIGH_QUALITY
2476      * effectively results in an indeterminate stall duration for all
2477      * streams in a request (the regular stall calculation rules are
2478      * ignored).</p>
2479      * <p>The following formats may always have a stall duration:</p>
2480      * <ul>
2481      * <li>{@link android.graphics.ImageFormat#JPEG }</li>
2482      * <li>{@link android.graphics.ImageFormat#RAW_SENSOR }</li>
2483      * </ul>
2484      * <p>The following formats will never have a stall duration:</p>
2485      * <ul>
2486      * <li>{@link android.graphics.ImageFormat#YUV_420_888 }</li>
2487      * <li>{@link android.graphics.ImageFormat#RAW10 }</li>
2488      * <li>{@link android.graphics.ImageFormat#RAW12 }</li>
2489      * <li>{@link android.graphics.ImageFormat#Y8 }</li>
2490      * </ul>
2491      * <p>All other formats may or may not have an allowed stall duration on
2492      * a per-capability basis; refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
2493      * for more details.</p>
2494      * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} for more information about
2495      * calculating the max frame rate (absent stalls).</p>
2496      * <p><b>Units</b>: (format, width, height, ns) x n</p>
2497      * <p>This key is available on all devices.</p>
2498      *
2499      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
2500      * @see CaptureRequest#SENSOR_FRAME_DURATION
2501      * @hide
2502      */
2503     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> SCALER_AVAILABLE_STALL_DURATIONS =
2504             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.scaler.availableStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
2505 
2506     /**
2507      * <p>The available stream configurations that this
2508      * camera device supports; also includes the minimum frame durations
2509      * and the stall durations for each format/size combination.</p>
2510      * <p>All camera devices will support sensor maximum resolution (defined by
2511      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}) for the JPEG format.</p>
2512      * <p>For a given use case, the actual maximum supported resolution
2513      * may be lower than what is listed here, depending on the destination
2514      * Surface for the image data. For example, for recording video,
2515      * the video encoder chosen may have a maximum size limit (e.g. 1080p)
2516      * smaller than what the camera (e.g. maximum resolution is 3264x2448)
2517      * can provide.</p>
2518      * <p>Please reference the documentation for the image data destination to
2519      * check if it limits the maximum size for image data.</p>
2520      * <p>The following table describes the minimum required output stream
2521      * configurations based on the hardware level
2522      * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}):</p>
2523      * <table>
2524      * <thead>
2525      * <tr>
2526      * <th align="center">Format</th>
2527      * <th align="center">Size</th>
2528      * <th align="center">Hardware Level</th>
2529      * <th align="center">Notes</th>
2530      * </tr>
2531      * </thead>
2532      * <tbody>
2533      * <tr>
2534      * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
2535      * <td align="center">{@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} (*1)</td>
2536      * <td align="center">Any</td>
2537      * <td align="center"></td>
2538      * </tr>
2539      * <tr>
2540      * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
2541      * <td align="center">1920x1080 (1080p)</td>
2542      * <td align="center">Any</td>
2543      * <td align="center">if 1080p &lt;= activeArraySize</td>
2544      * </tr>
2545      * <tr>
2546      * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
2547      * <td align="center">1280x720 (720p)</td>
2548      * <td align="center">Any</td>
2549      * <td align="center">if 720p &lt;= activeArraySize</td>
2550      * </tr>
2551      * <tr>
2552      * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
2553      * <td align="center">640x480 (480p)</td>
2554      * <td align="center">Any</td>
2555      * <td align="center">if 480p &lt;= activeArraySize</td>
2556      * </tr>
2557      * <tr>
2558      * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
2559      * <td align="center">320x240 (240p)</td>
2560      * <td align="center">Any</td>
2561      * <td align="center">if 240p &lt;= activeArraySize</td>
2562      * </tr>
2563      * <tr>
2564      * <td align="center">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
2565      * <td align="center">all output sizes available for JPEG</td>
2566      * <td align="center">FULL</td>
2567      * <td align="center"></td>
2568      * </tr>
2569      * <tr>
2570      * <td align="center">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
2571      * <td align="center">all output sizes available for JPEG, up to the maximum video size</td>
2572      * <td align="center">LIMITED</td>
2573      * <td align="center"></td>
2574      * </tr>
2575      * <tr>
2576      * <td align="center">{@link android.graphics.ImageFormat#PRIVATE }</td>
2577      * <td align="center">same as YUV_420_888</td>
2578      * <td align="center">Any</td>
2579      * <td align="center"></td>
2580      * </tr>
2581      * </tbody>
2582      * </table>
2583      * <p>Refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} and {@link android.hardware.camera2.CameraDevice#createCaptureSession } for additional mandatory
2584      * stream configurations on a per-capability basis.</p>
2585      * <p>*1: For JPEG format, the sizes may be restricted by below conditions:</p>
2586      * <ul>
2587      * <li>The HAL may choose the aspect ratio of each Jpeg size to be one of well known ones
2588      * (e.g. 4:3, 16:9, 3:2 etc.). If the sensor maximum resolution
2589      * (defined by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}) has an aspect ratio other than these,
2590      * it does not have to be included in the supported JPEG sizes.</li>
2591      * <li>Some hardware JPEG encoders may have pixel boundary alignment requirements, such as
2592      * the dimensions being a multiple of 16.
2593      * Therefore, the maximum JPEG size may be smaller than sensor maximum resolution.
2594      * However, the largest JPEG size will be as close as possible to the sensor maximum
2595      * resolution given above constraints. It is required that after aspect ratio adjustments,
2596      * additional size reduction due to other issues must be less than 3% in area. For example,
2597      * if the sensor maximum resolution is 3280x2464, if the maximum JPEG size has aspect
2598      * ratio 4:3, and the JPEG encoder alignment requirement is 16, the maximum JPEG size will be
2599      * 3264x2448.</li>
2600      * </ul>
2601      * <p>Exception on 176x144 (QCIF) resolution: camera devices usually have a fixed capability on
2602      * downscaling from larger resolution to smaller ones, and the QCIF resolution can sometimes
2603      * not be fully supported due to this limitation on devices with high-resolution image
2604      * sensors. Therefore, trying to configure a QCIF resolution stream together with any other
2605      * stream larger than 1920x1080 resolution (either width or height) might not be supported,
2606      * and capture session creation will fail if it is not.</p>
2607      * <p>This key is available on all devices.</p>
2608      *
2609      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2610      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
2611      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2612      */
2613     @PublicKey
2614     @NonNull
2615     @SyntheticKey
2616     public static final Key<android.hardware.camera2.params.StreamConfigurationMap> SCALER_STREAM_CONFIGURATION_MAP =
2617             new Key<android.hardware.camera2.params.StreamConfigurationMap>("android.scaler.streamConfigurationMap", android.hardware.camera2.params.StreamConfigurationMap.class);
2618 
2619     /**
2620      * <p>The crop type that this camera device supports.</p>
2621      * <p>When passing a non-centered crop region ({@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}) to a camera
2622      * device that only supports CENTER_ONLY cropping, the camera device will move the
2623      * crop region to the center of the sensor active array ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize})
2624      * and keep the crop region width and height unchanged. The camera device will return the
2625      * final used crop region in metadata result {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
2626      * <p>Camera devices that support FREEFORM cropping will support any crop region that
2627      * is inside of the active array. The camera device will apply the same crop region and
2628      * return the final used crop region in capture result metadata {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
2629      * <p>LEGACY capability devices will only support CENTER_ONLY cropping.</p>
2630      * <p><b>Possible values:</b>
2631      * <ul>
2632      *   <li>{@link #SCALER_CROPPING_TYPE_CENTER_ONLY CENTER_ONLY}</li>
2633      *   <li>{@link #SCALER_CROPPING_TYPE_FREEFORM FREEFORM}</li>
2634      * </ul></p>
2635      * <p>This key is available on all devices.</p>
2636      *
2637      * @see CaptureRequest#SCALER_CROP_REGION
2638      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2639      * @see #SCALER_CROPPING_TYPE_CENTER_ONLY
2640      * @see #SCALER_CROPPING_TYPE_FREEFORM
2641      */
2642     @PublicKey
2643     @NonNull
2644     public static final Key<Integer> SCALER_CROPPING_TYPE =
2645             new Key<Integer>("android.scaler.croppingType", int.class);
2646 
2647     /**
2648      * <p>Recommended stream configurations for common client use cases.</p>
2649      * <p>Optional subset of the android.scaler.availableStreamConfigurations that contains
2650      * similar tuples listed as
2651      * (i.e. width, height, format, output/input stream, usecase bit field).
2652      * Camera devices will be able to suggest particular stream configurations which are
2653      * power and performance efficient for specific use cases. For more information about
2654      * retrieving the suggestions see
2655      * {@link android.hardware.camera2.CameraCharacteristics#getRecommendedStreamConfigurationMap }.</p>
2656      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2657      * @hide
2658      */
2659     public static final Key<android.hardware.camera2.params.RecommendedStreamConfiguration[]> SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS =
2660             new Key<android.hardware.camera2.params.RecommendedStreamConfiguration[]>("android.scaler.availableRecommendedStreamConfigurations", android.hardware.camera2.params.RecommendedStreamConfiguration[].class);
2661 
2662     /**
2663      * <p>Recommended mappings of image formats that are supported by this
2664      * camera device for input streams, to their corresponding output formats.</p>
2665      * <p>This is a recommended subset of the complete list of mappings found in
2666      * android.scaler.availableInputOutputFormatsMap. The same requirements apply here as well.
2667      * The list however doesn't need to contain all available and supported mappings. Instead of
2668      * this developers must list only recommended and efficient entries.
2669      * If set, the information will be available in the ZERO_SHUTTER_LAG recommended stream
2670      * configuration see
2671      * {@link android.hardware.camera2.CameraCharacteristics#getRecommendedStreamConfigurationMap }.</p>
2672      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2673      * @hide
2674      */
2675     public static final Key<android.hardware.camera2.params.ReprocessFormatsMap> SCALER_AVAILABLE_RECOMMENDED_INPUT_OUTPUT_FORMATS_MAP =
2676             new Key<android.hardware.camera2.params.ReprocessFormatsMap>("android.scaler.availableRecommendedInputOutputFormatsMap", android.hardware.camera2.params.ReprocessFormatsMap.class);
2677 
2678     /**
2679      * <p>An array of mandatory stream combinations generated according to the camera device
2680      * {@link android.hardware.camera2.CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL }
2681      * and {@link android.hardware.camera2.CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES }.
2682      * This is an app-readable conversion of the mandatory stream combination
2683      * {@link android.hardware.camera2.CameraDevice#createCaptureSession tables}.</p>
2684      * <p>The array of
2685      * {@link android.hardware.camera2.params.MandatoryStreamCombination combinations} is
2686      * generated according to the documented
2687      * {@link android.hardware.camera2.CameraDevice#createCaptureSession guideline} based on
2688      * specific device level and capabilities.
2689      * Clients can use the array as a quick reference to find an appropriate camera stream
2690      * combination.
2691      * As per documentation, the stream combinations with given PREVIEW, RECORD and
2692      * MAXIMUM resolutions and anything smaller from the list given by
2693      * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes } are
2694      * guaranteed to work.
2695      * For a physical camera not independently exposed in
2696      * {@link android.hardware.camera2.CameraManager#getCameraIdList }, the mandatory stream
2697      * combinations for that physical camera Id are also generated, so that the application can
2698      * configure them as physical streams via the logical camera.
2699      * The mandatory stream combination array will be {@code null} in case the device is not
2700      * backward compatible.</p>
2701      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2702      * <p><b>Limited capability</b> -
2703      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2704      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2705      *
2706      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2707      */
2708     @PublicKey
2709     @NonNull
2710     @SyntheticKey
2711     public static final Key<android.hardware.camera2.params.MandatoryStreamCombination[]> SCALER_MANDATORY_STREAM_COMBINATIONS =
2712             new Key<android.hardware.camera2.params.MandatoryStreamCombination[]>("android.scaler.mandatoryStreamCombinations", android.hardware.camera2.params.MandatoryStreamCombination[].class);
2713 
2714     /**
2715      * <p>The area of the image sensor which corresponds to active pixels after any geometric
2716      * distortion correction has been applied.</p>
2717      * <p>This is the rectangle representing the size of the active region of the sensor (i.e.
2718      * the region that actually receives light from the scene) after any geometric correction
2719      * has been applied, and should be treated as the maximum size in pixels of any of the
2720      * image output formats aside from the raw formats.</p>
2721      * <p>This rectangle is defined relative to the full pixel array; (0,0) is the top-left of
2722      * the full pixel array, and the size of the full pixel array is given by
2723      * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
2724      * <p>The coordinate system for most other keys that list pixel coordinates, including
2725      * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, is defined relative to the active array rectangle given in
2726      * this field, with <code>(0, 0)</code> being the top-left of this rectangle.</p>
2727      * <p>The active array may be smaller than the full pixel array, since the full array may
2728      * include black calibration pixels or other inactive regions.</p>
2729      * <p>For devices that do not support {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the active
2730      * array must be the same as {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.</p>
2731      * <p>For devices that support {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the active array must
2732      * be enclosed by {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}. The difference between
2733      * pre-correction active array and active array accounts for scaling or cropping caused
2734      * by lens geometric distortion correction.</p>
2735      * <p>In general, application should always refer to active array size for controls like
2736      * metering regions or crop region. Two exceptions are when the application is dealing with
2737      * RAW image buffers (RAW_SENSOR, RAW10, RAW12 etc), or when application explicitly set
2738      * {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} to OFF. In these cases, application should refer
2739      * to {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.</p>
2740      * <p><b>Units</b>: Pixel coordinates on the image sensor</p>
2741      * <p>This key is available on all devices.</p>
2742      *
2743      * @see CaptureRequest#DISTORTION_CORRECTION_MODE
2744      * @see CaptureRequest#SCALER_CROP_REGION
2745      * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
2746      * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
2747      */
2748     @PublicKey
2749     @NonNull
2750     public static final Key<android.graphics.Rect> SENSOR_INFO_ACTIVE_ARRAY_SIZE =
2751             new Key<android.graphics.Rect>("android.sensor.info.activeArraySize", android.graphics.Rect.class);
2752 
2753     /**
2754      * <p>Range of sensitivities for {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} supported by this
2755      * camera device.</p>
2756      * <p>The values are the standard ISO sensitivity values,
2757      * as defined in ISO 12232:2006.</p>
2758      * <p><b>Range of valid values:</b><br>
2759      * Min &lt;= 100, Max &gt;= 800</p>
2760      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2761      * <p><b>Full capability</b> -
2762      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2763      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2764      *
2765      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2766      * @see CaptureRequest#SENSOR_SENSITIVITY
2767      */
2768     @PublicKey
2769     @NonNull
2770     public static final Key<android.util.Range<Integer>> SENSOR_INFO_SENSITIVITY_RANGE =
2771             new Key<android.util.Range<Integer>>("android.sensor.info.sensitivityRange", new TypeReference<android.util.Range<Integer>>() {{ }});
2772 
2773     /**
2774      * <p>The arrangement of color filters on sensor;
2775      * represents the colors in the top-left 2x2 section of
2776      * the sensor, in reading order, for a Bayer camera, or the
2777      * light spectrum it captures for MONOCHROME camera.</p>
2778      * <p><b>Possible values:</b>
2779      * <ul>
2780      *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB RGGB}</li>
2781      *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG GRBG}</li>
2782      *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG GBRG}</li>
2783      *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR BGGR}</li>
2784      *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB RGB}</li>
2785      *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_MONO MONO}</li>
2786      *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_NIR NIR}</li>
2787      * </ul></p>
2788      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2789      * <p><b>Full capability</b> -
2790      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2791      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2792      *
2793      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2794      * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB
2795      * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG
2796      * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG
2797      * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR
2798      * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB
2799      * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_MONO
2800      * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_NIR
2801      */
2802     @PublicKey
2803     @NonNull
2804     public static final Key<Integer> SENSOR_INFO_COLOR_FILTER_ARRANGEMENT =
2805             new Key<Integer>("android.sensor.info.colorFilterArrangement", int.class);
2806 
2807     /**
2808      * <p>The range of image exposure times for {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} supported
2809      * by this camera device.</p>
2810      * <p><b>Units</b>: Nanoseconds</p>
2811      * <p><b>Range of valid values:</b><br>
2812      * The minimum exposure time will be less than 100 us. For FULL
2813      * capability devices ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL),
2814      * the maximum exposure time will be greater than 100ms.</p>
2815      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2816      * <p><b>Full capability</b> -
2817      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2818      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2819      *
2820      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2821      * @see CaptureRequest#SENSOR_EXPOSURE_TIME
2822      */
2823     @PublicKey
2824     @NonNull
2825     public static final Key<android.util.Range<Long>> SENSOR_INFO_EXPOSURE_TIME_RANGE =
2826             new Key<android.util.Range<Long>>("android.sensor.info.exposureTimeRange", new TypeReference<android.util.Range<Long>>() {{ }});
2827 
2828     /**
2829      * <p>The maximum possible frame duration (minimum frame rate) for
2830      * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} that is supported this camera device.</p>
2831      * <p>Attempting to use frame durations beyond the maximum will result in the frame
2832      * duration being clipped to the maximum. See that control for a full definition of frame
2833      * durations.</p>
2834      * <p>Refer to {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }
2835      * for the minimum frame duration values.</p>
2836      * <p><b>Units</b>: Nanoseconds</p>
2837      * <p><b>Range of valid values:</b><br>
2838      * For FULL capability devices
2839      * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL), at least 100ms.</p>
2840      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2841      * <p><b>Full capability</b> -
2842      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2843      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2844      *
2845      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2846      * @see CaptureRequest#SENSOR_FRAME_DURATION
2847      */
2848     @PublicKey
2849     @NonNull
2850     public static final Key<Long> SENSOR_INFO_MAX_FRAME_DURATION =
2851             new Key<Long>("android.sensor.info.maxFrameDuration", long.class);
2852 
2853     /**
2854      * <p>The physical dimensions of the full pixel
2855      * array.</p>
2856      * <p>This is the physical size of the sensor pixel
2857      * array defined by {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
2858      * <p><b>Units</b>: Millimeters</p>
2859      * <p>This key is available on all devices.</p>
2860      *
2861      * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
2862      */
2863     @PublicKey
2864     @NonNull
2865     public static final Key<android.util.SizeF> SENSOR_INFO_PHYSICAL_SIZE =
2866             new Key<android.util.SizeF>("android.sensor.info.physicalSize", android.util.SizeF.class);
2867 
2868     /**
2869      * <p>Dimensions of the full pixel array, possibly
2870      * including black calibration pixels.</p>
2871      * <p>The pixel count of the full pixel array of the image sensor, which covers
2872      * {@link CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE android.sensor.info.physicalSize} area.  This represents the full pixel dimensions of
2873      * the raw buffers produced by this sensor.</p>
2874      * <p>If a camera device supports raw sensor formats, either this or
2875      * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} is the maximum dimensions for the raw
2876      * output formats listed in {@link android.hardware.camera2.params.StreamConfigurationMap }
2877      * (this depends on whether or not the image sensor returns buffers containing pixels that
2878      * are not part of the active array region for blacklevel calibration or other purposes).</p>
2879      * <p>Some parts of the full pixel array may not receive light from the scene,
2880      * or be otherwise inactive.  The {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} key
2881      * defines the rectangle of active pixels that will be included in processed image
2882      * formats.</p>
2883      * <p><b>Units</b>: Pixels</p>
2884      * <p>This key is available on all devices.</p>
2885      *
2886      * @see CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE
2887      * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
2888      */
2889     @PublicKey
2890     @NonNull
2891     public static final Key<android.util.Size> SENSOR_INFO_PIXEL_ARRAY_SIZE =
2892             new Key<android.util.Size>("android.sensor.info.pixelArraySize", android.util.Size.class);
2893 
2894     /**
2895      * <p>Maximum raw value output by sensor.</p>
2896      * <p>This specifies the fully-saturated encoding level for the raw
2897      * sample values from the sensor.  This is typically caused by the
2898      * sensor becoming highly non-linear or clipping. The minimum for
2899      * each channel is specified by the offset in the
2900      * {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} key.</p>
2901      * <p>The white level is typically determined either by sensor bit depth
2902      * (8-14 bits is expected), or by the point where the sensor response
2903      * becomes too non-linear to be useful.  The default value for this is
2904      * maximum representable value for a 16-bit raw sample (2^16 - 1).</p>
2905      * <p>The white level values of captured images may vary for different
2906      * capture settings (e.g., {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}). This key
2907      * represents a coarse approximation for such case. It is recommended
2908      * to use {@link CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL android.sensor.dynamicWhiteLevel} for captures when supported
2909      * by the camera device, which provides more accurate white level values.</p>
2910      * <p><b>Range of valid values:</b><br>
2911      * &gt; 255 (8-bit output)</p>
2912      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2913      *
2914      * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
2915      * @see CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL
2916      * @see CaptureRequest#SENSOR_SENSITIVITY
2917      */
2918     @PublicKey
2919     @NonNull
2920     public static final Key<Integer> SENSOR_INFO_WHITE_LEVEL =
2921             new Key<Integer>("android.sensor.info.whiteLevel", int.class);
2922 
2923     /**
2924      * <p>The time base source for sensor capture start timestamps.</p>
2925      * <p>The timestamps provided for captures are always in nanoseconds and monotonic, but
2926      * may not based on a time source that can be compared to other system time sources.</p>
2927      * <p>This characteristic defines the source for the timestamps, and therefore whether they
2928      * can be compared against other system time sources/timestamps.</p>
2929      * <p><b>Possible values:</b>
2930      * <ul>
2931      *   <li>{@link #SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN UNKNOWN}</li>
2932      *   <li>{@link #SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME REALTIME}</li>
2933      * </ul></p>
2934      * <p>This key is available on all devices.</p>
2935      * @see #SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN
2936      * @see #SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME
2937      */
2938     @PublicKey
2939     @NonNull
2940     public static final Key<Integer> SENSOR_INFO_TIMESTAMP_SOURCE =
2941             new Key<Integer>("android.sensor.info.timestampSource", int.class);
2942 
2943     /**
2944      * <p>Whether the RAW images output from this camera device are subject to
2945      * lens shading correction.</p>
2946      * <p>If TRUE, all images produced by the camera device in the RAW image formats will
2947      * have lens shading correction already applied to it. If FALSE, the images will
2948      * not be adjusted for lens shading correction.
2949      * See {@link CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW android.request.maxNumOutputRaw} for a list of RAW image formats.</p>
2950      * <p>This key will be <code>null</code> for all devices do not report this information.
2951      * Devices with RAW capability will always report this information in this key.</p>
2952      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2953      *
2954      * @see CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW
2955      */
2956     @PublicKey
2957     @NonNull
2958     public static final Key<Boolean> SENSOR_INFO_LENS_SHADING_APPLIED =
2959             new Key<Boolean>("android.sensor.info.lensShadingApplied", boolean.class);
2960 
2961     /**
2962      * <p>The area of the image sensor which corresponds to active pixels prior to the
2963      * application of any geometric distortion correction.</p>
2964      * <p>This is the rectangle representing the size of the active region of the sensor (i.e.
2965      * the region that actually receives light from the scene) before any geometric correction
2966      * has been applied, and should be treated as the active region rectangle for any of the
2967      * raw formats.  All metadata associated with raw processing (e.g. the lens shading
2968      * correction map, and radial distortion fields) treats the top, left of this rectangle as
2969      * the origin, (0,0).</p>
2970      * <p>The size of this region determines the maximum field of view and the maximum number of
2971      * pixels that an image from this sensor can contain, prior to the application of
2972      * geometric distortion correction. The effective maximum pixel dimensions of a
2973      * post-distortion-corrected image is given by the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}
2974      * field, and the effective maximum field of view for a post-distortion-corrected image
2975      * can be calculated by applying the geometric distortion correction fields to this
2976      * rectangle, and cropping to the rectangle given in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
2977      * <p>E.g. to calculate position of a pixel, (x,y), in a processed YUV output image with the
2978      * dimensions in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} given the position of a pixel,
2979      * (x', y'), in the raw pixel array with dimensions give in
2980      * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}:</p>
2981      * <ol>
2982      * <li>Choose a pixel (x', y') within the active array region of the raw buffer given in
2983      * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, otherwise this pixel is considered
2984      * to be outside of the FOV, and will not be shown in the processed output image.</li>
2985      * <li>Apply geometric distortion correction to get the post-distortion pixel coordinate,
2986      * (x_i, y_i). When applying geometric correction metadata, note that metadata for raw
2987      * buffers is defined relative to the top, left of the
2988      * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} rectangle.</li>
2989      * <li>If the resulting corrected pixel coordinate is within the region given in
2990      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, then the position of this pixel in the
2991      * processed output image buffer is <code>(x_i - activeArray.left, y_i - activeArray.top)</code>,
2992      * when the top, left coordinate of that buffer is treated as (0, 0).</li>
2993      * </ol>
2994      * <p>Thus, for pixel x',y' = (25, 25) on a sensor where {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}
2995      * is (100,100), {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} is (10, 10, 100, 100),
2996      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} is (20, 20, 80, 80), and the geometric distortion
2997      * correction doesn't change the pixel coordinate, the resulting pixel selected in
2998      * pixel coordinates would be x,y = (25, 25) relative to the top,left of the raw buffer
2999      * with dimensions given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}, and would be (5, 5)
3000      * relative to the top,left of post-processed YUV output buffer with dimensions given in
3001      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
3002      * <p>The currently supported fields that correct for geometric distortion are:</p>
3003      * <ol>
3004      * <li>{@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion}.</li>
3005      * </ol>
3006      * <p>If the camera device doesn't support geometric distortion correction, or all of the
3007      * geometric distortion fields are no-ops, this rectangle will be the same as the
3008      * post-distortion-corrected rectangle given in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
3009      * <p>This rectangle is defined relative to the full pixel array; (0,0) is the top-left of
3010      * the full pixel array, and the size of the full pixel array is given by
3011      * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
3012      * <p>The pre-correction active array may be smaller than the full pixel array, since the
3013      * full array may include black calibration pixels or other inactive regions.</p>
3014      * <p><b>Units</b>: Pixel coordinates on the image sensor</p>
3015      * <p>This key is available on all devices.</p>
3016      *
3017      * @see CameraCharacteristics#LENS_DISTORTION
3018      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3019      * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
3020      * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
3021      */
3022     @PublicKey
3023     @NonNull
3024     public static final Key<android.graphics.Rect> SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE =
3025             new Key<android.graphics.Rect>("android.sensor.info.preCorrectionActiveArraySize", android.graphics.Rect.class);
3026 
3027     /**
3028      * <p>The standard reference illuminant used as the scene light source when
3029      * calculating the {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM1 android.sensor.colorTransform1},
3030      * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1 android.sensor.calibrationTransform1}, and
3031      * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX1 android.sensor.forwardMatrix1} matrices.</p>
3032      * <p>The values in this key correspond to the values defined for the
3033      * EXIF LightSource tag. These illuminants are standard light sources
3034      * that are often used calibrating camera devices.</p>
3035      * <p>If this key is present, then {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM1 android.sensor.colorTransform1},
3036      * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1 android.sensor.calibrationTransform1}, and
3037      * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX1 android.sensor.forwardMatrix1} will also be present.</p>
3038      * <p>Some devices may choose to provide a second set of calibration
3039      * information for improved quality, including
3040      * {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2} and its corresponding matrices.</p>
3041      * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3042      * the camera device has RAW capability.</p>
3043      * <p><b>Possible values:</b>
3044      * <ul>
3045      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT DAYLIGHT}</li>
3046      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT FLUORESCENT}</li>
3047      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN TUNGSTEN}</li>
3048      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FLASH FLASH}</li>
3049      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER FINE_WEATHER}</li>
3050      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER CLOUDY_WEATHER}</li>
3051      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_SHADE SHADE}</li>
3052      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT DAYLIGHT_FLUORESCENT}</li>
3053      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT DAY_WHITE_FLUORESCENT}</li>
3054      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT COOL_WHITE_FLUORESCENT}</li>
3055      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT WHITE_FLUORESCENT}</li>
3056      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A STANDARD_A}</li>
3057      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B STANDARD_B}</li>
3058      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C STANDARD_C}</li>
3059      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D55 D55}</li>
3060      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D65 D65}</li>
3061      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D75 D75}</li>
3062      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D50 D50}</li>
3063      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN ISO_STUDIO_TUNGSTEN}</li>
3064      * </ul></p>
3065      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3066      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
3067      *
3068      * @see CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1
3069      * @see CameraCharacteristics#SENSOR_COLOR_TRANSFORM1
3070      * @see CameraCharacteristics#SENSOR_FORWARD_MATRIX1
3071      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
3072      * @see #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT
3073      * @see #SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT
3074      * @see #SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN
3075      * @see #SENSOR_REFERENCE_ILLUMINANT1_FLASH
3076      * @see #SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER
3077      * @see #SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER
3078      * @see #SENSOR_REFERENCE_ILLUMINANT1_SHADE
3079      * @see #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT
3080      * @see #SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT
3081      * @see #SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT
3082      * @see #SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT
3083      * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A
3084      * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B
3085      * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C
3086      * @see #SENSOR_REFERENCE_ILLUMINANT1_D55
3087      * @see #SENSOR_REFERENCE_ILLUMINANT1_D65
3088      * @see #SENSOR_REFERENCE_ILLUMINANT1_D75
3089      * @see #SENSOR_REFERENCE_ILLUMINANT1_D50
3090      * @see #SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN
3091      */
3092     @PublicKey
3093     @NonNull
3094     public static final Key<Integer> SENSOR_REFERENCE_ILLUMINANT1 =
3095             new Key<Integer>("android.sensor.referenceIlluminant1", int.class);
3096 
3097     /**
3098      * <p>The standard reference illuminant used as the scene light source when
3099      * calculating the {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM2 android.sensor.colorTransform2},
3100      * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2 android.sensor.calibrationTransform2}, and
3101      * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX2 android.sensor.forwardMatrix2} matrices.</p>
3102      * <p>See {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1} for more details.</p>
3103      * <p>If this key is present, then {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM2 android.sensor.colorTransform2},
3104      * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2 android.sensor.calibrationTransform2}, and
3105      * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX2 android.sensor.forwardMatrix2} will also be present.</p>
3106      * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3107      * the camera device has RAW capability.</p>
3108      * <p><b>Range of valid values:</b><br>
3109      * Any value listed in {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}</p>
3110      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3111      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
3112      *
3113      * @see CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2
3114      * @see CameraCharacteristics#SENSOR_COLOR_TRANSFORM2
3115      * @see CameraCharacteristics#SENSOR_FORWARD_MATRIX2
3116      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
3117      */
3118     @PublicKey
3119     @NonNull
3120     public static final Key<Byte> SENSOR_REFERENCE_ILLUMINANT2 =
3121             new Key<Byte>("android.sensor.referenceIlluminant2", byte.class);
3122 
3123     /**
3124      * <p>A per-device calibration transform matrix that maps from the
3125      * reference sensor colorspace to the actual device sensor colorspace.</p>
3126      * <p>This matrix is used to correct for per-device variations in the
3127      * sensor colorspace, and is used for processing raw buffer data.</p>
3128      * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
3129      * contains a per-device calibration transform that maps colors
3130      * from reference sensor color space (i.e. the "golden module"
3131      * colorspace) into this camera device's native sensor color
3132      * space under the first reference illuminant
3133      * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}).</p>
3134      * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3135      * the camera device has RAW capability.</p>
3136      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3137      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
3138      *
3139      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
3140      */
3141     @PublicKey
3142     @NonNull
3143     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_CALIBRATION_TRANSFORM1 =
3144             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.calibrationTransform1", android.hardware.camera2.params.ColorSpaceTransform.class);
3145 
3146     /**
3147      * <p>A per-device calibration transform matrix that maps from the
3148      * reference sensor colorspace to the actual device sensor colorspace
3149      * (this is the colorspace of the raw buffer data).</p>
3150      * <p>This matrix is used to correct for per-device variations in the
3151      * sensor colorspace, and is used for processing raw buffer data.</p>
3152      * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
3153      * contains a per-device calibration transform that maps colors
3154      * from reference sensor color space (i.e. the "golden module"
3155      * colorspace) into this camera device's native sensor color
3156      * space under the second reference illuminant
3157      * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2}).</p>
3158      * <p>This matrix will only be present if the second reference
3159      * illuminant is present.</p>
3160      * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3161      * the camera device has RAW capability.</p>
3162      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3163      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
3164      *
3165      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
3166      */
3167     @PublicKey
3168     @NonNull
3169     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_CALIBRATION_TRANSFORM2 =
3170             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.calibrationTransform2", android.hardware.camera2.params.ColorSpaceTransform.class);
3171 
3172     /**
3173      * <p>A matrix that transforms color values from CIE XYZ color space to
3174      * reference sensor color space.</p>
3175      * <p>This matrix is used to convert from the standard CIE XYZ color
3176      * space to the reference sensor colorspace, and is used when processing
3177      * raw buffer data.</p>
3178      * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
3179      * contains a color transform matrix that maps colors from the CIE
3180      * XYZ color space to the reference sensor color space (i.e. the
3181      * "golden module" colorspace) under the first reference illuminant
3182      * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}).</p>
3183      * <p>The white points chosen in both the reference sensor color space
3184      * and the CIE XYZ colorspace when calculating this transform will
3185      * match the standard white point for the first reference illuminant
3186      * (i.e. no chromatic adaptation will be applied by this transform).</p>
3187      * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3188      * the camera device has RAW capability.</p>
3189      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3190      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
3191      *
3192      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
3193      */
3194     @PublicKey
3195     @NonNull
3196     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_COLOR_TRANSFORM1 =
3197             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.colorTransform1", android.hardware.camera2.params.ColorSpaceTransform.class);
3198 
3199     /**
3200      * <p>A matrix that transforms color values from CIE XYZ color space to
3201      * reference sensor color space.</p>
3202      * <p>This matrix is used to convert from the standard CIE XYZ color
3203      * space to the reference sensor colorspace, and is used when processing
3204      * raw buffer data.</p>
3205      * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
3206      * contains a color transform matrix that maps colors from the CIE
3207      * XYZ color space to the reference sensor color space (i.e. the
3208      * "golden module" colorspace) under the second reference illuminant
3209      * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2}).</p>
3210      * <p>The white points chosen in both the reference sensor color space
3211      * and the CIE XYZ colorspace when calculating this transform will
3212      * match the standard white point for the second reference illuminant
3213      * (i.e. no chromatic adaptation will be applied by this transform).</p>
3214      * <p>This matrix will only be present if the second reference
3215      * illuminant is present.</p>
3216      * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3217      * the camera device has RAW capability.</p>
3218      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3219      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
3220      *
3221      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
3222      */
3223     @PublicKey
3224     @NonNull
3225     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_COLOR_TRANSFORM2 =
3226             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.colorTransform2", android.hardware.camera2.params.ColorSpaceTransform.class);
3227 
3228     /**
3229      * <p>A matrix that transforms white balanced camera colors from the reference
3230      * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.</p>
3231      * <p>This matrix is used to convert to the standard CIE XYZ colorspace, and
3232      * is used when processing raw buffer data.</p>
3233      * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and contains
3234      * a color transform matrix that maps white balanced colors from the
3235      * reference sensor color space to the CIE XYZ color space with a D50 white
3236      * point.</p>
3237      * <p>Under the first reference illuminant ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1})
3238      * this matrix is chosen so that the standard white point for this reference
3239      * illuminant in the reference sensor colorspace is mapped to D50 in the
3240      * CIE XYZ colorspace.</p>
3241      * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3242      * the camera device has RAW capability.</p>
3243      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3244      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
3245      *
3246      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
3247      */
3248     @PublicKey
3249     @NonNull
3250     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_FORWARD_MATRIX1 =
3251             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.forwardMatrix1", android.hardware.camera2.params.ColorSpaceTransform.class);
3252 
3253     /**
3254      * <p>A matrix that transforms white balanced camera colors from the reference
3255      * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.</p>
3256      * <p>This matrix is used to convert to the standard CIE XYZ colorspace, and
3257      * is used when processing raw buffer data.</p>
3258      * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and contains
3259      * a color transform matrix that maps white balanced colors from the
3260      * reference sensor color space to the CIE XYZ color space with a D50 white
3261      * point.</p>
3262      * <p>Under the second reference illuminant ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2})
3263      * this matrix is chosen so that the standard white point for this reference
3264      * illuminant in the reference sensor colorspace is mapped to D50 in the
3265      * CIE XYZ colorspace.</p>
3266      * <p>This matrix will only be present if the second reference
3267      * illuminant is present.</p>
3268      * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
3269      * the camera device has RAW capability.</p>
3270      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3271      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
3272      *
3273      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
3274      */
3275     @PublicKey
3276     @NonNull
3277     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_FORWARD_MATRIX2 =
3278             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.forwardMatrix2", android.hardware.camera2.params.ColorSpaceTransform.class);
3279 
3280     /**
3281      * <p>A fixed black level offset for each of the color filter arrangement
3282      * (CFA) mosaic channels.</p>
3283      * <p>This key specifies the zero light value for each of the CFA mosaic
3284      * channels in the camera sensor.  The maximal value output by the
3285      * sensor is represented by the value in {@link CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL android.sensor.info.whiteLevel}.</p>
3286      * <p>The values are given in the same order as channels listed for the CFA
3287      * layout key (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}), i.e. the
3288      * nth value given corresponds to the black level offset for the nth
3289      * color channel listed in the CFA.</p>
3290      * <p>The black level values of captured images may vary for different
3291      * capture settings (e.g., {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}). This key
3292      * represents a coarse approximation for such case. It is recommended to
3293      * use {@link CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL android.sensor.dynamicBlackLevel} or use pixels from
3294      * {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} directly for captures when
3295      * supported by the camera device, which provides more accurate black
3296      * level values. For raw capture in particular, it is recommended to use
3297      * pixels from {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} to calculate black
3298      * level values for each frame.</p>
3299      * <p>For a MONOCHROME camera device, all of the 2x2 channels must have the same values.</p>
3300      * <p><b>Range of valid values:</b><br>
3301      * &gt;= 0 for each.</p>
3302      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3303      *
3304      * @see CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL
3305      * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
3306      * @see CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL
3307      * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS
3308      * @see CaptureRequest#SENSOR_SENSITIVITY
3309      */
3310     @PublicKey
3311     @NonNull
3312     public static final Key<android.hardware.camera2.params.BlackLevelPattern> SENSOR_BLACK_LEVEL_PATTERN =
3313             new Key<android.hardware.camera2.params.BlackLevelPattern>("android.sensor.blackLevelPattern", android.hardware.camera2.params.BlackLevelPattern.class);
3314 
3315     /**
3316      * <p>Maximum sensitivity that is implemented
3317      * purely through analog gain.</p>
3318      * <p>For {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} values less than or
3319      * equal to this, all applied gain must be analog. For
3320      * values above this, the gain applied can be a mix of analog and
3321      * digital.</p>
3322      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3323      * <p><b>Full capability</b> -
3324      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3325      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3326      *
3327      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3328      * @see CaptureRequest#SENSOR_SENSITIVITY
3329      */
3330     @PublicKey
3331     @NonNull
3332     public static final Key<Integer> SENSOR_MAX_ANALOG_SENSITIVITY =
3333             new Key<Integer>("android.sensor.maxAnalogSensitivity", int.class);
3334 
3335     /**
3336      * <p>Clockwise angle through which the output image needs to be rotated to be
3337      * upright on the device screen in its native orientation.</p>
3338      * <p>Also defines the direction of rolling shutter readout, which is from top to bottom in
3339      * the sensor's coordinate system.</p>
3340      * <p><b>Units</b>: Degrees of clockwise rotation; always a multiple of
3341      * 90</p>
3342      * <p><b>Range of valid values:</b><br>
3343      * 0, 90, 180, 270</p>
3344      * <p>This key is available on all devices.</p>
3345      */
3346     @PublicKey
3347     @NonNull
3348     public static final Key<Integer> SENSOR_ORIENTATION =
3349             new Key<Integer>("android.sensor.orientation", int.class);
3350 
3351     /**
3352      * <p>List of sensor test pattern modes for {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode}
3353      * supported by this camera device.</p>
3354      * <p>Defaults to OFF, and always includes OFF if defined.</p>
3355      * <p><b>Range of valid values:</b><br>
3356      * Any value listed in {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode}</p>
3357      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3358      *
3359      * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
3360      */
3361     @PublicKey
3362     @NonNull
3363     public static final Key<int[]> SENSOR_AVAILABLE_TEST_PATTERN_MODES =
3364             new Key<int[]>("android.sensor.availableTestPatternModes", int[].class);
3365 
3366     /**
3367      * <p>List of disjoint rectangles indicating the sensor
3368      * optically shielded black pixel regions.</p>
3369      * <p>In most camera sensors, the active array is surrounded by some
3370      * optically shielded pixel areas. By blocking light, these pixels
3371      * provides a reliable black reference for black level compensation
3372      * in active array region.</p>
3373      * <p>This key provides a list of disjoint rectangles specifying the
3374      * regions of optically shielded (with metal shield) black pixel
3375      * regions if the camera device is capable of reading out these black
3376      * pixels in the output raw images. In comparison to the fixed black
3377      * level values reported by {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern}, this key
3378      * may provide a more accurate way for the application to calculate
3379      * black level of each captured raw images.</p>
3380      * <p>When this key is reported, the {@link CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL android.sensor.dynamicBlackLevel} and
3381      * {@link CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL android.sensor.dynamicWhiteLevel} will also be reported.</p>
3382      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3383      *
3384      * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
3385      * @see CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL
3386      * @see CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL
3387      */
3388     @PublicKey
3389     @NonNull
3390     public static final Key<android.graphics.Rect[]> SENSOR_OPTICAL_BLACK_REGIONS =
3391             new Key<android.graphics.Rect[]>("android.sensor.opticalBlackRegions", android.graphics.Rect[].class);
3392 
3393     /**
3394      * <p>List of lens shading modes for {@link CaptureRequest#SHADING_MODE android.shading.mode} that are supported by this camera device.</p>
3395      * <p>This list contains lens shading modes that can be set for the camera device.
3396      * Camera devices that support the MANUAL_POST_PROCESSING capability will always
3397      * list OFF and FAST mode. This includes all FULL level devices.
3398      * LEGACY devices will always only support FAST mode.</p>
3399      * <p><b>Range of valid values:</b><br>
3400      * Any value listed in {@link CaptureRequest#SHADING_MODE android.shading.mode}</p>
3401      * <p>This key is available on all devices.</p>
3402      *
3403      * @see CaptureRequest#SHADING_MODE
3404      */
3405     @PublicKey
3406     @NonNull
3407     public static final Key<int[]> SHADING_AVAILABLE_MODES =
3408             new Key<int[]>("android.shading.availableModes", int[].class);
3409 
3410     /**
3411      * <p>List of face detection modes for {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} that are
3412      * supported by this camera device.</p>
3413      * <p>OFF is always supported.</p>
3414      * <p><b>Range of valid values:</b><br>
3415      * Any value listed in {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode}</p>
3416      * <p>This key is available on all devices.</p>
3417      *
3418      * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
3419      */
3420     @PublicKey
3421     @NonNull
3422     public static final Key<int[]> STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES =
3423             new Key<int[]>("android.statistics.info.availableFaceDetectModes", int[].class);
3424 
3425     /**
3426      * <p>The maximum number of simultaneously detectable
3427      * faces.</p>
3428      * <p><b>Range of valid values:</b><br>
3429      * 0 for cameras without available face detection; otherwise:
3430      * <code>&gt;=4</code> for LIMITED or FULL hwlevel devices or
3431      * <code>&gt;0</code> for LEGACY devices.</p>
3432      * <p>This key is available on all devices.</p>
3433      */
3434     @PublicKey
3435     @NonNull
3436     public static final Key<Integer> STATISTICS_INFO_MAX_FACE_COUNT =
3437             new Key<Integer>("android.statistics.info.maxFaceCount", int.class);
3438 
3439     /**
3440      * <p>List of hot pixel map output modes for {@link CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE android.statistics.hotPixelMapMode} that are
3441      * supported by this camera device.</p>
3442      * <p>If no hotpixel map output is available for this camera device, this will contain only
3443      * <code>false</code>.</p>
3444      * <p>ON is always supported on devices with the RAW capability.</p>
3445      * <p><b>Range of valid values:</b><br>
3446      * Any value listed in {@link CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE android.statistics.hotPixelMapMode}</p>
3447      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3448      *
3449      * @see CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE
3450      */
3451     @PublicKey
3452     @NonNull
3453     public static final Key<boolean[]> STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES =
3454             new Key<boolean[]>("android.statistics.info.availableHotPixelMapModes", boolean[].class);
3455 
3456     /**
3457      * <p>List of lens shading map output modes for {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} that
3458      * are supported by this camera device.</p>
3459      * <p>If no lens shading map output is available for this camera device, this key will
3460      * contain only OFF.</p>
3461      * <p>ON is always supported on devices with the RAW capability.
3462      * LEGACY mode devices will always only support OFF.</p>
3463      * <p><b>Range of valid values:</b><br>
3464      * Any value listed in {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode}</p>
3465      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3466      *
3467      * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
3468      */
3469     @PublicKey
3470     @NonNull
3471     public static final Key<int[]> STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES =
3472             new Key<int[]>("android.statistics.info.availableLensShadingMapModes", int[].class);
3473 
3474     /**
3475      * <p>List of OIS data output modes for {@link CaptureRequest#STATISTICS_OIS_DATA_MODE android.statistics.oisDataMode} that
3476      * are supported by this camera device.</p>
3477      * <p>If no OIS data output is available for this camera device, this key will
3478      * contain only OFF.</p>
3479      * <p><b>Range of valid values:</b><br>
3480      * Any value listed in {@link CaptureRequest#STATISTICS_OIS_DATA_MODE android.statistics.oisDataMode}</p>
3481      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3482      *
3483      * @see CaptureRequest#STATISTICS_OIS_DATA_MODE
3484      */
3485     @PublicKey
3486     @NonNull
3487     public static final Key<int[]> STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES =
3488             new Key<int[]>("android.statistics.info.availableOisDataModes", int[].class);
3489 
3490     /**
3491      * <p>Maximum number of supported points in the
3492      * tonemap curve that can be used for {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.</p>
3493      * <p>If the actual number of points provided by the application (in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}*) is
3494      * less than this maximum, the camera device will resample the curve to its internal
3495      * representation, using linear interpolation.</p>
3496      * <p>The output curves in the result metadata may have a different number
3497      * of points than the input curves, and will represent the actual
3498      * hardware curves used as closely as possible when linearly interpolated.</p>
3499      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3500      * <p><b>Full capability</b> -
3501      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3502      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3503      *
3504      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3505      * @see CaptureRequest#TONEMAP_CURVE
3506      */
3507     @PublicKey
3508     @NonNull
3509     public static final Key<Integer> TONEMAP_MAX_CURVE_POINTS =
3510             new Key<Integer>("android.tonemap.maxCurvePoints", int.class);
3511 
3512     /**
3513      * <p>List of tonemapping modes for {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} that are supported by this camera
3514      * device.</p>
3515      * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always contain
3516      * at least one of below mode combinations:</p>
3517      * <ul>
3518      * <li>CONTRAST_CURVE, FAST and HIGH_QUALITY</li>
3519      * <li>GAMMA_VALUE, PRESET_CURVE, FAST and HIGH_QUALITY</li>
3520      * </ul>
3521      * <p>This includes all FULL level devices.</p>
3522      * <p><b>Range of valid values:</b><br>
3523      * Any value listed in {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}</p>
3524      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3525      * <p><b>Full capability</b> -
3526      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3527      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3528      *
3529      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3530      * @see CaptureRequest#TONEMAP_MODE
3531      */
3532     @PublicKey
3533     @NonNull
3534     public static final Key<int[]> TONEMAP_AVAILABLE_TONE_MAP_MODES =
3535             new Key<int[]>("android.tonemap.availableToneMapModes", int[].class);
3536 
3537     /**
3538      * <p>A list of camera LEDs that are available on this system.</p>
3539      * <p><b>Possible values:</b>
3540      * <ul>
3541      *   <li>{@link #LED_AVAILABLE_LEDS_TRANSMIT TRANSMIT}</li>
3542      * </ul></p>
3543      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3544      * @see #LED_AVAILABLE_LEDS_TRANSMIT
3545      * @hide
3546      */
3547     public static final Key<int[]> LED_AVAILABLE_LEDS =
3548             new Key<int[]>("android.led.availableLeds", int[].class);
3549 
3550     /**
3551      * <p>Generally classifies the overall set of the camera device functionality.</p>
3552      * <p>The supported hardware level is a high-level description of the camera device's
3553      * capabilities, summarizing several capabilities into one field.  Each level adds additional
3554      * features to the previous one, and is always a strict superset of the previous level.
3555      * The ordering is <code>LEGACY &lt; LIMITED &lt; FULL &lt; LEVEL_3</code>.</p>
3556      * <p>Starting from <code>LEVEL_3</code>, the level enumerations are guaranteed to be in increasing
3557      * numerical value as well. To check if a given device is at least at a given hardware level,
3558      * the following code snippet can be used:</p>
3559      * <pre><code>// Returns true if the device supports the required hardware level, or better.
3560      * boolean isHardwareLevelSupported(CameraCharacteristics c, int requiredLevel) {
3561      *     final int[] sortedHwLevels = {
3562      *         CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY,
3563      *         CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL,
3564      *         CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED,
3565      *         CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL,
3566      *         CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_3
3567      *     };
3568      *     int deviceLevel = c.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL);
3569      *     if (requiredLevel == deviceLevel) {
3570      *         return true;
3571      *     }
3572      *
3573      *     for (int sortedlevel : sortedHwLevels) {
3574      *         if (sortedlevel == requiredLevel) {
3575      *             return true;
3576      *         } else if (sortedlevel == deviceLevel) {
3577      *             return false;
3578      *         }
3579      *     }
3580      *     return false; // Should never reach here
3581      * }
3582      * </code></pre>
3583      * <p>At a high level, the levels are:</p>
3584      * <ul>
3585      * <li><code>LEGACY</code> devices operate in a backwards-compatibility mode for older
3586      *   Android devices, and have very limited capabilities.</li>
3587      * <li><code>LIMITED</code> devices represent the
3588      *   baseline feature set, and may also include additional capabilities that are
3589      *   subsets of <code>FULL</code>.</li>
3590      * <li><code>FULL</code> devices additionally support per-frame manual control of sensor, flash, lens and
3591      *   post-processing settings, and image capture at a high rate.</li>
3592      * <li><code>LEVEL_3</code> devices additionally support YUV reprocessing and RAW image capture, along
3593      *   with additional output stream configurations.</li>
3594      * <li><code>EXTERNAL</code> devices are similar to <code>LIMITED</code> devices with exceptions like some sensor or
3595      *   lens information not reported or less stable framerates.</li>
3596      * </ul>
3597      * <p>See the individual level enums for full descriptions of the supported capabilities.  The
3598      * {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} entry describes the device's capabilities at a
3599      * finer-grain level, if needed. In addition, many controls have their available settings or
3600      * ranges defined in individual entries from {@link android.hardware.camera2.CameraCharacteristics }.</p>
3601      * <p>Some features are not part of any particular hardware level or capability and must be
3602      * queried separately. These include:</p>
3603      * <ul>
3604      * <li>Calibrated timestamps ({@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME)</li>
3605      * <li>Precision lens control ({@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} <code>==</code> CALIBRATED)</li>
3606      * <li>Face detection ({@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes})</li>
3607      * <li>Optical or electrical image stabilization
3608      *   ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization},
3609      *    {@link CameraCharacteristics#CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES android.control.availableVideoStabilizationModes})</li>
3610      * </ul>
3611      * <p><b>Possible values:</b>
3612      * <ul>
3613      *   <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED}</li>
3614      *   <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL}</li>
3615      *   <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY LEGACY}</li>
3616      *   <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_3 3}</li>
3617      *   <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL EXTERNAL}</li>
3618      * </ul></p>
3619      * <p>This key is available on all devices.</p>
3620      *
3621      * @see CameraCharacteristics#CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES
3622      * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
3623      * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
3624      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
3625      * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
3626      * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
3627      * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED
3628      * @see #INFO_SUPPORTED_HARDWARE_LEVEL_FULL
3629      * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY
3630      * @see #INFO_SUPPORTED_HARDWARE_LEVEL_3
3631      * @see #INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL
3632      */
3633     @PublicKey
3634     @NonNull
3635     public static final Key<Integer> INFO_SUPPORTED_HARDWARE_LEVEL =
3636             new Key<Integer>("android.info.supportedHardwareLevel", int.class);
3637 
3638     /**
3639      * <p>A short string for manufacturer version information about the camera device, such as
3640      * ISP hardware, sensors, etc.</p>
3641      * <p>This can be used in {@link android.media.ExifInterface#TAG_IMAGE_DESCRIPTION TAG_IMAGE_DESCRIPTION}
3642      * in jpeg EXIF. This key may be absent if no version information is available on the
3643      * device.</p>
3644      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3645      */
3646     @PublicKey
3647     @NonNull
3648     public static final Key<String> INFO_VERSION =
3649             new Key<String>("android.info.version", String.class);
3650 
3651     /**
3652      * <p>The maximum number of frames that can occur after a request
3653      * (different than the previous) has been submitted, and before the
3654      * result's state becomes synchronized.</p>
3655      * <p>This defines the maximum distance (in number of metadata results),
3656      * between the frame number of the request that has new controls to apply
3657      * and the frame number of the result that has all the controls applied.</p>
3658      * <p>In other words this acts as an upper boundary for how many frames
3659      * must occur before the camera device knows for a fact that the new
3660      * submitted camera settings have been applied in outgoing frames.</p>
3661      * <p><b>Units</b>: Frame counts</p>
3662      * <p><b>Possible values:</b>
3663      * <ul>
3664      *   <li>{@link #SYNC_MAX_LATENCY_PER_FRAME_CONTROL PER_FRAME_CONTROL}</li>
3665      *   <li>{@link #SYNC_MAX_LATENCY_UNKNOWN UNKNOWN}</li>
3666      * </ul></p>
3667      * <p><b>Available values for this device:</b><br>
3668      * A positive value, PER_FRAME_CONTROL, or UNKNOWN.</p>
3669      * <p>This key is available on all devices.</p>
3670      * @see #SYNC_MAX_LATENCY_PER_FRAME_CONTROL
3671      * @see #SYNC_MAX_LATENCY_UNKNOWN
3672      */
3673     @PublicKey
3674     @NonNull
3675     public static final Key<Integer> SYNC_MAX_LATENCY =
3676             new Key<Integer>("android.sync.maxLatency", int.class);
3677 
3678     /**
3679      * <p>The maximal camera capture pipeline stall (in unit of frame count) introduced by a
3680      * reprocess capture request.</p>
3681      * <p>The key describes the maximal interference that one reprocess (input) request
3682      * can introduce to the camera simultaneous streaming of regular (output) capture
3683      * requests, including repeating requests.</p>
3684      * <p>When a reprocessing capture request is submitted while a camera output repeating request
3685      * (e.g. preview) is being served by the camera device, it may preempt the camera capture
3686      * pipeline for at least one frame duration so that the camera device is unable to process
3687      * the following capture request in time for the next sensor start of exposure boundary.
3688      * When this happens, the application may observe a capture time gap (longer than one frame
3689      * duration) between adjacent capture output frames, which usually exhibits as preview
3690      * glitch if the repeating request output targets include a preview surface. This key gives
3691      * the worst-case number of frame stall introduced by one reprocess request with any kind of
3692      * formats/sizes combination.</p>
3693      * <p>If this key reports 0, it means a reprocess request doesn't introduce any glitch to the
3694      * ongoing camera repeating request outputs, as if this reprocess request is never issued.</p>
3695      * <p>This key is supported if the camera device supports PRIVATE or YUV reprocessing (
3696      * i.e. {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains PRIVATE_REPROCESSING or
3697      * YUV_REPROCESSING).</p>
3698      * <p><b>Units</b>: Number of frames.</p>
3699      * <p><b>Range of valid values:</b><br>
3700      * &lt;= 4</p>
3701      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3702      * <p><b>Limited capability</b> -
3703      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3704      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3705      *
3706      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3707      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
3708      */
3709     @PublicKey
3710     @NonNull
3711     public static final Key<Integer> REPROCESS_MAX_CAPTURE_STALL =
3712             new Key<Integer>("android.reprocess.maxCaptureStall", int.class);
3713 
3714     /**
3715      * <p>The available depth dataspace stream
3716      * configurations that this camera device supports
3717      * (i.e. format, width, height, output/input stream).</p>
3718      * <p>These are output stream configurations for use with
3719      * dataSpace HAL_DATASPACE_DEPTH. The configurations are
3720      * listed as <code>(format, width, height, input?)</code> tuples.</p>
3721      * <p>Only devices that support depth output for at least
3722      * the HAL_PIXEL_FORMAT_Y16 dense depth map may include
3723      * this entry.</p>
3724      * <p>A device that also supports the HAL_PIXEL_FORMAT_BLOB
3725      * sparse depth point cloud must report a single entry for
3726      * the format in this list as <code>(HAL_PIXEL_FORMAT_BLOB,
3727      * android.depth.maxDepthSamples, 1, OUTPUT)</code> in addition to
3728      * the entries for HAL_PIXEL_FORMAT_Y16.</p>
3729      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3730      * <p><b>Limited capability</b> -
3731      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3732      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3733      *
3734      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3735      * @hide
3736      */
3737     public static final Key<android.hardware.camera2.params.StreamConfiguration[]> DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS =
3738             new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.depth.availableDepthStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
3739 
3740     /**
3741      * <p>This lists the minimum frame duration for each
3742      * format/size combination for depth output formats.</p>
3743      * <p>This should correspond to the frame duration when only that
3744      * stream is active, with all processing (typically in android.*.mode)
3745      * set to either OFF or FAST.</p>
3746      * <p>When multiple streams are used in a request, the minimum frame
3747      * duration will be max(individual stream min durations).</p>
3748      * <p>The minimum frame duration of a stream (of a particular format, size)
3749      * is the same regardless of whether the stream is input or output.</p>
3750      * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
3751      * android.scaler.availableStallDurations for more details about
3752      * calculating the max frame rate.</p>
3753      * <p><b>Units</b>: (format, width, height, ns) x n</p>
3754      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3755      * <p><b>Limited capability</b> -
3756      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3757      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3758      *
3759      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3760      * @see CaptureRequest#SENSOR_FRAME_DURATION
3761      * @hide
3762      */
3763     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS =
3764             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDepthMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
3765 
3766     /**
3767      * <p>This lists the maximum stall duration for each
3768      * output format/size combination for depth streams.</p>
3769      * <p>A stall duration is how much extra time would get added
3770      * to the normal minimum frame duration for a repeating request
3771      * that has streams with non-zero stall.</p>
3772      * <p>This functions similarly to
3773      * android.scaler.availableStallDurations for depth
3774      * streams.</p>
3775      * <p>All depth output stream formats may have a nonzero stall
3776      * duration.</p>
3777      * <p><b>Units</b>: (format, width, height, ns) x n</p>
3778      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3779      * <p><b>Limited capability</b> -
3780      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3781      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3782      *
3783      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3784      * @hide
3785      */
3786     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS =
3787             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDepthStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
3788 
3789     /**
3790      * <p>Indicates whether a capture request may target both a
3791      * DEPTH16 / DEPTH_POINT_CLOUD output, and normal color outputs (such as
3792      * YUV_420_888, JPEG, or RAW) simultaneously.</p>
3793      * <p>If TRUE, including both depth and color outputs in a single
3794      * capture request is not supported. An application must interleave color
3795      * and depth requests.  If FALSE, a single request can target both types
3796      * of output.</p>
3797      * <p>Typically, this restriction exists on camera devices that
3798      * need to emit a specific pattern or wavelength of light to
3799      * measure depth values, which causes the color image to be
3800      * corrupted during depth measurement.</p>
3801      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3802      * <p><b>Limited capability</b> -
3803      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3804      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3805      *
3806      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3807      */
3808     @PublicKey
3809     @NonNull
3810     public static final Key<Boolean> DEPTH_DEPTH_IS_EXCLUSIVE =
3811             new Key<Boolean>("android.depth.depthIsExclusive", boolean.class);
3812 
3813     /**
3814      * <p>Recommended depth stream configurations for common client use cases.</p>
3815      * <p>Optional subset of the android.depth.availableDepthStreamConfigurations that
3816      * contains similar tuples listed as
3817      * (i.e. width, height, format, output/input stream, usecase bit field).
3818      * Camera devices will be able to suggest particular depth stream configurations which are
3819      * power and performance efficient for specific use cases. For more information about
3820      * retrieving the suggestions see
3821      * {@link android.hardware.camera2.CameraCharacteristics#getRecommendedStreamConfigurationMap }.</p>
3822      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3823      * @hide
3824      */
3825     public static final Key<android.hardware.camera2.params.RecommendedStreamConfiguration[]> DEPTH_AVAILABLE_RECOMMENDED_DEPTH_STREAM_CONFIGURATIONS =
3826             new Key<android.hardware.camera2.params.RecommendedStreamConfiguration[]>("android.depth.availableRecommendedDepthStreamConfigurations", android.hardware.camera2.params.RecommendedStreamConfiguration[].class);
3827 
3828     /**
3829      * <p>The available dynamic depth dataspace stream
3830      * configurations that this camera device supports
3831      * (i.e. format, width, height, output/input stream).</p>
3832      * <p>These are output stream configurations for use with
3833      * dataSpace DYNAMIC_DEPTH. The configurations are
3834      * listed as <code>(format, width, height, input?)</code> tuples.</p>
3835      * <p>Only devices that support depth output for at least
3836      * the HAL_PIXEL_FORMAT_Y16 dense depth map along with
3837      * HAL_PIXEL_FORMAT_BLOB with the same size or size with
3838      * the same aspect ratio can have dynamic depth dataspace
3839      * stream configuration. {@link CameraCharacteristics#DEPTH_DEPTH_IS_EXCLUSIVE android.depth.depthIsExclusive} also
3840      * needs to be set to FALSE.</p>
3841      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3842      *
3843      * @see CameraCharacteristics#DEPTH_DEPTH_IS_EXCLUSIVE
3844      * @hide
3845      */
3846     public static final Key<android.hardware.camera2.params.StreamConfiguration[]> DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS =
3847             new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.depth.availableDynamicDepthStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
3848 
3849     /**
3850      * <p>This lists the minimum frame duration for each
3851      * format/size combination for dynamic depth output streams.</p>
3852      * <p>This should correspond to the frame duration when only that
3853      * stream is active, with all processing (typically in android.*.mode)
3854      * set to either OFF or FAST.</p>
3855      * <p>When multiple streams are used in a request, the minimum frame
3856      * duration will be max(individual stream min durations).</p>
3857      * <p>The minimum frame duration of a stream (of a particular format, size)
3858      * is the same regardless of whether the stream is input or output.</p>
3859      * <p><b>Units</b>: (format, width, height, ns) x n</p>
3860      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3861      * @hide
3862      */
3863     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DYNAMIC_DEPTH_MIN_FRAME_DURATIONS =
3864             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDynamicDepthMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
3865 
3866     /**
3867      * <p>This lists the maximum stall duration for each
3868      * output format/size combination for dynamic depth streams.</p>
3869      * <p>A stall duration is how much extra time would get added
3870      * to the normal minimum frame duration for a repeating request
3871      * that has streams with non-zero stall.</p>
3872      * <p>All dynamic depth output streams may have a nonzero stall
3873      * duration.</p>
3874      * <p><b>Units</b>: (format, width, height, ns) x n</p>
3875      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3876      * @hide
3877      */
3878     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DYNAMIC_DEPTH_STALL_DURATIONS =
3879             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDynamicDepthStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
3880 
3881     /**
3882      * <p>String containing the ids of the underlying physical cameras.</p>
3883      * <p>For a logical camera, this is concatenation of all underlying physical camera IDs.
3884      * The null terminator for physical camera ID must be preserved so that the whole string
3885      * can be tokenized using '\0' to generate list of physical camera IDs.</p>
3886      * <p>For example, if the physical camera IDs of the logical camera are "2" and "3", the
3887      * value of this tag will be ['2', '\0', '3', '\0'].</p>
3888      * <p>The number of physical camera IDs must be no less than 2.</p>
3889      * <p><b>Units</b>: UTF-8 null-terminated string</p>
3890      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3891      * <p><b>Limited capability</b> -
3892      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3893      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3894      *
3895      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3896      * @hide
3897      */
3898     public static final Key<byte[]> LOGICAL_MULTI_CAMERA_PHYSICAL_IDS =
3899             new Key<byte[]>("android.logicalMultiCamera.physicalIds", byte[].class);
3900 
3901     /**
3902      * <p>The accuracy of frame timestamp synchronization between physical cameras</p>
3903      * <p>The accuracy of the frame timestamp synchronization determines the physical cameras'
3904      * ability to start exposure at the same time. If the sensorSyncType is CALIBRATED,
3905      * the physical camera sensors usually run in master-slave mode so that their shutter
3906      * time is synchronized. For APPROXIMATE sensorSyncType, the camera sensors usually run in
3907      * master-master mode, and there could be offset between their start of exposure.</p>
3908      * <p>In both cases, all images generated for a particular capture request still carry the same
3909      * timestamps, so that they can be used to look up the matching frame number and
3910      * onCaptureStarted callback.</p>
3911      * <p>This tag is only applicable if the logical camera device supports concurrent physical
3912      * streams from different physical cameras.</p>
3913      * <p><b>Possible values:</b>
3914      * <ul>
3915      *   <li>{@link #LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_APPROXIMATE APPROXIMATE}</li>
3916      *   <li>{@link #LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_CALIBRATED CALIBRATED}</li>
3917      * </ul></p>
3918      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3919      * <p><b>Limited capability</b> -
3920      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3921      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3922      *
3923      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3924      * @see #LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_APPROXIMATE
3925      * @see #LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_CALIBRATED
3926      */
3927     @PublicKey
3928     @NonNull
3929     public static final Key<Integer> LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE =
3930             new Key<Integer>("android.logicalMultiCamera.sensorSyncType", int.class);
3931 
3932     /**
3933      * <p>List of distortion correction modes for {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} that are
3934      * supported by this camera device.</p>
3935      * <p>No device is required to support this API; such devices will always list only 'OFF'.
3936      * All devices that support this API will list both FAST and HIGH_QUALITY.</p>
3937      * <p><b>Range of valid values:</b><br>
3938      * Any value listed in {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode}</p>
3939      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3940      *
3941      * @see CaptureRequest#DISTORTION_CORRECTION_MODE
3942      */
3943     @PublicKey
3944     @NonNull
3945     public static final Key<int[]> DISTORTION_CORRECTION_AVAILABLE_MODES =
3946             new Key<int[]>("android.distortionCorrection.availableModes", int[].class);
3947 
3948     /**
3949      * <p>The available HEIC (ISO/IEC 23008-12) stream
3950      * configurations that this camera device supports
3951      * (i.e. format, width, height, output/input stream).</p>
3952      * <p>The configurations are listed as <code>(format, width, height, input?)</code> tuples.</p>
3953      * <p>If the camera device supports HEIC image format, it will support identical set of stream
3954      * combinations involving HEIC image format, compared to the combinations involving JPEG
3955      * image format as required by the device's hardware level and capabilities.</p>
3956      * <p>All the static, control, and dynamic metadata tags related to JPEG apply to HEIC formats.
3957      * Configuring JPEG and HEIC streams at the same time is not supported.</p>
3958      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3959      * <p><b>Limited capability</b> -
3960      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3961      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3962      *
3963      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3964      * @hide
3965      */
3966     public static final Key<android.hardware.camera2.params.StreamConfiguration[]> HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS =
3967             new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.heic.availableHeicStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
3968 
3969     /**
3970      * <p>This lists the minimum frame duration for each
3971      * format/size combination for HEIC output formats.</p>
3972      * <p>This should correspond to the frame duration when only that
3973      * stream is active, with all processing (typically in android.*.mode)
3974      * set to either OFF or FAST.</p>
3975      * <p>When multiple streams are used in a request, the minimum frame
3976      * duration will be max(individual stream min durations).</p>
3977      * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
3978      * android.scaler.availableStallDurations for more details about
3979      * calculating the max frame rate.</p>
3980      * <p><b>Units</b>: (format, width, height, ns) x n</p>
3981      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3982      * <p><b>Limited capability</b> -
3983      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3984      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3985      *
3986      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3987      * @see CaptureRequest#SENSOR_FRAME_DURATION
3988      * @hide
3989      */
3990     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> HEIC_AVAILABLE_HEIC_MIN_FRAME_DURATIONS =
3991             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.heic.availableHeicMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
3992 
3993     /**
3994      * <p>This lists the maximum stall duration for each
3995      * output format/size combination for HEIC streams.</p>
3996      * <p>A stall duration is how much extra time would get added
3997      * to the normal minimum frame duration for a repeating request
3998      * that has streams with non-zero stall.</p>
3999      * <p>This functions similarly to
4000      * android.scaler.availableStallDurations for HEIC
4001      * streams.</p>
4002      * <p>All HEIC output stream formats may have a nonzero stall
4003      * duration.</p>
4004      * <p><b>Units</b>: (format, width, height, ns) x n</p>
4005      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4006      * <p><b>Limited capability</b> -
4007      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
4008      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
4009      *
4010      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
4011      * @hide
4012      */
4013     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> HEIC_AVAILABLE_HEIC_STALL_DURATIONS =
4014             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.heic.availableHeicStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
4015 
4016     /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
4017      * End generated code
4018      *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
4019 
4020 
4021 
4022 
4023 
4024 
4025 }
4026