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