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