• 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.FlaggedApi;
20 import android.annotation.NonNull;
21 import android.annotation.Nullable;
22 import android.annotation.SystemApi;
23 import android.compat.annotation.UnsupportedAppUsage;
24 import android.hardware.camera2.impl.CameraMetadataNative;
25 import android.hardware.camera2.impl.PublicKey;
26 import android.hardware.camera2.impl.SyntheticKey;
27 import android.hardware.camera2.params.DeviceStateSensorOrientationMap;
28 import android.hardware.camera2.params.RecommendedStreamConfigurationMap;
29 import android.hardware.camera2.params.SessionConfiguration;
30 import android.hardware.camera2.utils.TypeReference;
31 import android.os.Build;
32 import android.util.Log;
33 import android.util.Rational;
34 
35 import com.android.internal.annotations.GuardedBy;
36 import com.android.internal.camera.flags.Flags;
37 
38 import java.util.ArrayList;
39 import java.util.Arrays;
40 import java.util.Collections;
41 import java.util.List;
42 import java.util.Map;
43 import java.util.Set;
44 import java.util.stream.Collectors;
45 
46 /**
47  * <p>The properties describing a
48  * {@link CameraDevice CameraDevice}.</p>
49  *
50  * <p>These properties are primarily fixed for a given CameraDevice, and can be queried
51  * through the {@link CameraManager CameraManager}
52  * interface with {@link CameraManager#getCameraCharacteristics}. Beginning with API level 32, some
53  * properties such as {@link #SENSOR_ORIENTATION} may change dynamically based on the state of the
54  * device. For information on whether a specific value is fixed, see the documentation for its key.
55  * </p>
56  *
57  * <p>When obtained by a client that does not hold the CAMERA permission, some metadata values are
58  * not included. The list of keys that require the permission is given by
59  * {@link #getKeysNeedingPermission}.</p>
60  *
61  * <p>{@link CameraCharacteristics} objects are immutable.</p>
62  *
63  * @see CameraDevice
64  * @see CameraManager
65  */
66 public final class CameraCharacteristics extends CameraMetadata<CameraCharacteristics.Key<?>> {
67 
68     /**
69      * A {@code Key} is used to do camera characteristics field lookups with
70      * {@link CameraCharacteristics#get}.
71      *
72      * <p>For example, to get the stream configuration map:
73      * <code><pre>
74      * StreamConfigurationMap map = cameraCharacteristics.get(
75      *      CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
76      * </pre></code>
77      * </p>
78      *
79      * <p>To enumerate over all possible keys for {@link CameraCharacteristics}, see
80      * {@link CameraCharacteristics#getKeys()}.</p>
81      *
82      * @see CameraCharacteristics#get
83      * @see CameraCharacteristics#getKeys()
84      */
85     public static final class Key<T> {
86         private final CameraMetadataNative.Key<T> mKey;
87 
88         /**
89          * Visible for testing and vendor extensions only.
90          *
91          * @hide
92          */
93         @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
Key(String name, Class<T> type, long vendorId)94         public Key(String name, Class<T> type, long vendorId) {
95             mKey = new CameraMetadataNative.Key<T>(name,  type, vendorId);
96         }
97 
98         /**
99          * Visible for testing and vendor extensions only.
100          *
101          * @hide
102          */
Key(String name, String fallbackName, Class<T> type)103         public Key(String name, String fallbackName, Class<T> type) {
104             mKey = new CameraMetadataNative.Key<T>(name,  fallbackName, type);
105         }
106 
107         /**
108          * Construct a new Key with a given name and type.
109          *
110          * <p>Normally, applications should use the existing Key definitions in
111          * {@link CameraCharacteristics}, and not need to construct their own Key objects. However,
112          * they may be useful for testing purposes and for defining custom camera
113          * characteristics.</p>
114          */
Key(@onNull String name, @NonNull Class<T> type)115         public Key(@NonNull String name, @NonNull Class<T> type) {
116             mKey = new CameraMetadataNative.Key<T>(name,  type);
117         }
118 
119         /**
120          * Visible for testing and vendor extensions only.
121          *
122          * @hide
123          */
124         @UnsupportedAppUsage
Key(String name, TypeReference<T> typeReference)125         public Key(String name, TypeReference<T> typeReference) {
126             mKey = new CameraMetadataNative.Key<T>(name,  typeReference);
127         }
128 
129         /**
130          * Return a camelCase, period separated name formatted like:
131          * {@code "root.section[.subsections].name"}.
132          *
133          * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
134          * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
135          *
136          * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
137          * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
138          * specific key might look like {@code "com.google.nexus.data.private"}.</p>
139          *
140          * @return String representation of the key name
141          */
142         @NonNull
getName()143         public String getName() {
144             return mKey.getName();
145         }
146 
147         /**
148          * Return vendor tag id.
149          *
150          * @hide
151          */
getVendorId()152         public long getVendorId() {
153             return mKey.getVendorId();
154         }
155 
156         /**
157          * {@inheritDoc}
158          */
159         @Override
hashCode()160         public final int hashCode() {
161             return mKey.hashCode();
162         }
163 
164         /**
165          * {@inheritDoc}
166          */
167         @SuppressWarnings("unchecked")
168         @Override
equals(Object o)169         public final boolean equals(Object o) {
170             return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
171         }
172 
173         /**
174          * Return this {@link Key} as a string representation.
175          *
176          * <p>{@code "CameraCharacteristics.Key(%s)"}, where {@code %s} represents
177          * the name of this key as returned by {@link #getName}.</p>
178          *
179          * @return string representation of {@link Key}
180          */
181         @NonNull
182         @Override
toString()183         public String toString() {
184             return String.format("CameraCharacteristics.Key(%s)", mKey.getName());
185         }
186 
187         /**
188          * Visible for CameraMetadataNative implementation only; do not use.
189          *
190          * TODO: Make this private or remove it altogether.
191          *
192          * @hide
193          */
194         @UnsupportedAppUsage
getNativeKey()195         public CameraMetadataNative.Key<T> getNativeKey() {
196             return mKey;
197         }
198 
199         @SuppressWarnings({
200                 "unused", "unchecked"
201         })
Key(CameraMetadataNative.Key<?> nativeKey)202         private Key(CameraMetadataNative.Key<?> nativeKey) {
203             mKey = (CameraMetadataNative.Key<T>) nativeKey;
204         }
205     }
206 
207     @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
208     private final CameraMetadataNative mProperties;
209     private List<CameraCharacteristics.Key<?>> mKeys;
210     private List<CameraCharacteristics.Key<?>> mKeysNeedingPermission;
211     private List<CaptureRequest.Key<?>> mAvailableRequestKeys;
212     private List<CaptureRequest.Key<?>> mAvailableSessionKeys;
213     private List<CameraCharacteristics.Key<?>> mAvailableSessionCharacteristicsKeys;
214     private List<CaptureRequest.Key<?>> mAvailablePhysicalRequestKeys;
215     private List<CaptureResult.Key<?>> mAvailableResultKeys;
216     private ArrayList<RecommendedStreamConfigurationMap> mRecommendedConfigurations;
217 
218     private final Object mLock = new Object();
219     @GuardedBy("mLock")
220     private boolean mFoldedDeviceState;
221 
222     private CameraManager.DeviceStateListener mFoldStateListener;
223 
224     private static final String TAG = "CameraCharacteristics";
225 
226     /**
227      * Takes ownership of the passed-in properties object
228      *
229      * @param properties Camera properties.
230      * @hide
231      */
CameraCharacteristics(CameraMetadataNative properties)232     public CameraCharacteristics(CameraMetadataNative properties) {
233         mProperties = CameraMetadataNative.move(properties);
234         setNativeInstance(mProperties);
235     }
236 
237     /**
238      * Returns a copy of the underlying {@link CameraMetadataNative}.
239      * @hide
240      */
getNativeCopy()241     public CameraMetadataNative getNativeCopy() {
242         return new CameraMetadataNative(mProperties);
243     }
244 
245     /**
246      * Return the device state listener for this Camera characteristics instance
247      */
getDeviceStateListener()248     CameraManager.DeviceStateListener getDeviceStateListener() {
249         if (mFoldStateListener == null) {
250             mFoldStateListener = new CameraManager.DeviceStateListener() {
251                         @Override
252                         public final void onDeviceStateChanged(boolean folded) {
253                             synchronized (mLock) {
254                                 mFoldedDeviceState = folded;
255                             }
256                         }};
257         }
258         return mFoldStateListener;
259     }
260 
261     /**
262      * Overrides the property value
263      *
264      * <p>Check whether a given property value needs to be overridden in some specific
265      * case.</p>
266      *
267      * @param key The characteristics field to override.
268      * @return The value of overridden property, or {@code null} if the property doesn't need an
269      * override.
270      */
271     @Nullable
overrideProperty(Key<T> key)272     private <T> T overrideProperty(Key<T> key) {
273         if (CameraCharacteristics.SENSOR_ORIENTATION.equals(key) && (mFoldStateListener != null) &&
274                 (mProperties.get(CameraCharacteristics.INFO_DEVICE_STATE_ORIENTATIONS) != null)) {
275             DeviceStateSensorOrientationMap deviceStateSensorOrientationMap =
276                     mProperties.get(CameraCharacteristics.INFO_DEVICE_STATE_SENSOR_ORIENTATION_MAP);
277             synchronized (mLock) {
278                 Integer ret = deviceStateSensorOrientationMap.getSensorOrientation(
279                         mFoldedDeviceState ? DeviceStateSensorOrientationMap.FOLDED :
280                                 DeviceStateSensorOrientationMap.NORMAL);
281                 if (ret >= 0) {
282                     return (T) ret;
283                 } else {
284                     Log.w(TAG, "No valid device state to orientation mapping! Using default!");
285                 }
286             }
287         }
288 
289         return null;
290     }
291 
292     /**
293      * Get a camera characteristics field value.
294      *
295      * <p>The field definitions can be
296      * found in {@link CameraCharacteristics}.</p>
297      *
298      * @throws IllegalArgumentException if the key was not valid
299      *
300      * @param key The characteristics field to read.
301      * @return The value of that key, or {@code null} if the field is not set.
302      */
303     @Nullable
get(Key<T> key)304     public <T> T get(Key<T> key) {
305         T propertyOverride = overrideProperty(key);
306         return (propertyOverride != null) ? propertyOverride : mProperties.get(key);
307     }
308 
309     /**
310      * {@inheritDoc}
311      * @hide
312      */
313     @SuppressWarnings("unchecked")
314     @Override
getProtected(Key<?> key)315     protected <T> T getProtected(Key<?> key) {
316         return (T) mProperties.get(key);
317     }
318 
319     /**
320      * {@inheritDoc}
321      * @hide
322      */
323     @SuppressWarnings("unchecked")
324     @Override
getKeyClass()325     protected Class<Key<?>> getKeyClass() {
326         Object thisClass = Key.class;
327         return (Class<Key<?>>)thisClass;
328     }
329 
330     /**
331      * {@inheritDoc}
332      */
333     @NonNull
334     @Override
getKeys()335     public List<Key<?>> getKeys() {
336         // List of keys is immutable; cache the results after we calculate them
337         if (mKeys != null) {
338             return mKeys;
339         }
340 
341         int[] filterTags = get(REQUEST_AVAILABLE_CHARACTERISTICS_KEYS);
342         if (filterTags == null) {
343             throw new AssertionError("android.request.availableCharacteristicsKeys must be non-null"
344                     + " in the characteristics");
345         }
346 
347         mKeys = Collections.unmodifiableList(
348                 getKeys(getClass(), getKeyClass(), this, filterTags, true));
349         return mKeys;
350     }
351 
352     /**
353      * <p>Returns a subset of the list returned by {@link #getKeys} with all keys that
354      * require camera clients to obtain the {@link android.Manifest.permission#CAMERA} permission.
355      * </p>
356      *
357      * <p>If an application calls {@link CameraManager#getCameraCharacteristics} without holding the
358      * {@link android.Manifest.permission#CAMERA} permission,
359      * all keys in this list will not be available, and calling {@link #get} will
360      * return null for those keys. If the application obtains the
361      * {@link android.Manifest.permission#CAMERA} permission, then the
362      * CameraCharacteristics from a call to a subsequent
363      * {@link CameraManager#getCameraCharacteristics} will have the keys available.</p>
364      *
365      * <p>The list returned is not modifiable, so any attempts to modify it will throw
366      * a {@code UnsupportedOperationException}.</p>
367      *
368      * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
369      *
370      * @return List of camera characteristic keys that require the
371      *         {@link android.Manifest.permission#CAMERA} permission. The list can be empty in case
372      *         there are no currently present keys that need additional permission.
373      */
getKeysNeedingPermission()374     public @NonNull List<Key<?>> getKeysNeedingPermission() {
375         if (mKeysNeedingPermission == null) {
376             Object crKey = CameraCharacteristics.Key.class;
377             Class<CameraCharacteristics.Key<?>> crKeyTyped =
378                 (Class<CameraCharacteristics.Key<?>>)crKey;
379 
380             int[] filterTags = get(REQUEST_CHARACTERISTIC_KEYS_NEEDING_PERMISSION);
381             if (filterTags == null) {
382                 mKeysNeedingPermission = Collections.unmodifiableList(
383                         new ArrayList<CameraCharacteristics.Key<?>> ());
384                 return mKeysNeedingPermission;
385             }
386             mKeysNeedingPermission =
387                 getAvailableKeyList(CameraCharacteristics.class, crKeyTyped, filterTags,
388                         /*includeSynthetic*/ false);
389         }
390         return mKeysNeedingPermission;
391     }
392 
393     /**
394      * <p>Retrieve camera device recommended stream configuration map
395      * {@link RecommendedStreamConfigurationMap} for a given use case.</p>
396      *
397      * <p>The stream configurations advertised here are efficient in terms of power and performance
398      * for common use cases like preview, video, snapshot, etc. The recommended maps are usually
399      * only small subsets of the exhaustive list provided in
400      * {@link #SCALER_STREAM_CONFIGURATION_MAP} and suggested for a particular use case by the
401      * camera device implementation. For further information about the expected configurations in
402      * various scenarios please refer to:
403      * <ul>
404      * <li>{@link RecommendedStreamConfigurationMap#USECASE_PREVIEW}</li>
405      * <li>{@link RecommendedStreamConfigurationMap#USECASE_RECORD}</li>
406      * <li>{@link RecommendedStreamConfigurationMap#USECASE_VIDEO_SNAPSHOT}</li>
407      * <li>{@link RecommendedStreamConfigurationMap#USECASE_SNAPSHOT}</li>
408      * <li>{@link RecommendedStreamConfigurationMap#USECASE_RAW}</li>
409      * <li>{@link RecommendedStreamConfigurationMap#USECASE_ZSL}</li>
410      * <li>{@link RecommendedStreamConfigurationMap#USECASE_LOW_LATENCY_SNAPSHOT}</li>
411      * </ul>
412      * </p>
413      *
414      * <p>For example on how this can be used by camera clients to find out the maximum recommended
415      * preview and snapshot resolution, consider the following pseudo-code:
416      * </p>
417      * <pre><code>
418      * public static Size getMaxSize(Size... sizes) {
419      *     if (sizes == null || sizes.length == 0) {
420      *         throw new IllegalArgumentException("sizes was empty");
421      *     }
422      *
423      *     Size sz = sizes[0];
424      *     for (Size size : sizes) {
425      *         if (size.getWidth() * size.getHeight() &gt; sz.getWidth() * sz.getHeight()) {
426      *             sz = size;
427      *         }
428      *     }
429      *
430      *     return sz;
431      * }
432      *
433      * CameraCharacteristics characteristics =
434      *         cameraManager.getCameraCharacteristics(cameraId);
435      * RecommendedStreamConfigurationMap previewConfig =
436      *         characteristics.getRecommendedStreamConfigurationMap(
437      *                  RecommendedStreamConfigurationMap.USECASE_PREVIEW);
438      * RecommendedStreamConfigurationMap snapshotConfig =
439      *         characteristics.getRecommendedStreamConfigurationMap(
440      *                  RecommendedStreamConfigurationMap.USECASE_SNAPSHOT);
441      *
442      * if ((previewConfig != null) &amp;&amp; (snapshotConfig != null)) {
443      *
444      *      Set<Size> snapshotSizeSet = snapshotConfig.getOutputSizes(
445      *              ImageFormat.JPEG);
446      *      Size[] snapshotSizes = new Size[snapshotSizeSet.size()];
447      *      snapshotSizes = snapshotSizeSet.toArray(snapshotSizes);
448      *      Size suggestedMaxJpegSize = getMaxSize(snapshotSizes);
449      *
450      *      Set<Size> previewSizeSet = snapshotConfig.getOutputSizes(
451      *              ImageFormat.PRIVATE);
452      *      Size[] previewSizes = new Size[previewSizeSet.size()];
453      *      previewSizes = previewSizeSet.toArray(previewSizes);
454      *      Size suggestedMaxPreviewSize = getMaxSize(previewSizes);
455      * }
456      *
457      * </code></pre>
458      *
459      * <p>Similar logic can be used for other use cases as well.</p>
460      *
461      * <p>Support for recommended stream configurations is optional. In case there a no
462      * suggested configurations for the particular use case, please refer to
463      * {@link #SCALER_STREAM_CONFIGURATION_MAP} for the exhaustive available list.</p>
464      *
465      * @param usecase Use case id.
466      *
467      * @throws IllegalArgumentException In case the use case argument is invalid.
468      * @return Valid {@link RecommendedStreamConfigurationMap} or null in case the camera device
469      *         doesn't have any recommendation for this use case or the recommended configurations
470      *         are invalid.
471      */
getRecommendedStreamConfigurationMap( @ecommendedStreamConfigurationMap.RecommendedUsecase int usecase)472     public @Nullable RecommendedStreamConfigurationMap getRecommendedStreamConfigurationMap(
473             @RecommendedStreamConfigurationMap.RecommendedUsecase int usecase) {
474         if (((usecase >= RecommendedStreamConfigurationMap.USECASE_PREVIEW) &&
475                 (usecase <= RecommendedStreamConfigurationMap.USECASE_10BIT_OUTPUT)) ||
476                 ((usecase >= RecommendedStreamConfigurationMap.USECASE_VENDOR_START) &&
477                 (usecase < RecommendedStreamConfigurationMap.MAX_USECASE_COUNT))) {
478             if (mRecommendedConfigurations == null) {
479                 mRecommendedConfigurations = mProperties.getRecommendedStreamConfigurations();
480                 if (mRecommendedConfigurations == null) {
481                     return null;
482                 }
483             }
484 
485             return mRecommendedConfigurations.get(usecase);
486         }
487 
488         throw new IllegalArgumentException(String.format("Invalid use case: %d", usecase));
489     }
490 
491     /**
492      * <p>Returns a subset of {@link #getAvailableCaptureRequestKeys} keys that the
493      * camera device can pass as part of the capture session initialization.</p>
494      *
495      * <p>This list includes keys that are difficult to apply per-frame and
496      * can result in unexpected delays when modified during the capture session
497      * lifetime. Typical examples include parameters that require a
498      * time-consuming hardware re-configuration or internal camera pipeline
499      * change. For performance reasons we suggest clients to pass their initial
500      * values as part of {@link SessionConfiguration#setSessionParameters}. Once
501      * the camera capture session is enabled it is also recommended to avoid
502      * changing them from their initial values set in
503      * {@link SessionConfiguration#setSessionParameters }.
504      * Control over session parameters can still be exerted in capture requests
505      * but clients should be aware and expect delays during their application.
506      * An example usage scenario could look like this:</p>
507      * <ul>
508      * <li>The camera client starts by querying the session parameter key list via
509      *   {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys }.</li>
510      * <li>Before triggering the capture session create sequence, a capture request
511      *   must be built via {@link CameraDevice#createCaptureRequest } using an
512      *   appropriate template matching the particular use case.</li>
513      * <li>The client should go over the list of session parameters and check
514      *   whether some of the keys listed matches with the parameters that
515      *   they intend to modify as part of the first capture request.</li>
516      * <li>If there is no such match, the capture request can be  passed
517      *   unmodified to {@link SessionConfiguration#setSessionParameters }.</li>
518      * <li>If matches do exist, the client should update the respective values
519      *   and pass the request to {@link SessionConfiguration#setSessionParameters }.</li>
520      * <li>After the capture session initialization completes the session parameter
521      *   key list can continue to serve as reference when posting or updating
522      *   further requests. As mentioned above further changes to session
523      *   parameters should ideally be avoided, if updates are necessary
524      *   however clients could expect a delay/glitch during the
525      *   parameter switch.</li>
526      * </ul>
527      *
528      * <p>The list returned is not modifiable, so any attempts to modify it will throw
529      * a {@code UnsupportedOperationException}.</p>
530      *
531      * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
532      *
533      * @return List of keys that can be passed during capture session initialization. In case the
534      * camera device doesn't support such keys the list can be null.
535      */
536     @SuppressWarnings({"unchecked"})
getAvailableSessionKeys()537     public List<CaptureRequest.Key<?>> getAvailableSessionKeys() {
538         if (mAvailableSessionKeys == null) {
539             Object crKey = CaptureRequest.Key.class;
540             Class<CaptureRequest.Key<?>> crKeyTyped = (Class<CaptureRequest.Key<?>>)crKey;
541 
542             int[] filterTags = get(REQUEST_AVAILABLE_SESSION_KEYS);
543             if (filterTags == null) {
544                 return null;
545             }
546             mAvailableSessionKeys =
547                     getAvailableKeyList(CaptureRequest.class, crKeyTyped, filterTags,
548                             /*includeSynthetic*/ false);
549         }
550         return mAvailableSessionKeys;
551     }
552 
553     /**
554      * <p>Get the keys in Camera Characteristics whose values are capture session specific.
555      * The session specific characteristics can be acquired by calling
556      * CameraDevice.getSessionCharacteristics(). </p>
557      *
558      * <p>Note that getAvailableSessionKeys returns the CaptureRequest keys that are difficult to
559      * apply per-frame, whereas this function returns CameraCharacteristics keys that are dependent
560      * on a particular SessionConfiguration.</p>
561      *
562      * @return List of CameraCharacteristic keys containing characterisitics specific to a session
563      * configuration. If {@link #INFO_SESSION_CONFIGURATION_QUERY_VERSION} is at least
564      * {@link Build.VERSION_CODES#VANILLA_ICE_CREAM}, then this list will only contain
565      * CONTROL_ZOOM_RATIO_RANGE and SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
566      *
567      * @see #INFO_SESSION_CONFIGURATION_QUERY_VERSION
568      */
569     @NonNull
getAvailableSessionCharacteristicsKeys()570     public List<CameraCharacteristics.Key<?>> getAvailableSessionCharacteristicsKeys() {
571         if (mAvailableSessionCharacteristicsKeys != null) {
572             return mAvailableSessionCharacteristicsKeys;
573         }
574 
575         Integer queryVersion = get(INFO_SESSION_CONFIGURATION_QUERY_VERSION);
576         if (queryVersion == null) {
577             mAvailableSessionCharacteristicsKeys = List.of();
578             return mAvailableSessionCharacteristicsKeys;
579         }
580 
581         mAvailableSessionCharacteristicsKeys =
582                 AVAILABLE_SESSION_CHARACTERISTICS_KEYS_MAP.entrySet().stream()
583                         .filter(e -> e.getKey() <= queryVersion)
584                         .map(Map.Entry::getValue)
585                         .flatMap(Arrays::stream)
586                         .collect(Collectors.toUnmodifiableList());
587 
588         return mAvailableSessionCharacteristicsKeys;
589     }
590 
591     /**
592      * <p>Returns a subset of {@link #getAvailableCaptureRequestKeys} keys that can
593      * be overridden for physical devices backing a logical multi-camera.</p>
594      *
595      * <p>This is a subset of android.request.availableRequestKeys which contains a list
596      * of keys that can be overridden using {@link CaptureRequest.Builder#setPhysicalCameraKey }.
597      * The respective value of such request key can be obtained by calling
598      * {@link CaptureRequest.Builder#getPhysicalCameraKey }. Capture requests that contain
599      * individual physical device requests must be built via
600      * {@link android.hardware.camera2.CameraDevice#createCaptureRequest(int, Set)}.</p>
601      *
602      * <p>The list returned is not modifiable, so any attempts to modify it will throw
603      * a {@code UnsupportedOperationException}.</p>
604      *
605      * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
606      *
607      * @return List of keys that can be overridden in individual physical device requests.
608      * In case the camera device doesn't support such keys the list can be null.
609      */
610     @SuppressWarnings({"unchecked"})
getAvailablePhysicalCameraRequestKeys()611     public List<CaptureRequest.Key<?>> getAvailablePhysicalCameraRequestKeys() {
612         if (mAvailablePhysicalRequestKeys == null) {
613             Object crKey = CaptureRequest.Key.class;
614             Class<CaptureRequest.Key<?>> crKeyTyped = (Class<CaptureRequest.Key<?>>)crKey;
615 
616             int[] filterTags = get(REQUEST_AVAILABLE_PHYSICAL_CAMERA_REQUEST_KEYS);
617             if (filterTags == null) {
618                 return null;
619             }
620             mAvailablePhysicalRequestKeys =
621                     getAvailableKeyList(CaptureRequest.class, crKeyTyped, filterTags,
622                             /*includeSynthetic*/ false);
623         }
624         return mAvailablePhysicalRequestKeys;
625     }
626 
627     /**
628      * Returns the list of keys supported by this {@link CameraDevice} for querying
629      * with a {@link CaptureRequest}.
630      *
631      * <p>The list returned is not modifiable, so any attempts to modify it will throw
632      * a {@code UnsupportedOperationException}.</p>
633      *
634      * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
635      *
636      * <p>Note that there is no {@code getAvailableCameraCharacteristicsKeys()} -- use
637      * {@link #getKeys()} instead.</p>
638      *
639      * @return List of keys supported by this CameraDevice for CaptureRequests.
640      */
641     @SuppressWarnings({"unchecked"})
642     @NonNull
getAvailableCaptureRequestKeys()643     public List<CaptureRequest.Key<?>> getAvailableCaptureRequestKeys() {
644         if (mAvailableRequestKeys == null) {
645             Object crKey = CaptureRequest.Key.class;
646             Class<CaptureRequest.Key<?>> crKeyTyped = (Class<CaptureRequest.Key<?>>)crKey;
647 
648             int[] filterTags = get(REQUEST_AVAILABLE_REQUEST_KEYS);
649             if (filterTags == null) {
650                 throw new AssertionError("android.request.availableRequestKeys must be non-null "
651                         + "in the characteristics");
652             }
653             mAvailableRequestKeys =
654                     getAvailableKeyList(CaptureRequest.class, crKeyTyped, filterTags,
655                             /*includeSynthetic*/ true);
656         }
657         return mAvailableRequestKeys;
658     }
659 
660     /**
661      * Returns the list of keys supported by this {@link CameraDevice} for querying
662      * with a {@link CaptureResult}.
663      *
664      * <p>The list returned is not modifiable, so any attempts to modify it will throw
665      * a {@code UnsupportedOperationException}.</p>
666      *
667      * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
668      *
669      * <p>Note that there is no {@code getAvailableCameraCharacteristicsKeys()} -- use
670      * {@link #getKeys()} instead.</p>
671      *
672      * @return List of keys supported by this CameraDevice for CaptureResults.
673      */
674     @SuppressWarnings({"unchecked"})
675     @NonNull
getAvailableCaptureResultKeys()676     public List<CaptureResult.Key<?>> getAvailableCaptureResultKeys() {
677         if (mAvailableResultKeys == null) {
678             Object crKey = CaptureResult.Key.class;
679             Class<CaptureResult.Key<?>> crKeyTyped = (Class<CaptureResult.Key<?>>)crKey;
680 
681             int[] filterTags = get(REQUEST_AVAILABLE_RESULT_KEYS);
682             if (filterTags == null) {
683                 throw new AssertionError("android.request.availableResultKeys must be non-null "
684                         + "in the characteristics");
685             }
686             mAvailableResultKeys = getAvailableKeyList(CaptureResult.class, crKeyTyped, filterTags,
687                     /*includeSynthetic*/ true);
688         }
689         return mAvailableResultKeys;
690     }
691 
692     /**
693      * Returns the list of keys supported by this {@link CameraDevice} by metadataClass.
694      *
695      * <p>The list returned is not modifiable, so any attempts to modify it will throw
696      * a {@code UnsupportedOperationException}.</p>
697      *
698      * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
699      *
700      * @param metadataClass The subclass of CameraMetadata that you want to get the keys for.
701      * @param keyClass The class of the metadata key, e.g. CaptureRequest.Key.class
702      * @param filterTags An array of tags to be used for filtering
703      * @param includeSynthetic Include public synthetic tag by default.
704      *
705      * @return List of keys supported by this CameraDevice for metadataClass.
706      *
707      * @throws IllegalArgumentException if metadataClass is not a subclass of CameraMetadata
708      */
709     <TKey> List<TKey>
getAvailableKeyList(Class<?> metadataClass, Class<TKey> keyClass, int[] filterTags, boolean includeSynthetic)710     getAvailableKeyList(Class<?> metadataClass, Class<TKey> keyClass, int[] filterTags,
711             boolean includeSynthetic) {
712 
713         if (metadataClass.equals(CameraMetadata.class)) {
714             throw new AssertionError(
715                     "metadataClass must be a strict subclass of CameraMetadata");
716         } else if (!CameraMetadata.class.isAssignableFrom(metadataClass)) {
717             throw new AssertionError(
718                     "metadataClass must be a subclass of CameraMetadata");
719         }
720 
721         List<TKey> staticKeyList = getKeys(
722                 metadataClass, keyClass, /*instance*/null, filterTags, includeSynthetic);
723         return Collections.unmodifiableList(staticKeyList);
724     }
725 
726     /**
727      * Returns the set of physical camera ids that this logical {@link CameraDevice} is
728      * made up of.
729      *
730      * <p>A camera device is a logical camera if it has
731      * REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA capability. If the camera device
732      * doesn't have the capability, the return value will be an empty set. </p>
733      *
734      * <p>Prior to API level 29, all returned IDs are guaranteed to be returned by {@link
735      * CameraManager#getCameraIdList}, and can be opened directly by
736      * {@link CameraManager#openCamera}. Starting from API level 29, for each of the returned ID,
737      * if it's also returned by {@link CameraManager#getCameraIdList}, it can be used as a
738      * standalone camera by {@link CameraManager#openCamera}. Otherwise, the camera ID can only be
739      * used as part of the current logical camera.</p>
740      *
741      * <p>The set returned is not modifiable, so any attempts to modify it will throw
742      * a {@code UnsupportedOperationException}.</p>
743      *
744      * @return Set of physical camera ids for this logical camera device.
745      */
746     @NonNull
getPhysicalCameraIds()747     public Set<String> getPhysicalCameraIds() {
748         return mProperties.getPhysicalCameraIds();
749     }
750 
751     /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
752      * The key entries below this point are generated from metadata
753      * definitions in /system/media/camera/docs. Do not modify by hand or
754      * modify the comment blocks at the start or end.
755      *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
756 
757     /**
758      * <p>List of aberration correction modes for {@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode} that are
759      * supported by this camera device.</p>
760      * <p>This key lists the valid modes for {@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode}.  If no
761      * aberration correction modes are available for a device, this list will solely include
762      * OFF mode. All camera devices will support either OFF or FAST mode.</p>
763      * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always list
764      * OFF mode. This includes all FULL level devices.</p>
765      * <p>LEGACY devices will always only support FAST mode.</p>
766      * <p><b>Range of valid values:</b><br>
767      * Any value listed in {@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode}</p>
768      * <p>This key is available on all devices.</p>
769      *
770      * @see CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE
771      */
772     @PublicKey
773     @NonNull
774     public static final Key<int[]> COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES =
775             new Key<int[]>("android.colorCorrection.availableAberrationModes", int[].class);
776 
777     /**
778      * <p>The range of supported color temperature values for
779      * {@link CaptureRequest#COLOR_CORRECTION_COLOR_TEMPERATURE android.colorCorrection.colorTemperature}.</p>
780      * <p>This key lists the valid range of color temperature values for
781      * {@link CaptureRequest#COLOR_CORRECTION_COLOR_TEMPERATURE android.colorCorrection.colorTemperature} supported by this camera device.</p>
782      * <p>This key will be null on devices that do not support CCT mode for
783      * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
784      * <p><b>Range of valid values:</b><br></p>
785      * <p>The minimum supported range will be [2856K,6500K]. The maximum supported
786      * range will be [1000K,40000K].</p>
787      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
788      *
789      * @see CaptureRequest#COLOR_CORRECTION_COLOR_TEMPERATURE
790      * @see CaptureRequest#COLOR_CORRECTION_MODE
791      */
792     @PublicKey
793     @NonNull
794     @FlaggedApi(Flags.FLAG_COLOR_TEMPERATURE)
795     public static final Key<android.util.Range<Integer>> COLOR_CORRECTION_COLOR_TEMPERATURE_RANGE =
796             new Key<android.util.Range<Integer>>("android.colorCorrection.colorTemperatureRange", new TypeReference<android.util.Range<Integer>>() {{ }});
797 
798     /**
799      * <p>List of color correction modes for {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} that are
800      * supported by this camera device.</p>
801      * <p>This key lists the valid modes for {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. If no
802      * color correction modes are available for a device, this key will be null.</p>
803      * <p>Camera devices that have a FULL hardware level will always include at least
804      * FAST, HIGH_QUALITY, and TRANSFORM_MATRIX modes.</p>
805      * <p><b>Range of valid values:</b><br>
806      * Any value listed in {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}</p>
807      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
808      *
809      * @see CaptureRequest#COLOR_CORRECTION_MODE
810      */
811     @PublicKey
812     @NonNull
813     @FlaggedApi(Flags.FLAG_COLOR_TEMPERATURE)
814     public static final Key<int[]> COLOR_CORRECTION_AVAILABLE_MODES =
815             new Key<int[]>("android.colorCorrection.availableModes", int[].class);
816 
817     /**
818      * <p>List of auto-exposure antibanding modes for {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} that are
819      * supported by this camera device.</p>
820      * <p>Not all of the auto-exposure anti-banding modes may be
821      * supported by a given camera device. This field lists the
822      * valid anti-banding modes that the application may request
823      * for this camera device with the
824      * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} control.</p>
825      * <p><b>Range of valid values:</b><br>
826      * Any value listed in {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode}</p>
827      * <p>This key is available on all devices.</p>
828      *
829      * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
830      */
831     @PublicKey
832     @NonNull
833     public static final Key<int[]> CONTROL_AE_AVAILABLE_ANTIBANDING_MODES =
834             new Key<int[]>("android.control.aeAvailableAntibandingModes", int[].class);
835 
836     /**
837      * <p>List of auto-exposure modes for {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} that are supported by this camera
838      * device.</p>
839      * <p>Not all the auto-exposure modes may be supported by a
840      * given camera device, especially if no flash unit is
841      * available. This entry lists the valid modes for
842      * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} for this camera device.</p>
843      * <p>All camera devices support ON, and all camera devices with flash
844      * units support ON_AUTO_FLASH and ON_ALWAYS_FLASH.</p>
845      * <p>FULL mode camera devices always support OFF mode,
846      * which enables application control of camera exposure time,
847      * sensitivity, and frame duration.</p>
848      * <p>LEGACY mode camera devices never support OFF mode.
849      * LIMITED mode devices support OFF if they support the MANUAL_SENSOR
850      * capability.</p>
851      * <p><b>Range of valid values:</b><br>
852      * Any value listed in {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}</p>
853      * <p>This key is available on all devices.</p>
854      *
855      * @see CaptureRequest#CONTROL_AE_MODE
856      */
857     @PublicKey
858     @NonNull
859     public static final Key<int[]> CONTROL_AE_AVAILABLE_MODES =
860             new Key<int[]>("android.control.aeAvailableModes", int[].class);
861 
862     /**
863      * <p>List of frame rate ranges for {@link CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE android.control.aeTargetFpsRange} supported by
864      * this camera device.</p>
865      * <p>For devices at the LEGACY level or above:</p>
866      * <ul>
867      * <li>
868      * <p>For constant-framerate recording, for each normal
869      * {@link android.media.CamcorderProfile CamcorderProfile}, that is, a
870      * {@link android.media.CamcorderProfile CamcorderProfile} that has
871      * {@link android.media.CamcorderProfile#quality quality} in
872      * the range [{@link android.media.CamcorderProfile#QUALITY_LOW QUALITY_LOW},
873      * {@link android.media.CamcorderProfile#QUALITY_2160P QUALITY_2160P}], if the profile is
874      * supported by the device and has
875      * {@link android.media.CamcorderProfile#videoFrameRate videoFrameRate} <code>x</code>, this list will
876      * always include (<code>x</code>,<code>x</code>).</p>
877      * </li>
878      * <li>
879      * <p>Also, a camera device must either not support any
880      * {@link android.media.CamcorderProfile CamcorderProfile},
881      * or support at least one
882      * normal {@link android.media.CamcorderProfile CamcorderProfile} that has
883      * {@link android.media.CamcorderProfile#videoFrameRate videoFrameRate} <code>x</code> &gt;= 24.</p>
884      * </li>
885      * </ul>
886      * <p>For devices at the LIMITED level or above:</p>
887      * <ul>
888      * <li>For devices that advertise NIR color filter arrangement in
889      * {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}, this list will always include
890      * (<code>max</code>, <code>max</code>) where <code>max</code> = the maximum output frame rate of the maximum YUV_420_888
891      * output size.</li>
892      * <li>For devices advertising any color filter arrangement other than NIR, or devices not
893      * advertising color filter arrangement, this list will always include (<code>min</code>, <code>max</code>) and
894      * (<code>max</code>, <code>max</code>) where <code>min</code> &lt;= 15 and <code>max</code> = the maximum output frame rate of the
895      * maximum YUV_420_888 output size.</li>
896      * </ul>
897      * <p><b>Units</b>: Frames per second (FPS)</p>
898      * <p>This key is available on all devices.</p>
899      *
900      * @see CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE
901      * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
902      */
903     @PublicKey
904     @NonNull
905     public static final Key<android.util.Range<Integer>[]> CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES =
906             new Key<android.util.Range<Integer>[]>("android.control.aeAvailableTargetFpsRanges", new TypeReference<android.util.Range<Integer>[]>() {{ }});
907 
908     /**
909      * <p>Maximum and minimum exposure compensation values for
910      * {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation}, in counts of {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep},
911      * that are supported by this camera device.</p>
912      * <p><b>Range of valid values:</b><br></p>
913      * <p>Range [0,0] indicates that exposure compensation is not supported.</p>
914      * <p>For LIMITED and FULL devices, range must follow below requirements if exposure
915      * compensation is supported (<code>range != [0, 0]</code>):</p>
916      * <p><code>Min.exposure compensation * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} &lt;= -2 EV</code></p>
917      * <p><code>Max.exposure compensation * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} &gt;= 2 EV</code></p>
918      * <p>LEGACY devices may support a smaller range than this.</p>
919      * <p>This key is available on all devices.</p>
920      *
921      * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
922      * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
923      */
924     @PublicKey
925     @NonNull
926     public static final Key<android.util.Range<Integer>> CONTROL_AE_COMPENSATION_RANGE =
927             new Key<android.util.Range<Integer>>("android.control.aeCompensationRange", new TypeReference<android.util.Range<Integer>>() {{ }});
928 
929     /**
930      * <p>Smallest step by which the exposure compensation
931      * can be changed.</p>
932      * <p>This is the unit for {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation}. For example, if this key has
933      * 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
934      * that the target EV offset for the auto-exposure routine is -1 EV.</p>
935      * <p>One unit of EV compensation changes the brightness of the captured image by a factor
936      * of two. +1 EV doubles the image brightness, while -1 EV halves the image brightness.</p>
937      * <p><b>Units</b>: Exposure Value (EV)</p>
938      * <p>This key is available on all devices.</p>
939      *
940      * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
941      */
942     @PublicKey
943     @NonNull
944     public static final Key<Rational> CONTROL_AE_COMPENSATION_STEP =
945             new Key<Rational>("android.control.aeCompensationStep", Rational.class);
946 
947     /**
948      * <p>List of auto-focus (AF) modes for {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} that are
949      * supported by this camera device.</p>
950      * <p>Not all the auto-focus modes may be supported by a
951      * given camera device. This entry lists the valid modes for
952      * {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} for this camera device.</p>
953      * <p>All LIMITED and FULL mode camera devices will support OFF mode, and all
954      * camera devices with adjustable focuser units
955      * (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>) will support AUTO mode.</p>
956      * <p>LEGACY devices will support OFF mode only if they support
957      * focusing to infinity (by also setting {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} to
958      * <code>0.0f</code>).</p>
959      * <p><b>Range of valid values:</b><br>
960      * Any value listed in {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}</p>
961      * <p>This key is available on all devices.</p>
962      *
963      * @see CaptureRequest#CONTROL_AF_MODE
964      * @see CaptureRequest#LENS_FOCUS_DISTANCE
965      * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
966      */
967     @PublicKey
968     @NonNull
969     public static final Key<int[]> CONTROL_AF_AVAILABLE_MODES =
970             new Key<int[]>("android.control.afAvailableModes", int[].class);
971 
972     /**
973      * <p>List of color effects for {@link CaptureRequest#CONTROL_EFFECT_MODE android.control.effectMode} that are supported by this camera
974      * device.</p>
975      * <p>This list contains the color effect modes that can be applied to
976      * images produced by the camera device.
977      * Implementations are not expected to be consistent across all devices.
978      * If no color effect modes are available for a device, this will only list
979      * OFF.</p>
980      * <p>A color effect will only be applied if
981      * {@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF.  OFF is always included in this list.</p>
982      * <p>This control has no effect on the operation of other control routines such
983      * as auto-exposure, white balance, or focus.</p>
984      * <p><b>Range of valid values:</b><br>
985      * Any value listed in {@link CaptureRequest#CONTROL_EFFECT_MODE android.control.effectMode}</p>
986      * <p>This key is available on all devices.</p>
987      *
988      * @see CaptureRequest#CONTROL_EFFECT_MODE
989      * @see CaptureRequest#CONTROL_MODE
990      */
991     @PublicKey
992     @NonNull
993     public static final Key<int[]> CONTROL_AVAILABLE_EFFECTS =
994             new Key<int[]>("android.control.availableEffects", int[].class);
995 
996     /**
997      * <p>List of scene modes for {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} that are supported by this camera
998      * device.</p>
999      * <p>This list contains scene modes that can be set for the camera device.
1000      * Only scene modes that have been fully implemented for the
1001      * camera device may be included here. Implementations are not expected
1002      * to be consistent across all devices.</p>
1003      * <p>If no scene modes are supported by the camera device, this
1004      * will be set to DISABLED. Otherwise DISABLED will not be listed.</p>
1005      * <p>FACE_PRIORITY is always listed if face detection is
1006      * supported (i.e.<code>{@link CameraCharacteristics#STATISTICS_INFO_MAX_FACE_COUNT android.statistics.info.maxFaceCount} &gt;
1007      * 0</code>).</p>
1008      * <p><b>Range of valid values:</b><br>
1009      * Any value listed in {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode}</p>
1010      * <p>This key is available on all devices.</p>
1011      *
1012      * @see CaptureRequest#CONTROL_SCENE_MODE
1013      * @see CameraCharacteristics#STATISTICS_INFO_MAX_FACE_COUNT
1014      */
1015     @PublicKey
1016     @NonNull
1017     public static final Key<int[]> CONTROL_AVAILABLE_SCENE_MODES =
1018             new Key<int[]>("android.control.availableSceneModes", int[].class);
1019 
1020     /**
1021      * <p>List of video stabilization modes for {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}
1022      * that are supported by this camera device.</p>
1023      * <p>OFF will always be listed.</p>
1024      * <p><b>Range of valid values:</b><br>
1025      * Any value listed in {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}</p>
1026      * <p>This key is available on all devices.</p>
1027      *
1028      * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
1029      */
1030     @PublicKey
1031     @NonNull
1032     public static final Key<int[]> CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES =
1033             new Key<int[]>("android.control.availableVideoStabilizationModes", int[].class);
1034 
1035     /**
1036      * <p>List of auto-white-balance modes for {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} that are supported by this
1037      * camera device.</p>
1038      * <p>Not all the auto-white-balance modes may be supported by a
1039      * given camera device. This entry lists the valid modes for
1040      * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} for this camera device.</p>
1041      * <p>All camera devices will support ON mode.</p>
1042      * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always support OFF
1043      * mode, which enables application control of white balance, by using
1044      * {@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
1045      * mode camera devices.</p>
1046      * <p><b>Range of valid values:</b><br>
1047      * Any value listed in {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}</p>
1048      * <p>This key is available on all devices.</p>
1049      *
1050      * @see CaptureRequest#COLOR_CORRECTION_GAINS
1051      * @see CaptureRequest#COLOR_CORRECTION_MODE
1052      * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
1053      * @see CaptureRequest#CONTROL_AWB_MODE
1054      */
1055     @PublicKey
1056     @NonNull
1057     public static final Key<int[]> CONTROL_AWB_AVAILABLE_MODES =
1058             new Key<int[]>("android.control.awbAvailableModes", int[].class);
1059 
1060     /**
1061      * <p>List of the maximum number of regions that can be used for metering in
1062      * auto-exposure (AE), auto-white balance (AWB), and auto-focus (AF);
1063      * this corresponds to the maximum number of elements in
1064      * {@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}, {@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions},
1065      * and {@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}.</p>
1066      * <p><b>Range of valid values:</b><br></p>
1067      * <p>Value must be &gt;= 0 for each element. For full-capability devices
1068      * this value must be &gt;= 1 for AE and AF. The order of the elements is:
1069      * <code>(AE, AWB, AF)</code>.</p>
1070      * <p>This key is available on all devices.</p>
1071      *
1072      * @see CaptureRequest#CONTROL_AE_REGIONS
1073      * @see CaptureRequest#CONTROL_AF_REGIONS
1074      * @see CaptureRequest#CONTROL_AWB_REGIONS
1075      * @hide
1076      */
1077     public static final Key<int[]> CONTROL_MAX_REGIONS =
1078             new Key<int[]>("android.control.maxRegions", int[].class);
1079 
1080     /**
1081      * <p>The maximum number of metering regions that can be used by the auto-exposure (AE)
1082      * routine.</p>
1083      * <p>This corresponds to the maximum allowed number of elements in
1084      * {@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}.</p>
1085      * <p><b>Range of valid values:</b><br>
1086      * Value will be &gt;= 0. For FULL-capability devices, this
1087      * value will be &gt;= 1.</p>
1088      * <p>This key is available on all devices.</p>
1089      *
1090      * @see CaptureRequest#CONTROL_AE_REGIONS
1091      */
1092     @PublicKey
1093     @NonNull
1094     @SyntheticKey
1095     public static final Key<Integer> CONTROL_MAX_REGIONS_AE =
1096             new Key<Integer>("android.control.maxRegionsAe", int.class);
1097 
1098     /**
1099      * <p>The maximum number of metering regions that can be used by the auto-white balance (AWB)
1100      * routine.</p>
1101      * <p>This corresponds to the maximum allowed number of elements in
1102      * {@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions}.</p>
1103      * <p><b>Range of valid values:</b><br>
1104      * Value will be &gt;= 0.</p>
1105      * <p>This key is available on all devices.</p>
1106      *
1107      * @see CaptureRequest#CONTROL_AWB_REGIONS
1108      */
1109     @PublicKey
1110     @NonNull
1111     @SyntheticKey
1112     public static final Key<Integer> CONTROL_MAX_REGIONS_AWB =
1113             new Key<Integer>("android.control.maxRegionsAwb", int.class);
1114 
1115     /**
1116      * <p>The maximum number of metering regions that can be used by the auto-focus (AF) routine.</p>
1117      * <p>This corresponds to the maximum allowed number of elements in
1118      * {@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}.</p>
1119      * <p><b>Range of valid values:</b><br>
1120      * Value will be &gt;= 0. For FULL-capability devices, this
1121      * value will be &gt;= 1.</p>
1122      * <p>This key is available on all devices.</p>
1123      *
1124      * @see CaptureRequest#CONTROL_AF_REGIONS
1125      */
1126     @PublicKey
1127     @NonNull
1128     @SyntheticKey
1129     public static final Key<Integer> CONTROL_MAX_REGIONS_AF =
1130             new Key<Integer>("android.control.maxRegionsAf", int.class);
1131 
1132     /**
1133      * <p>List of available high speed video size, fps range and max batch size configurations
1134      * supported by the camera device, in the format of (width, height, fps_min, fps_max, batch_size_max).</p>
1135      * <p>When CONSTRAINED_HIGH_SPEED_VIDEO is supported in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities},
1136      * this metadata will list the supported high speed video size, fps range and max batch size
1137      * configurations. All the sizes listed in this configuration will be a subset of the sizes
1138      * reported by {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes }
1139      * for processed non-stalling formats.</p>
1140      * <p>For the high speed video use case, the application must
1141      * select the video size and fps range from this metadata to configure the recording and
1142      * preview streams and setup the recording requests. For example, if the application intends
1143      * to do high speed recording, it can select the maximum size reported by this metadata to
1144      * configure output streams. Once the size is selected, application can filter this metadata
1145      * by selected size and get the supported fps ranges, and use these fps ranges to setup the
1146      * recording requests. Note that for the use case of multiple output streams, application
1147      * must select one unique size from this metadata to use (e.g., preview and recording streams
1148      * must have the same size). Otherwise, the high speed capture session creation will fail.</p>
1149      * <p>The min and max fps will be multiple times of 30fps.</p>
1150      * <p>High speed video streaming extends significant performance pressure to camera hardware,
1151      * to achieve efficient high speed streaming, the camera device may have to aggregate
1152      * multiple frames together and send to camera device for processing where the request
1153      * controls are same for all the frames in this batch. Max batch size indicates
1154      * the max possible number of frames the camera device will group together for this high
1155      * speed stream configuration. This max batch size will be used to generate a high speed
1156      * recording request list by
1157      * {@link android.hardware.camera2.CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList }.
1158      * The max batch size for each configuration will satisfy below conditions:</p>
1159      * <ul>
1160      * <li>Each max batch size will be a divisor of its corresponding fps_max / 30. For example,
1161      * if max_fps is 300, max batch size will only be 1, 2, 5, or 10.</li>
1162      * <li>The camera device may choose smaller internal batch size for each configuration, but
1163      * the actual batch size will be a divisor of max batch size. For example, if the max batch
1164      * size is 8, the actual batch size used by camera device will only be 1, 2, 4, or 8.</li>
1165      * <li>The max batch size in each configuration entry must be no larger than 32.</li>
1166      * </ul>
1167      * <p>The camera device doesn't have to support batch mode to achieve high speed video recording,
1168      * in such case, batch_size_max will be reported as 1 in each configuration entry.</p>
1169      * <p>This fps ranges in this configuration list can only be used to create requests
1170      * that are submitted to a high speed camera capture session created by
1171      * {@link android.hardware.camera2.CameraDevice#createConstrainedHighSpeedCaptureSession }.
1172      * The fps ranges reported in this metadata must not be used to setup capture requests for
1173      * normal capture session, or it will cause request error.</p>
1174      * <p><b>Range of valid values:</b><br></p>
1175      * <p>For each configuration, the fps_max &gt;= 120fps.</p>
1176      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1177      * <p><b>Limited capability</b> -
1178      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1179      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1180      *
1181      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1182      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1183      * @hide
1184      */
1185     public static final Key<android.hardware.camera2.params.HighSpeedVideoConfiguration[]> CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS =
1186             new Key<android.hardware.camera2.params.HighSpeedVideoConfiguration[]>("android.control.availableHighSpeedVideoConfigurations", android.hardware.camera2.params.HighSpeedVideoConfiguration[].class);
1187 
1188     /**
1189      * <p>Whether the camera device supports {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock}</p>
1190      * <p>Devices with MANUAL_SENSOR capability or BURST_CAPTURE capability will always
1191      * list <code>true</code>. This includes FULL devices.</p>
1192      * <p>This key is available on all devices.</p>
1193      *
1194      * @see CaptureRequest#CONTROL_AE_LOCK
1195      */
1196     @PublicKey
1197     @NonNull
1198     public static final Key<Boolean> CONTROL_AE_LOCK_AVAILABLE =
1199             new Key<Boolean>("android.control.aeLockAvailable", boolean.class);
1200 
1201     /**
1202      * <p>Whether the camera device supports {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock}</p>
1203      * <p>Devices with MANUAL_POST_PROCESSING capability or BURST_CAPTURE capability will
1204      * always list <code>true</code>. This includes FULL devices.</p>
1205      * <p>This key is available on all devices.</p>
1206      *
1207      * @see CaptureRequest#CONTROL_AWB_LOCK
1208      */
1209     @PublicKey
1210     @NonNull
1211     public static final Key<Boolean> CONTROL_AWB_LOCK_AVAILABLE =
1212             new Key<Boolean>("android.control.awbLockAvailable", boolean.class);
1213 
1214     /**
1215      * <p>List of control modes for {@link CaptureRequest#CONTROL_MODE android.control.mode} that are supported by this camera
1216      * device.</p>
1217      * <p>This list contains control modes that can be set for the camera device.
1218      * LEGACY mode devices will always support AUTO mode. LIMITED and FULL
1219      * devices will always support OFF, AUTO modes.</p>
1220      * <p><b>Range of valid values:</b><br>
1221      * Any value listed in {@link CaptureRequest#CONTROL_MODE android.control.mode}</p>
1222      * <p>This key is available on all devices.</p>
1223      *
1224      * @see CaptureRequest#CONTROL_MODE
1225      */
1226     @PublicKey
1227     @NonNull
1228     public static final Key<int[]> CONTROL_AVAILABLE_MODES =
1229             new Key<int[]>("android.control.availableModes", int[].class);
1230 
1231     /**
1232      * <p>Range of boosts for {@link CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST android.control.postRawSensitivityBoost} supported
1233      * by this camera device.</p>
1234      * <p>Devices support post RAW sensitivity boost  will advertise
1235      * {@link CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST android.control.postRawSensitivityBoost} key for controlling
1236      * post RAW sensitivity boost.</p>
1237      * <p>This key will be <code>null</code> for devices that do not support any RAW format
1238      * outputs. For devices that do support RAW format outputs, this key will always
1239      * present, and if a device does not support post RAW sensitivity boost, it will
1240      * list <code>(100, 100)</code> in this key.</p>
1241      * <p><b>Units</b>: ISO arithmetic units, the same as {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</p>
1242      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1243      *
1244      * @see CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST
1245      * @see CaptureRequest#SENSOR_SENSITIVITY
1246      */
1247     @PublicKey
1248     @NonNull
1249     public static final Key<android.util.Range<Integer>> CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE =
1250             new Key<android.util.Range<Integer>>("android.control.postRawSensitivityBoostRange", new TypeReference<android.util.Range<Integer>>() {{ }});
1251 
1252     /**
1253      * <p>The list of extended scene modes for {@link CaptureRequest#CONTROL_EXTENDED_SCENE_MODE android.control.extendedSceneMode} that are supported
1254      * by this camera device, and each extended scene mode's maximum streaming (non-stall) size
1255      * with  effect.</p>
1256      * <p>For DISABLED mode, the camera behaves normally with no extended scene mode enabled.</p>
1257      * <p>For BOKEH_STILL_CAPTURE mode, the maximum streaming dimension specifies the limit
1258      * under which bokeh is effective when capture intent is PREVIEW. Note that when capture
1259      * intent is PREVIEW, the bokeh effect may not be as high in quality compared to
1260      * STILL_CAPTURE intent in order to maintain reasonable frame rate. The maximum streaming
1261      * dimension must be one of the YUV_420_888 or PRIVATE resolutions in
1262      * availableStreamConfigurations, or (0, 0) if preview bokeh is not supported. If the
1263      * application configures a stream larger than the maximum streaming dimension, bokeh
1264      * effect may not be applied for this stream for PREVIEW intent.</p>
1265      * <p>For BOKEH_CONTINUOUS mode, the maximum streaming dimension specifies the limit under
1266      * which bokeh is effective. This dimension must be one of the YUV_420_888 or PRIVATE
1267      * resolutions in availableStreamConfigurations, and if the sensor maximum resolution is
1268      * larger than or equal to 1080p, the maximum streaming dimension must be at least 1080p.
1269      * If the application configures a stream with larger dimension, the stream may not have
1270      * bokeh effect applied.</p>
1271      * <p><b>Units</b>: (mode, width, height)</p>
1272      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1273      * <p><b>Limited capability</b> -
1274      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1275      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1276      *
1277      * @see CaptureRequest#CONTROL_EXTENDED_SCENE_MODE
1278      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1279      * @hide
1280      */
1281     public static final Key<int[]> CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_MAX_SIZES =
1282             new Key<int[]>("android.control.availableExtendedSceneModeMaxSizes", int[].class);
1283 
1284     /**
1285      * <p>The ranges of supported zoom ratio for non-DISABLED {@link CaptureRequest#CONTROL_EXTENDED_SCENE_MODE android.control.extendedSceneMode}.</p>
1286      * <p>When extended scene mode is set, the camera device may have limited range of zoom ratios
1287      * compared to when extended scene mode is DISABLED. This tag lists the zoom ratio ranges
1288      * for all supported non-DISABLED extended scene modes, in the same order as in
1289      * android.control.availableExtended.</p>
1290      * <p>Range [1.0, 1.0] means that no zoom (optical or digital) is supported.</p>
1291      * <p><b>Units</b>: (minZoom, maxZoom)</p>
1292      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1293      * <p><b>Limited capability</b> -
1294      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1295      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1296      *
1297      * @see CaptureRequest#CONTROL_EXTENDED_SCENE_MODE
1298      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1299      * @hide
1300      */
1301     public static final Key<float[]> CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_ZOOM_RATIO_RANGES =
1302             new Key<float[]>("android.control.availableExtendedSceneModeZoomRatioRanges", float[].class);
1303 
1304     /**
1305      * <p>The list of extended scene modes for {@link CaptureRequest#CONTROL_EXTENDED_SCENE_MODE android.control.extendedSceneMode} that
1306      * are supported by this camera device, and each extended scene mode's capabilities such
1307      * as maximum streaming size, and supported zoom ratio ranges.</p>
1308      * <p>For DISABLED mode, the camera behaves normally with no extended scene mode enabled.</p>
1309      * <p>For BOKEH_STILL_CAPTURE mode, the maximum streaming dimension specifies the limit
1310      * under which bokeh is effective when capture intent is PREVIEW. Note that when capture
1311      * intent is PREVIEW, the bokeh effect may not be as high quality compared to STILL_CAPTURE
1312      * intent in order to maintain reasonable frame rate. The maximum streaming dimension must
1313      * be one of the YUV_420_888 or PRIVATE resolutions in availableStreamConfigurations, or
1314      * (0, 0) if preview bokeh is not supported. If the application configures a stream
1315      * larger than the maximum streaming dimension, bokeh effect may not be applied for this
1316      * stream for PREVIEW intent.</p>
1317      * <p>For BOKEH_CONTINUOUS mode, the maximum streaming dimension specifies the limit under
1318      * which bokeh is effective. This dimension must be one of the YUV_420_888 or PRIVATE
1319      * resolutions in availableStreamConfigurations, and if the sensor maximum resolution is
1320      * larger than or equal to 1080p, the maximum streaming dimension must be at least 1080p.
1321      * If the application configures a stream with larger dimension, the stream may not have
1322      * bokeh effect applied.</p>
1323      * <p>When extended scene mode is set, the camera device may have limited range of zoom ratios
1324      * compared to when the mode is DISABLED. availableExtendedSceneModeCapabilities lists the
1325      * zoom ranges for all supported extended modes. A range of (1.0, 1.0) means that no zoom
1326      * (optical or digital) is supported.</p>
1327      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1328      *
1329      * @see CaptureRequest#CONTROL_EXTENDED_SCENE_MODE
1330      */
1331     @PublicKey
1332     @NonNull
1333     @SyntheticKey
1334     public static final Key<android.hardware.camera2.params.Capability[]> CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_CAPABILITIES =
1335             new Key<android.hardware.camera2.params.Capability[]>("android.control.availableExtendedSceneModeCapabilities", android.hardware.camera2.params.Capability[].class);
1336 
1337     /**
1338      * <p>Minimum and maximum zoom ratios supported by this camera device.</p>
1339      * <p>If the camera device supports zoom-out from 1x zoom, minZoom will be less than 1.0, and
1340      * setting {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} to values less than 1.0 increases the camera's field
1341      * of view.</p>
1342      * <p><b>Units</b>: A pair of zoom ratio in floating-points: (minZoom, maxZoom)</p>
1343      * <p><b>Range of valid values:</b><br></p>
1344      * <p>maxZoom &gt;= 1.0 &gt;= minZoom</p>
1345      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1346      * <p><b>Limited capability</b> -
1347      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1348      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1349      *
1350      * @see CaptureRequest#CONTROL_ZOOM_RATIO
1351      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1352      */
1353     @PublicKey
1354     @NonNull
1355     public static final Key<android.util.Range<Float>> CONTROL_ZOOM_RATIO_RANGE =
1356             new Key<android.util.Range<Float>>("android.control.zoomRatioRange", new TypeReference<android.util.Range<Float>>() {{ }});
1357 
1358     /**
1359      * <p>List of available high speed video size, fps range and max batch size configurations
1360      * supported by the camera device, in the format of
1361      * (width, height, fps_min, fps_max, batch_size_max),
1362      * when {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
1363      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
1364      * <p>Analogous to android.control.availableHighSpeedVideoConfigurations, for configurations
1365      * which are applicable when {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
1366      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
1367      * <p><b>Range of valid values:</b><br></p>
1368      * <p>For each configuration, the fps_max &gt;= 120fps.</p>
1369      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1370      *
1371      * @see CaptureRequest#SENSOR_PIXEL_MODE
1372      * @hide
1373      */
1374     public static final Key<android.hardware.camera2.params.HighSpeedVideoConfiguration[]> CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS_MAXIMUM_RESOLUTION =
1375             new Key<android.hardware.camera2.params.HighSpeedVideoConfiguration[]>("android.control.availableHighSpeedVideoConfigurationsMaximumResolution", android.hardware.camera2.params.HighSpeedVideoConfiguration[].class);
1376 
1377     /**
1378      * <p>List of available settings overrides supported by the camera device that can
1379      * be used to speed up certain controls.</p>
1380      * <p>When not all controls within a CaptureRequest are required to take effect
1381      * at the same time on the outputs, the camera device may apply certain request keys sooner
1382      * to improve latency. This list contains such supported settings overrides. Each settings
1383      * override corresponds to a set of CaptureRequest keys that can be sped up when applying.</p>
1384      * <p>A supported settings override can be passed in via
1385      * {@link android.hardware.camera2.CaptureRequest#CONTROL_SETTINGS_OVERRIDE }, and the
1386      * CaptureRequest keys corresponding to the override are applied as soon as possible, not
1387      * bound by per-frame synchronization. See {@link CaptureRequest#CONTROL_SETTINGS_OVERRIDE android.control.settingsOverride} for the
1388      * CaptureRequest keys for each override.</p>
1389      * <p>OFF is always included in this list.</p>
1390      * <p><b>Range of valid values:</b><br>
1391      * Any value listed in {@link CaptureRequest#CONTROL_SETTINGS_OVERRIDE android.control.settingsOverride}</p>
1392      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1393      *
1394      * @see CaptureRequest#CONTROL_SETTINGS_OVERRIDE
1395      */
1396     @PublicKey
1397     @NonNull
1398     public static final Key<int[]> CONTROL_AVAILABLE_SETTINGS_OVERRIDES =
1399             new Key<int[]>("android.control.availableSettingsOverrides", int[].class);
1400 
1401     /**
1402      * <p>Whether the camera device supports {@link CaptureRequest#CONTROL_AUTOFRAMING android.control.autoframing}.</p>
1403      * <p>Will be <code>false</code> if auto-framing is not available.</p>
1404      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1405      * <p><b>Limited capability</b> -
1406      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1407      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1408      *
1409      * @see CaptureRequest#CONTROL_AUTOFRAMING
1410      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1411      */
1412     @PublicKey
1413     @NonNull
1414     public static final Key<Boolean> CONTROL_AUTOFRAMING_AVAILABLE =
1415             new Key<Boolean>("android.control.autoframingAvailable", boolean.class);
1416 
1417     /**
1418      * <p>The operating luminance range of low light boost measured in lux (lx).</p>
1419      * <p><b>Range of valid values:</b><br></p>
1420      * <p>The lower bound indicates the lowest scene luminance value the AE mode
1421      * 'ON_LOW_LIGHT_BOOST_BRIGHTNESS_PRIORITY' can operate within. Scenes of lower luminance
1422      * than this may receive less brightening, increased noise, or artifacts.</p>
1423      * <p>The upper bound indicates the luminance threshold at the point when the mode is enabled.
1424      * For example, 'Range[0.3, 30.0]' defines 0.3 lux being the lowest scene luminance the
1425      * mode can reliably support. 30.0 lux represents the threshold when this mode is
1426      * activated. Scenes measured at less than or equal to 30 lux will activate low light
1427      * boost.</p>
1428      * <p>If this key is defined, then the AE mode 'ON_LOW_LIGHT_BOOST_BRIGHTNESS_PRIORITY' will
1429      * also be present.</p>
1430      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1431      */
1432     @PublicKey
1433     @NonNull
1434     @FlaggedApi(Flags.FLAG_CAMERA_AE_MODE_LOW_LIGHT_BOOST)
1435     public static final Key<android.util.Range<Float>> CONTROL_LOW_LIGHT_BOOST_INFO_LUMINANCE_RANGE =
1436             new Key<android.util.Range<Float>>("android.control.lowLightBoostInfoLuminanceRange", new TypeReference<android.util.Range<Float>>() {{ }});
1437 
1438     /**
1439      * <p>List of auto-exposure priority modes for {@link CaptureRequest#CONTROL_AE_PRIORITY_MODE android.control.aePriorityMode}
1440      * that are supported by this camera device.</p>
1441      * <p>This entry lists the valid modes for
1442      * {@link CaptureRequest#CONTROL_AE_PRIORITY_MODE android.control.aePriorityMode} for this camera device.
1443      * If no AE priority modes are available for a device, this will only list OFF.</p>
1444      * <p><b>Range of valid values:</b><br>
1445      * Any value listed in {@link CaptureRequest#CONTROL_AE_PRIORITY_MODE android.control.aePriorityMode}</p>
1446      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1447      *
1448      * @see CaptureRequest#CONTROL_AE_PRIORITY_MODE
1449      */
1450     @PublicKey
1451     @NonNull
1452     @FlaggedApi(Flags.FLAG_AE_PRIORITY)
1453     public static final Key<int[]> CONTROL_AE_AVAILABLE_PRIORITY_MODES =
1454             new Key<int[]>("android.control.aeAvailablePriorityModes", int[].class);
1455 
1456     /**
1457      * <p>List of edge enhancement modes for {@link CaptureRequest#EDGE_MODE android.edge.mode} that are supported by this camera
1458      * device.</p>
1459      * <p>Full-capability camera devices must always support OFF; camera devices that support
1460      * YUV_REPROCESSING or PRIVATE_REPROCESSING will list ZERO_SHUTTER_LAG; all devices will
1461      * list FAST.</p>
1462      * <p><b>Range of valid values:</b><br>
1463      * Any value listed in {@link CaptureRequest#EDGE_MODE android.edge.mode}</p>
1464      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1465      * <p><b>Full capability</b> -
1466      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1467      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1468      *
1469      * @see CaptureRequest#EDGE_MODE
1470      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1471      */
1472     @PublicKey
1473     @NonNull
1474     public static final Key<int[]> EDGE_AVAILABLE_EDGE_MODES =
1475             new Key<int[]>("android.edge.availableEdgeModes", int[].class);
1476 
1477     /**
1478      * <p>Whether this camera device has a
1479      * flash unit.</p>
1480      * <p>Will be <code>false</code> if no flash is available.</p>
1481      * <p>If there is no flash unit, none of the flash controls do
1482      * anything.
1483      * This key is available on all devices.</p>
1484      */
1485     @PublicKey
1486     @NonNull
1487     public static final Key<Boolean> FLASH_INFO_AVAILABLE =
1488             new Key<Boolean>("android.flash.info.available", boolean.class);
1489 
1490     /**
1491      * <p>Maximum flashlight brightness level.</p>
1492      * <p>If this value is greater than 1, then the device supports controlling the
1493      * flashlight brightness level via
1494      * {@link android.hardware.camera2.CameraManager#turnOnTorchWithStrengthLevel }.
1495      * If this value is equal to 1, flashlight brightness control is not supported.
1496      * The value for this key will be null for devices with no flash unit.</p>
1497      * <p>The maximum value is guaranteed to be safe to use for an indefinite duration in
1498      * terms of device flashlight lifespan, but may be too bright for comfort for many
1499      * use cases. Use the default torch brightness value to avoid problems with an
1500      * over-bright flashlight.</p>
1501      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1502      */
1503     @PublicKey
1504     @NonNull
1505     public static final Key<Integer> FLASH_INFO_STRENGTH_MAXIMUM_LEVEL =
1506             new Key<Integer>("android.flash.info.strengthMaximumLevel", int.class);
1507 
1508     /**
1509      * <p>Default flashlight brightness level to be set via
1510      * {@link android.hardware.camera2.CameraManager#turnOnTorchWithStrengthLevel }.</p>
1511      * <p>If flash unit is available this will be greater than or equal to 1 and less
1512      * or equal to <code>{@link CameraCharacteristics#FLASH_INFO_STRENGTH_MAXIMUM_LEVEL android.flash.info.strengthMaximumLevel}</code>.</p>
1513      * <p>Setting flashlight brightness above the default level
1514      * (i.e.<code>{@link CameraCharacteristics#FLASH_INFO_STRENGTH_DEFAULT_LEVEL android.flash.info.strengthDefaultLevel}</code>) may make the device more
1515      * likely to reach thermal throttling conditions and slow down, or drain the
1516      * battery quicker than normal. To minimize such issues, it is recommended to
1517      * start the flashlight at this default brightness until a user explicitly requests
1518      * a brighter level.
1519      * Note that the value for this key will be null for devices with no flash unit.
1520      * The default level should always be &gt; 0.</p>
1521      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1522      *
1523      * @see CameraCharacteristics#FLASH_INFO_STRENGTH_DEFAULT_LEVEL
1524      * @see CameraCharacteristics#FLASH_INFO_STRENGTH_MAXIMUM_LEVEL
1525      */
1526     @PublicKey
1527     @NonNull
1528     public static final Key<Integer> FLASH_INFO_STRENGTH_DEFAULT_LEVEL =
1529             new Key<Integer>("android.flash.info.strengthDefaultLevel", int.class);
1530 
1531     /**
1532      * <p>Maximum flash brightness level for manual flash control in <code>SINGLE</code> mode.</p>
1533      * <p>Maximum flash brightness level in camera capture mode and
1534      * {@link CaptureRequest#FLASH_MODE android.flash.mode} set to <code>SINGLE</code>.
1535      * Value will be &gt; 1 if the manual flash strength control feature is supported,
1536      * otherwise the value will be equal to 1.
1537      * Note that this level is just a number of supported levels (the granularity of control).
1538      * There is no actual physical power units tied to this level.</p>
1539      * <p>This key is available on all devices.</p>
1540      *
1541      * @see CaptureRequest#FLASH_MODE
1542      */
1543     @PublicKey
1544     @NonNull
1545     public static final Key<Integer> FLASH_SINGLE_STRENGTH_MAX_LEVEL =
1546             new Key<Integer>("android.flash.singleStrengthMaxLevel", int.class);
1547 
1548     /**
1549      * <p>Default flash brightness level for manual flash control in <code>SINGLE</code> mode.</p>
1550      * <p>If flash unit is available this will be greater than or equal to 1 and less
1551      * or equal to {@link CameraCharacteristics#FLASH_SINGLE_STRENGTH_MAX_LEVEL android.flash.singleStrengthMaxLevel}.
1552      * Note for devices that do not support the manual flash strength control
1553      * feature, this level will always be equal to 1.</p>
1554      * <p>This key is available on all devices.</p>
1555      *
1556      * @see CameraCharacteristics#FLASH_SINGLE_STRENGTH_MAX_LEVEL
1557      */
1558     @PublicKey
1559     @NonNull
1560     public static final Key<Integer> FLASH_SINGLE_STRENGTH_DEFAULT_LEVEL =
1561             new Key<Integer>("android.flash.singleStrengthDefaultLevel", int.class);
1562 
1563     /**
1564      * <p>Maximum flash brightness level for manual flash control in <code>TORCH</code> mode</p>
1565      * <p>Maximum flash brightness level in camera capture mode and
1566      * {@link CaptureRequest#FLASH_MODE android.flash.mode} set to <code>TORCH</code>.
1567      * Value will be &gt; 1 if the manual flash strength control feature is supported,
1568      * otherwise the value will be equal to 1.</p>
1569      * <p>Note that this level is just a number of supported levels(the granularity of control).
1570      * There is no actual physical power units tied to this level.
1571      * There is no relation between {@link CameraCharacteristics#FLASH_TORCH_STRENGTH_MAX_LEVEL android.flash.torchStrengthMaxLevel} and
1572      * {@link CameraCharacteristics#FLASH_SINGLE_STRENGTH_MAX_LEVEL android.flash.singleStrengthMaxLevel} i.e. the ratio of
1573      * {@link CameraCharacteristics#FLASH_TORCH_STRENGTH_MAX_LEVEL android.flash.torchStrengthMaxLevel}:{@link CameraCharacteristics#FLASH_SINGLE_STRENGTH_MAX_LEVEL android.flash.singleStrengthMaxLevel}
1574      * is not guaranteed to be the ratio of actual brightness.</p>
1575      * <p>This key is available on all devices.</p>
1576      *
1577      * @see CaptureRequest#FLASH_MODE
1578      * @see CameraCharacteristics#FLASH_SINGLE_STRENGTH_MAX_LEVEL
1579      * @see CameraCharacteristics#FLASH_TORCH_STRENGTH_MAX_LEVEL
1580      */
1581     @PublicKey
1582     @NonNull
1583     public static final Key<Integer> FLASH_TORCH_STRENGTH_MAX_LEVEL =
1584             new Key<Integer>("android.flash.torchStrengthMaxLevel", int.class);
1585 
1586     /**
1587      * <p>Default flash brightness level for manual flash control in <code>TORCH</code> mode</p>
1588      * <p>If flash unit is available this will be greater than or equal to 1 and less
1589      * or equal to {@link CameraCharacteristics#FLASH_TORCH_STRENGTH_MAX_LEVEL android.flash.torchStrengthMaxLevel}.
1590      * Note for the devices that do not support the manual flash strength control feature,
1591      * this level will always be equal to 1.</p>
1592      * <p>This key is available on all devices.</p>
1593      *
1594      * @see CameraCharacteristics#FLASH_TORCH_STRENGTH_MAX_LEVEL
1595      */
1596     @PublicKey
1597     @NonNull
1598     public static final Key<Integer> FLASH_TORCH_STRENGTH_DEFAULT_LEVEL =
1599             new Key<Integer>("android.flash.torchStrengthDefaultLevel", int.class);
1600 
1601     /**
1602      * <p>List of hot pixel correction modes for {@link CaptureRequest#HOT_PIXEL_MODE android.hotPixel.mode} that are supported by this
1603      * camera device.</p>
1604      * <p>FULL mode camera devices will always support FAST.</p>
1605      * <p><b>Range of valid values:</b><br>
1606      * Any value listed in {@link CaptureRequest#HOT_PIXEL_MODE android.hotPixel.mode}</p>
1607      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1608      *
1609      * @see CaptureRequest#HOT_PIXEL_MODE
1610      */
1611     @PublicKey
1612     @NonNull
1613     public static final Key<int[]> HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES =
1614             new Key<int[]>("android.hotPixel.availableHotPixelModes", int[].class);
1615 
1616     /**
1617      * <p>List of JPEG thumbnail sizes for {@link CaptureRequest#JPEG_THUMBNAIL_SIZE android.jpeg.thumbnailSize} supported by this
1618      * camera device.</p>
1619      * <p>This list will include at least one non-zero resolution, plus <code>(0,0)</code> for indicating no
1620      * thumbnail should be generated.</p>
1621      * <p>Below conditions will be satisfied for this size list:</p>
1622      * <ul>
1623      * <li>The sizes will be sorted by increasing pixel area (width x height).
1624      * If several resolutions have the same area, they will be sorted by increasing width.</li>
1625      * <li>The aspect ratio of the largest thumbnail size will be same as the
1626      * aspect ratio of largest JPEG output size in android.scaler.availableStreamConfigurations.
1627      * The largest size is defined as the size that has the largest pixel area
1628      * in a given size list.</li>
1629      * <li>Each output JPEG size in android.scaler.availableStreamConfigurations will have at least
1630      * one corresponding size that has the same aspect ratio in availableThumbnailSizes,
1631      * and vice versa.</li>
1632      * <li>All non-<code>(0, 0)</code> sizes will have non-zero widths and heights.</li>
1633      * </ul>
1634      * <p>This list is also used as supported thumbnail sizes for HEIC image format capture.</p>
1635      * <p>This key is available on all devices.</p>
1636      *
1637      * @see CaptureRequest#JPEG_THUMBNAIL_SIZE
1638      */
1639     @PublicKey
1640     @NonNull
1641     public static final Key<android.util.Size[]> JPEG_AVAILABLE_THUMBNAIL_SIZES =
1642             new Key<android.util.Size[]>("android.jpeg.availableThumbnailSizes", android.util.Size[].class);
1643 
1644     /**
1645      * <p>List of aperture size values for {@link CaptureRequest#LENS_APERTURE android.lens.aperture} that are
1646      * supported by this camera device.</p>
1647      * <p>If the camera device doesn't support a variable lens aperture,
1648      * this list will contain only one value, which is the fixed aperture size.</p>
1649      * <p>If the camera device supports a variable aperture, the aperture values
1650      * in this list will be sorted in ascending order.</p>
1651      * <p><b>Units</b>: The aperture f-number</p>
1652      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1653      * <p><b>Full capability</b> -
1654      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1655      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1656      *
1657      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1658      * @see CaptureRequest#LENS_APERTURE
1659      */
1660     @PublicKey
1661     @NonNull
1662     public static final Key<float[]> LENS_INFO_AVAILABLE_APERTURES =
1663             new Key<float[]>("android.lens.info.availableApertures", float[].class);
1664 
1665     /**
1666      * <p>List of neutral density filter values for
1667      * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} that are supported by this camera device.</p>
1668      * <p>If a neutral density filter is not supported by this camera device,
1669      * this list will contain only 0. Otherwise, this list will include every
1670      * filter density supported by the camera device, in ascending order.</p>
1671      * <p><b>Units</b>: Exposure value (EV)</p>
1672      * <p><b>Range of valid values:</b><br></p>
1673      * <p>Values are &gt;= 0</p>
1674      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1675      * <p><b>Full capability</b> -
1676      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1677      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1678      *
1679      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1680      * @see CaptureRequest#LENS_FILTER_DENSITY
1681      */
1682     @PublicKey
1683     @NonNull
1684     public static final Key<float[]> LENS_INFO_AVAILABLE_FILTER_DENSITIES =
1685             new Key<float[]>("android.lens.info.availableFilterDensities", float[].class);
1686 
1687     /**
1688      * <p>List of focal lengths for {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength} that are supported by this camera
1689      * device.</p>
1690      * <p>If optical zoom is not supported, this list will only contain
1691      * a single value corresponding to the fixed focal length of the
1692      * device. Otherwise, this list will include every focal length supported
1693      * by the camera device, in ascending order.</p>
1694      * <p><b>Units</b>: Millimeters</p>
1695      * <p><b>Range of valid values:</b><br></p>
1696      * <p>Values are &gt; 0</p>
1697      * <p>This key is available on all devices.</p>
1698      *
1699      * @see CaptureRequest#LENS_FOCAL_LENGTH
1700      */
1701     @PublicKey
1702     @NonNull
1703     public static final Key<float[]> LENS_INFO_AVAILABLE_FOCAL_LENGTHS =
1704             new Key<float[]>("android.lens.info.availableFocalLengths", float[].class);
1705 
1706     /**
1707      * <p>List of optical image stabilization (OIS) modes for
1708      * {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode} that are supported by this camera device.</p>
1709      * <p>If OIS is not supported by a given camera device, this list will
1710      * contain only OFF.</p>
1711      * <p><b>Range of valid values:</b><br>
1712      * Any value listed in {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}</p>
1713      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1714      * <p><b>Limited capability</b> -
1715      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1716      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1717      *
1718      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1719      * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
1720      */
1721     @PublicKey
1722     @NonNull
1723     public static final Key<int[]> LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION =
1724             new Key<int[]>("android.lens.info.availableOpticalStabilization", int[].class);
1725 
1726     /**
1727      * <p>Hyperfocal distance for this lens.</p>
1728      * <p>If the lens is not fixed focus, the camera device will report this
1729      * field when {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} is APPROXIMATE or CALIBRATED.</p>
1730      * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
1731      * <p><b>Range of valid values:</b><br>
1732      * If lens is fixed focus, &gt;= 0. If lens has focuser unit, the value is
1733      * within <code>(0.0f, {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}]</code></p>
1734      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1735      * <p><b>Limited capability</b> -
1736      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1737      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1738      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
1739      *
1740      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1741      * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
1742      * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
1743      */
1744     @PublicKey
1745     @NonNull
1746     public static final Key<Float> LENS_INFO_HYPERFOCAL_DISTANCE =
1747             new Key<Float>("android.lens.info.hyperfocalDistance", float.class);
1748 
1749     /**
1750      * <p>Shortest distance from frontmost surface
1751      * of the lens that can be brought into sharp focus.</p>
1752      * <p>If the lens is fixed-focus, this will be
1753      * 0.</p>
1754      * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
1755      * <p><b>Range of valid values:</b><br>
1756      * &gt;= 0</p>
1757      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1758      * <p><b>Limited capability</b> -
1759      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1760      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1761      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
1762      *
1763      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1764      * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
1765      */
1766     @PublicKey
1767     @NonNull
1768     public static final Key<Float> LENS_INFO_MINIMUM_FOCUS_DISTANCE =
1769             new Key<Float>("android.lens.info.minimumFocusDistance", float.class);
1770 
1771     /**
1772      * <p>Dimensions of lens shading map.</p>
1773      * <p>The map should be on the order of 30-40 rows and columns, and
1774      * must be smaller than 64x64.</p>
1775      * <p><b>Range of valid values:</b><br>
1776      * Both values &gt;= 1</p>
1777      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1778      * <p><b>Full capability</b> -
1779      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1780      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1781      *
1782      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1783      * @hide
1784      */
1785     public static final Key<android.util.Size> LENS_INFO_SHADING_MAP_SIZE =
1786             new Key<android.util.Size>("android.lens.info.shadingMapSize", android.util.Size.class);
1787 
1788     /**
1789      * <p>The lens focus distance calibration quality.</p>
1790      * <p>The lens focus distance calibration quality determines the reliability of
1791      * focus related metadata entries, i.e. {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
1792      * {@link CaptureResult#LENS_FOCUS_RANGE android.lens.focusRange}, {@link CameraCharacteristics#LENS_INFO_HYPERFOCAL_DISTANCE android.lens.info.hyperfocalDistance}, and
1793      * {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}.</p>
1794      * <p>APPROXIMATE and CALIBRATED devices report the focus metadata in
1795      * units of diopters (1/meter), so <code>0.0f</code> represents focusing at infinity,
1796      * and increasing positive numbers represent focusing closer and closer
1797      * to the camera device. The focus distance control also uses diopters
1798      * on these devices.</p>
1799      * <p>UNCALIBRATED devices do not use units that are directly comparable
1800      * to any real physical measurement, but <code>0.0f</code> still represents farthest
1801      * focus, and {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} represents the
1802      * nearest focus the device can achieve.</p>
1803      * <p><b>Possible values:</b></p>
1804      * <ul>
1805      *   <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED UNCALIBRATED}</li>
1806      *   <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE APPROXIMATE}</li>
1807      *   <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED CALIBRATED}</li>
1808      * </ul>
1809      *
1810      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1811      * <p><b>Limited capability</b> -
1812      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1813      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1814      *
1815      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1816      * @see CaptureRequest#LENS_FOCUS_DISTANCE
1817      * @see CaptureResult#LENS_FOCUS_RANGE
1818      * @see CameraCharacteristics#LENS_INFO_HYPERFOCAL_DISTANCE
1819      * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
1820      * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED
1821      * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE
1822      * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED
1823      */
1824     @PublicKey
1825     @NonNull
1826     public static final Key<Integer> LENS_INFO_FOCUS_DISTANCE_CALIBRATION =
1827             new Key<Integer>("android.lens.info.focusDistanceCalibration", int.class);
1828 
1829     /**
1830      * <p>Direction the camera faces relative to
1831      * device screen.</p>
1832      * <p><b>Possible values:</b></p>
1833      * <ul>
1834      *   <li>{@link #LENS_FACING_FRONT FRONT}</li>
1835      *   <li>{@link #LENS_FACING_BACK BACK}</li>
1836      *   <li>{@link #LENS_FACING_EXTERNAL EXTERNAL}</li>
1837      * </ul>
1838      *
1839      * <p>This key is available on all devices.</p>
1840      * @see #LENS_FACING_FRONT
1841      * @see #LENS_FACING_BACK
1842      * @see #LENS_FACING_EXTERNAL
1843      */
1844     @PublicKey
1845     @NonNull
1846     public static final Key<Integer> LENS_FACING =
1847             new Key<Integer>("android.lens.facing", int.class);
1848 
1849     /**
1850      * <p>The orientation of the camera relative to the sensor
1851      * coordinate system.</p>
1852      * <p>The four coefficients that describe the quaternion
1853      * rotation from the Android sensor coordinate system to a
1854      * camera-aligned coordinate system where the X-axis is
1855      * aligned with the long side of the image sensor, the Y-axis
1856      * is aligned with the short side of the image sensor, and
1857      * the Z-axis is aligned with the optical axis of the sensor.</p>
1858      * <p>To convert from the quaternion coefficients <code>(x,y,z,w)</code>
1859      * to the axis of rotation <code>(a_x, a_y, a_z)</code> and rotation
1860      * amount <code>theta</code>, the following formulas can be used:</p>
1861      * <pre><code> theta = 2 * acos(w)
1862      * a_x = x / sin(theta/2)
1863      * a_y = y / sin(theta/2)
1864      * a_z = z / sin(theta/2)
1865      * </code></pre>
1866      * <p>To create a 3x3 rotation matrix that applies the rotation
1867      * defined by this quaternion, the following matrix can be
1868      * used:</p>
1869      * <pre><code>R = [ 1 - 2y^2 - 2z^2,       2xy - 2zw,       2xz + 2yw,
1870      *            2xy + 2zw, 1 - 2x^2 - 2z^2,       2yz - 2xw,
1871      *            2xz - 2yw,       2yz + 2xw, 1 - 2x^2 - 2y^2 ]
1872      * </code></pre>
1873      * <p>This matrix can then be used to apply the rotation to a
1874      *  column vector point with</p>
1875      * <p><code>p' = Rp</code></p>
1876      * <p>where <code>p</code> is in the device sensor coordinate system, and
1877      *  <code>p'</code> is in the camera-oriented coordinate system.</p>
1878      * <p>If {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is UNDEFINED, the quaternion rotation cannot
1879      *  be accurately represented by the camera device, and will be represented by
1880      *  default values matching its default facing.</p>
1881      * <p><b>Units</b>:
1882      * Quaternion coefficients</p>
1883      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1884      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
1885      *
1886      * @see CameraCharacteristics#LENS_POSE_REFERENCE
1887      */
1888     @PublicKey
1889     @NonNull
1890     public static final Key<float[]> LENS_POSE_ROTATION =
1891             new Key<float[]>("android.lens.poseRotation", float[].class);
1892 
1893     /**
1894      * <p>Position of the camera optical center.</p>
1895      * <p>The position of the camera device's lens optical center,
1896      * as a three-dimensional vector <code>(x,y,z)</code>.</p>
1897      * <p>Prior to Android P, or when {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is PRIMARY_CAMERA, this position
1898      * is relative to the optical center of the largest camera device facing in the same
1899      * direction as this camera, in the {@link android.hardware.SensorEvent Android sensor
1900      * coordinate axes}. Note that only the axis definitions are shared with the sensor
1901      * coordinate system, but not the origin.</p>
1902      * <p>If this device is the largest or only camera device with a given facing, then this
1903      * position will be <code>(0, 0, 0)</code>; a camera device with a lens optical center located 3 cm
1904      * from the main sensor along the +X axis (to the right from the user's perspective) will
1905      * report <code>(0.03, 0, 0)</code>.  Note that this means that, for many computer vision
1906      * applications, the position needs to be negated to convert it to a translation from the
1907      * camera to the origin.</p>
1908      * <p>To transform a pixel coordinates between two cameras facing the same direction, first
1909      * the source camera {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} must be corrected for.  Then the source
1910      * camera {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} needs to be applied, followed by the
1911      * {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the source camera, the translation of the source camera
1912      * relative to the destination camera, the {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the destination
1913      * camera, and finally the inverse of {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} of the destination
1914      * camera. This obtains a radial-distortion-free coordinate in the destination camera pixel
1915      * coordinates.</p>
1916      * <p>To compare this against a real image from the destination camera, the destination camera
1917      * image then needs to be corrected for radial distortion before comparison or sampling.</p>
1918      * <p>When {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is GYROSCOPE, then this position is relative to
1919      * the center of the primary gyroscope on the device. The axis definitions are the same as
1920      * with PRIMARY_CAMERA.</p>
1921      * <p>When {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is UNDEFINED, this position cannot be accurately
1922      * represented by the camera device, and will be represented as <code>(0, 0, 0)</code>.</p>
1923      * <p>When {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is AUTOMOTIVE, then this position is relative to the
1924      * origin of the automotive sensor coordinate system, which is at the center of the rear
1925      * axle.</p>
1926      * <p><b>Units</b>: Meters</p>
1927      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
1928      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
1929      *
1930      * @see CameraCharacteristics#LENS_DISTORTION
1931      * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
1932      * @see CameraCharacteristics#LENS_POSE_REFERENCE
1933      * @see CameraCharacteristics#LENS_POSE_ROTATION
1934      */
1935     @PublicKey
1936     @NonNull
1937     public static final Key<float[]> LENS_POSE_TRANSLATION =
1938             new Key<float[]>("android.lens.poseTranslation", float[].class);
1939 
1940     /**
1941      * <p>The parameters for this camera device's intrinsic
1942      * calibration.</p>
1943      * <p>The five calibration parameters that describe the
1944      * transform from camera-centric 3D coordinates to sensor
1945      * pixel coordinates:</p>
1946      * <pre><code>[f_x, f_y, c_x, c_y, s]
1947      * </code></pre>
1948      * <p>Where <code>f_x</code> and <code>f_y</code> are the horizontal and vertical
1949      * focal lengths, <code>[c_x, c_y]</code> is the position of the optical
1950      * axis, and <code>s</code> is a skew parameter for the sensor plane not
1951      * being aligned with the lens plane.</p>
1952      * <p>These are typically used within a transformation matrix K:</p>
1953      * <pre><code>K = [ f_x,   s, c_x,
1954      *        0, f_y, c_y,
1955      *        0    0,   1 ]
1956      * </code></pre>
1957      * <p>which can then be combined with the camera pose rotation
1958      * <code>R</code> and translation <code>t</code> ({@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} and
1959      * {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}, respectively) to calculate the
1960      * complete transform from world coordinates to pixel
1961      * coordinates:</p>
1962      * <pre><code>P = [ K 0   * [ R -Rt
1963      *      0 1 ]      0 1 ]
1964      * </code></pre>
1965      * <p>(Note the negation of poseTranslation when mapping from camera
1966      * to world coordinates, and multiplication by the rotation).</p>
1967      * <p>With <code>p_w</code> being a point in the world coordinate system
1968      * and <code>p_s</code> being a point in the camera active pixel array
1969      * coordinate system, and with the mapping including the
1970      * homogeneous division by z:</p>
1971      * <pre><code> p_h = (x_h, y_h, z_h) = P p_w
1972      * p_s = p_h / z_h
1973      * </code></pre>
1974      * <p>so <code>[x_s, y_s]</code> is the pixel coordinates of the world
1975      * point, <code>z_s = 1</code>, and <code>w_s</code> is a measurement of disparity
1976      * (depth) in pixel coordinates.</p>
1977      * <p>Note that the coordinate system for this transform is the
1978      * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} system,
1979      * where <code>(0,0)</code> is the top-left of the
1980      * preCorrectionActiveArraySize rectangle. Once the pose and
1981      * intrinsic calibration transforms have been applied to a
1982      * world point, then the {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion}
1983      * transform needs to be applied, and the result adjusted to
1984      * be in the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} coordinate
1985      * system (where <code>(0, 0)</code> is the top-left of the
1986      * activeArraySize rectangle), to determine the final pixel
1987      * coordinate of the world point for processed (non-RAW)
1988      * output buffers.</p>
1989      * <p>For camera devices, the center of pixel <code>(x,y)</code> is located at
1990      * coordinate <code>(x + 0.5, y + 0.5)</code>.  So on a device with a
1991      * precorrection active array of size <code>(10,10)</code>, the valid pixel
1992      * indices go from <code>(0,0)-(9,9)</code>, and an perfectly-built camera would
1993      * have an optical center at the exact center of the pixel grid, at
1994      * coordinates <code>(5.0, 5.0)</code>, which is the top-left corner of pixel
1995      * <code>(5,5)</code>.</p>
1996      * <p><b>Units</b>:
1997      * Pixels in the
1998      * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}
1999      * coordinate system.</p>
2000      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2001      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
2002      *
2003      * @see CameraCharacteristics#LENS_DISTORTION
2004      * @see CameraCharacteristics#LENS_POSE_ROTATION
2005      * @see CameraCharacteristics#LENS_POSE_TRANSLATION
2006      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2007      * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
2008      */
2009     @PublicKey
2010     @NonNull
2011     public static final Key<float[]> LENS_INTRINSIC_CALIBRATION =
2012             new Key<float[]>("android.lens.intrinsicCalibration", float[].class);
2013 
2014     /**
2015      * <p>The correction coefficients to correct for this camera device's
2016      * radial and tangential lens distortion.</p>
2017      * <p>Four radial distortion coefficients <code>[kappa_0, kappa_1, kappa_2,
2018      * kappa_3]</code> and two tangential distortion coefficients
2019      * <code>[kappa_4, kappa_5]</code> that can be used to correct the
2020      * lens's geometric distortion with the mapping equations:</p>
2021      * <pre><code> x_c = x_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
2022      *        kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
2023      *  y_c = y_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
2024      *        kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
2025      * </code></pre>
2026      * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
2027      * input image that correspond to the pixel values in the
2028      * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
2029      * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
2030      * </code></pre>
2031      * <p>The pixel coordinates are defined in a normalized
2032      * coordinate system related to the
2033      * {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} calibration fields.
2034      * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code> have <code>(0,0)</code> at the
2035      * lens optical center <code>[c_x, c_y]</code>. The maximum magnitudes
2036      * of both x and y coordinates are normalized to be 1 at the
2037      * edge further from the optical center, so the range
2038      * for both dimensions is <code>-1 &lt;= x &lt;= 1</code>.</p>
2039      * <p>Finally, <code>r</code> represents the radial distance from the
2040      * optical center, <code>r^2 = x_i^2 + y_i^2</code>, and its magnitude
2041      * is therefore no larger than <code>|r| &lt;= sqrt(2)</code>.</p>
2042      * <p>The distortion model used is the Brown-Conrady model.</p>
2043      * <p><b>Units</b>:
2044      * Unitless coefficients.</p>
2045      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2046      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
2047      *
2048      * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
2049      * @deprecated
2050      * <p>This field was inconsistently defined in terms of its
2051      * normalization. Use {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} instead.</p>
2052      *
2053      * @see CameraCharacteristics#LENS_DISTORTION
2054 
2055      */
2056     @Deprecated
2057     @PublicKey
2058     @NonNull
2059     public static final Key<float[]> LENS_RADIAL_DISTORTION =
2060             new Key<float[]>("android.lens.radialDistortion", float[].class);
2061 
2062     /**
2063      * <p>The origin for {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}, and the accuracy of
2064      * {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation} and {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation}.</p>
2065      * <p>Different calibration methods and use cases can produce better or worse results
2066      * depending on the selected coordinate origin.</p>
2067      * <p><b>Possible values:</b></p>
2068      * <ul>
2069      *   <li>{@link #LENS_POSE_REFERENCE_PRIMARY_CAMERA PRIMARY_CAMERA}</li>
2070      *   <li>{@link #LENS_POSE_REFERENCE_GYROSCOPE GYROSCOPE}</li>
2071      *   <li>{@link #LENS_POSE_REFERENCE_UNDEFINED UNDEFINED}</li>
2072      *   <li>{@link #LENS_POSE_REFERENCE_AUTOMOTIVE AUTOMOTIVE}</li>
2073      * </ul>
2074      *
2075      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2076      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
2077      *
2078      * @see CameraCharacteristics#LENS_POSE_ROTATION
2079      * @see CameraCharacteristics#LENS_POSE_TRANSLATION
2080      * @see #LENS_POSE_REFERENCE_PRIMARY_CAMERA
2081      * @see #LENS_POSE_REFERENCE_GYROSCOPE
2082      * @see #LENS_POSE_REFERENCE_UNDEFINED
2083      * @see #LENS_POSE_REFERENCE_AUTOMOTIVE
2084      */
2085     @PublicKey
2086     @NonNull
2087     public static final Key<Integer> LENS_POSE_REFERENCE =
2088             new Key<Integer>("android.lens.poseReference", int.class);
2089 
2090     /**
2091      * <p>The correction coefficients to correct for this camera device's
2092      * radial and tangential lens distortion.</p>
2093      * <p>Replaces the deprecated {@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion} field, which was
2094      * inconsistently defined.</p>
2095      * <p>Three radial distortion coefficients <code>[kappa_1, kappa_2,
2096      * kappa_3]</code> and two tangential distortion coefficients
2097      * <code>[kappa_4, kappa_5]</code> that can be used to correct the
2098      * lens's geometric distortion with the mapping equations:</p>
2099      * <pre><code> x_c = x_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
2100      *        kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
2101      *  y_c = y_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
2102      *        kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
2103      * </code></pre>
2104      * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
2105      * input image that correspond to the pixel values in the
2106      * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
2107      * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
2108      * </code></pre>
2109      * <p>The pixel coordinates are defined in a coordinate system
2110      * related to the {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration}
2111      * calibration fields; see that entry for details of the mapping stages.
2112      * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code>
2113      * have <code>(0,0)</code> at the lens optical center <code>[c_x, c_y]</code>, and
2114      * the range of the coordinates depends on the focal length
2115      * terms of the intrinsic calibration.</p>
2116      * <p>Finally, <code>r</code> represents the radial distance from the
2117      * optical center, <code>r^2 = x_i^2 + y_i^2</code>.</p>
2118      * <p>The distortion model used is the Brown-Conrady model.</p>
2119      * <p><b>Units</b>:
2120      * Unitless coefficients.</p>
2121      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2122      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
2123      *
2124      * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
2125      * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
2126      */
2127     @PublicKey
2128     @NonNull
2129     public static final Key<float[]> LENS_DISTORTION =
2130             new Key<float[]>("android.lens.distortion", float[].class);
2131 
2132     /**
2133      * <p>The correction coefficients to correct for this camera device's
2134      * radial and tangential lens distortion for a
2135      * CaptureRequest with {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} set to
2136      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
2137      * <p>Analogous to {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion}, when {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
2138      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
2139      * <p><b>Units</b>:
2140      * Unitless coefficients.</p>
2141      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2142      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
2143      *
2144      * @see CameraCharacteristics#LENS_DISTORTION
2145      * @see CaptureRequest#SENSOR_PIXEL_MODE
2146      */
2147     @PublicKey
2148     @NonNull
2149     public static final Key<float[]> LENS_DISTORTION_MAXIMUM_RESOLUTION =
2150             new Key<float[]>("android.lens.distortionMaximumResolution", float[].class);
2151 
2152     /**
2153      * <p>The parameters for this camera device's intrinsic
2154      * calibration when {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
2155      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
2156      * <p>Analogous to {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration}, when {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
2157      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
2158      * <p><b>Units</b>:
2159      * Pixels in the
2160      * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION android.sensor.info.preCorrectionActiveArraySizeMaximumResolution}
2161      * coordinate system.</p>
2162      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2163      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
2164      *
2165      * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
2166      * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION
2167      * @see CaptureRequest#SENSOR_PIXEL_MODE
2168      */
2169     @PublicKey
2170     @NonNull
2171     public static final Key<float[]> LENS_INTRINSIC_CALIBRATION_MAXIMUM_RESOLUTION =
2172             new Key<float[]>("android.lens.intrinsicCalibrationMaximumResolution", float[].class);
2173 
2174     /**
2175      * <p>List of noise reduction modes for {@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} that are supported
2176      * by this camera device.</p>
2177      * <p>Full-capability camera devices will always support OFF and FAST.</p>
2178      * <p>Camera devices that support YUV_REPROCESSING or PRIVATE_REPROCESSING will support
2179      * ZERO_SHUTTER_LAG.</p>
2180      * <p>Legacy-capability camera devices will only support FAST mode.</p>
2181      * <p><b>Range of valid values:</b><br>
2182      * Any value listed in {@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}</p>
2183      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2184      * <p><b>Limited capability</b> -
2185      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2186      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2187      *
2188      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2189      * @see CaptureRequest#NOISE_REDUCTION_MODE
2190      */
2191     @PublicKey
2192     @NonNull
2193     public static final Key<int[]> NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES =
2194             new Key<int[]>("android.noiseReduction.availableNoiseReductionModes", int[].class);
2195 
2196     /**
2197      * <p>If set to 1, the HAL will always split result
2198      * metadata for a single capture into multiple buffers,
2199      * returned using multiple process_capture_result calls.</p>
2200      * <p>Does not need to be listed in static
2201      * metadata. Support for partial results will be reworked in
2202      * future versions of camera service. This quirk will stop
2203      * working at that point; DO NOT USE without careful
2204      * consideration of future support.</p>
2205      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2206      * @deprecated
2207      * <p>Not used in HALv3 or newer; replaced by better partials mechanism</p>
2208 
2209      * @hide
2210      */
2211     @Deprecated
2212     public static final Key<Byte> QUIRKS_USE_PARTIAL_RESULT =
2213             new Key<Byte>("android.quirks.usePartialResult", byte.class);
2214 
2215     /**
2216      * <p>The maximum numbers of different types of output streams
2217      * that can be configured and used simultaneously by a camera device.</p>
2218      * <p>This is a 3 element tuple that contains the max number of output simultaneous
2219      * streams for raw sensor, processed (but not stalling), and processed (and stalling)
2220      * formats respectively. For example, assuming that JPEG is typically a processed and
2221      * stalling stream, if max raw sensor format output stream number is 1, max YUV streams
2222      * number is 3, and max JPEG stream number is 2, then this tuple should be <code>(1, 3, 2)</code>.</p>
2223      * <p>This lists the upper bound of the number of output streams supported by
2224      * the camera device. Using more streams simultaneously may require more hardware and
2225      * CPU resources that will consume more power. The image format for an output stream can
2226      * be any supported format provided by android.scaler.availableStreamConfigurations.
2227      * The formats defined in android.scaler.availableStreamConfigurations can be categorized
2228      * into the 3 stream types as below:</p>
2229      * <ul>
2230      * <li>Processed (but stalling): any non-RAW format with a stallDurations &gt; 0.
2231      *   Typically {@link android.graphics.ImageFormat#JPEG JPEG format}.</li>
2232      * <li>Raw formats: {@link android.graphics.ImageFormat#RAW_SENSOR RAW_SENSOR}, {@link android.graphics.ImageFormat#RAW10 RAW10}, or
2233      *   {@link android.graphics.ImageFormat#RAW12 RAW12}.</li>
2234      * <li>Processed (but not-stalling): any non-RAW format without a stall duration.  Typically
2235      *   {@link android.graphics.ImageFormat#YUV_420_888 YUV_420_888},
2236      *   {@link android.graphics.ImageFormat#NV21 NV21}, {@link android.graphics.ImageFormat#YV12 YV12}, or {@link android.graphics.ImageFormat#Y8 Y8} .</li>
2237      * </ul>
2238      * <p><b>Range of valid values:</b><br></p>
2239      * <p>For processed (and stalling) format streams, &gt;= 1.</p>
2240      * <p>For Raw format (either stalling or non-stalling) streams, &gt;= 0.</p>
2241      * <p>For processed (but not stalling) format streams, &gt;= 3
2242      * for FULL mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL</code>);
2243      * &gt;= 2 for LIMITED mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == LIMITED</code>).</p>
2244      * <p>This key is available on all devices.</p>
2245      *
2246      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2247      * @hide
2248      */
2249     public static final Key<int[]> REQUEST_MAX_NUM_OUTPUT_STREAMS =
2250             new Key<int[]>("android.request.maxNumOutputStreams", int[].class);
2251 
2252     /**
2253      * <p>The maximum numbers of different types of output streams
2254      * that can be configured and used simultaneously by a camera device
2255      * for any <code>RAW</code> formats.</p>
2256      * <p>This value contains the max number of output simultaneous
2257      * streams from the raw sensor.</p>
2258      * <p>This lists the upper bound of the number of output streams supported by
2259      * the camera device. Using more streams simultaneously may require more hardware and
2260      * CPU resources that will consume more power. The image format for this kind of an output stream can
2261      * be any <code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
2262      * <p>In particular, a <code>RAW</code> format is typically one of:</p>
2263      * <ul>
2264      * <li>{@link android.graphics.ImageFormat#RAW_SENSOR RAW_SENSOR}</li>
2265      * <li>{@link android.graphics.ImageFormat#RAW10 RAW10}</li>
2266      * <li>{@link android.graphics.ImageFormat#RAW12 RAW12}</li>
2267      * </ul>
2268      * <p>LEGACY mode devices ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} <code>==</code> LEGACY)
2269      * never support raw streams.</p>
2270      * <p><b>Range of valid values:</b><br></p>
2271      * <p>&gt;= 0</p>
2272      * <p>This key is available on all devices.</p>
2273      *
2274      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2275      * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
2276      */
2277     @PublicKey
2278     @NonNull
2279     @SyntheticKey
2280     public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_RAW =
2281             new Key<Integer>("android.request.maxNumOutputRaw", int.class);
2282 
2283     /**
2284      * <p>The maximum numbers of different types of output streams
2285      * that can be configured and used simultaneously by a camera device
2286      * for any processed (but not-stalling) formats.</p>
2287      * <p>This value contains the max number of output simultaneous
2288      * streams for any processed (but not-stalling) formats.</p>
2289      * <p>This lists the upper bound of the number of output streams supported by
2290      * the camera device. Using more streams simultaneously may require more hardware and
2291      * CPU resources that will consume more power. The image format for this kind of an output stream can
2292      * be any non-<code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
2293      * <p>Processed (but not-stalling) is defined as any non-RAW format without a stall duration.
2294      * Typically:</p>
2295      * <ul>
2296      * <li>{@link android.graphics.ImageFormat#YUV_420_888 YUV_420_888}</li>
2297      * <li>{@link android.graphics.ImageFormat#NV21 NV21}</li>
2298      * <li>{@link android.graphics.ImageFormat#YV12 YV12}</li>
2299      * <li>Implementation-defined formats, i.e. {@link android.hardware.camera2.params.StreamConfigurationMap#isOutputSupportedFor(Class) }</li>
2300      * <li>{@link android.graphics.ImageFormat#Y8 Y8}</li>
2301      * </ul>
2302      * <p>For full guarantees, query {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } with a
2303      * processed format -- it will return 0 for a non-stalling stream.</p>
2304      * <p>LEGACY devices will support at least 2 processing/non-stalling streams.</p>
2305      * <p><b>Range of valid values:</b><br></p>
2306      * <p>&gt;= 3
2307      * for FULL mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL</code>);
2308      * &gt;= 2 for LIMITED mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == LIMITED</code>).</p>
2309      * <p>This key is available on all devices.</p>
2310      *
2311      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2312      * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
2313      */
2314     @PublicKey
2315     @NonNull
2316     @SyntheticKey
2317     public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_PROC =
2318             new Key<Integer>("android.request.maxNumOutputProc", int.class);
2319 
2320     /**
2321      * <p>The maximum numbers of different types of output streams
2322      * that can be configured and used simultaneously by a camera device
2323      * for any processed (and stalling) formats.</p>
2324      * <p>This value contains the max number of output simultaneous
2325      * streams for any processed (but not-stalling) formats.</p>
2326      * <p>This lists the upper bound of the number of output streams supported by
2327      * the camera device. Using more streams simultaneously may require more hardware and
2328      * CPU resources that will consume more power. The image format for this kind of an output stream can
2329      * be any non-<code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
2330      * <p>A processed and stalling format is defined as any non-RAW format with a stallDurations
2331      * &gt; 0.  Typically only the {@link android.graphics.ImageFormat#JPEG JPEG format} is a stalling format.</p>
2332      * <p>For full guarantees, query {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } with a
2333      * processed format -- it will return a non-0 value for a stalling stream.</p>
2334      * <p>LEGACY devices will support up to 1 processing/stalling stream.</p>
2335      * <p><b>Range of valid values:</b><br></p>
2336      * <p>&gt;= 1</p>
2337      * <p>This key is available on all devices.</p>
2338      *
2339      * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
2340      */
2341     @PublicKey
2342     @NonNull
2343     @SyntheticKey
2344     public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_PROC_STALLING =
2345             new Key<Integer>("android.request.maxNumOutputProcStalling", int.class);
2346 
2347     /**
2348      * <p>The maximum numbers of any type of input streams
2349      * that can be configured and used simultaneously by a camera device.</p>
2350      * <p>When set to 0, it means no input stream is supported.</p>
2351      * <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
2352      * input stream, there must be at least one output stream configured to to receive the
2353      * reprocessed images.</p>
2354      * <p>When an input stream and some output streams are used in a reprocessing request,
2355      * only the input buffer will be used to produce these output stream buffers, and a
2356      * new sensor image will not be captured.</p>
2357      * <p>For example, for Zero Shutter Lag (ZSL) still capture use case, the input
2358      * stream image format will be PRIVATE, the associated output stream image format
2359      * should be JPEG.</p>
2360      * <p><b>Range of valid values:</b><br></p>
2361      * <p>0 or 1.</p>
2362      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2363      * <p><b>Full capability</b> -
2364      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2365      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2366      *
2367      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2368      */
2369     @PublicKey
2370     @NonNull
2371     public static final Key<Integer> REQUEST_MAX_NUM_INPUT_STREAMS =
2372             new Key<Integer>("android.request.maxNumInputStreams", int.class);
2373 
2374     /**
2375      * <p>Specifies the number of maximum pipeline stages a frame
2376      * has to go through from when it's exposed to when it's available
2377      * to the framework.</p>
2378      * <p>A typical minimum value for this is 2 (one stage to expose,
2379      * one stage to readout) from the sensor. The ISP then usually adds
2380      * its own stages to do custom HW processing. Further stages may be
2381      * added by SW processing.</p>
2382      * <p>Depending on what settings are used (e.g. YUV, JPEG) and what
2383      * processing is enabled (e.g. face detection), the actual pipeline
2384      * depth (specified by {@link CaptureResult#REQUEST_PIPELINE_DEPTH android.request.pipelineDepth}) may be less than
2385      * the max pipeline depth.</p>
2386      * <p>A pipeline depth of X stages is equivalent to a pipeline latency of
2387      * X frame intervals.</p>
2388      * <p>This value will normally be 8 or less, however, for high speed capture session,
2389      * the max pipeline depth will be up to 8 x size of high speed capture request list.</p>
2390      * <p>This key is available on all devices.</p>
2391      *
2392      * @see CaptureResult#REQUEST_PIPELINE_DEPTH
2393      */
2394     @PublicKey
2395     @NonNull
2396     public static final Key<Byte> REQUEST_PIPELINE_MAX_DEPTH =
2397             new Key<Byte>("android.request.pipelineMaxDepth", byte.class);
2398 
2399     /**
2400      * <p>Defines how many sub-components
2401      * a result will be composed of.</p>
2402      * <p>In order to combat the pipeline latency, partial results
2403      * may be delivered to the application layer from the camera device as
2404      * soon as they are available.</p>
2405      * <p>Optional; defaults to 1. A value of 1 means that partial
2406      * results are not supported, and only the final TotalCaptureResult will
2407      * be produced by the camera device.</p>
2408      * <p>A typical use case for this might be: after requesting an
2409      * auto-focus (AF) lock the new AF state might be available 50%
2410      * of the way through the pipeline.  The camera device could
2411      * then immediately dispatch this state via a partial result to
2412      * the application, and the rest of the metadata via later
2413      * partial results.</p>
2414      * <p><b>Range of valid values:</b><br>
2415      * &gt;= 1</p>
2416      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2417      */
2418     @PublicKey
2419     @NonNull
2420     public static final Key<Integer> REQUEST_PARTIAL_RESULT_COUNT =
2421             new Key<Integer>("android.request.partialResultCount", int.class);
2422 
2423     /**
2424      * <p>List of capabilities that this camera device
2425      * advertises as fully supporting.</p>
2426      * <p>A capability is a contract that the camera device makes in order
2427      * to be able to satisfy one or more use cases.</p>
2428      * <p>Listing a capability guarantees that the whole set of features
2429      * required to support a common use will all be available.</p>
2430      * <p>Using a subset of the functionality provided by an unsupported
2431      * capability may be possible on a specific camera device implementation;
2432      * to do this query each of android.request.availableRequestKeys,
2433      * android.request.availableResultKeys,
2434      * android.request.availableCharacteristicsKeys.</p>
2435      * <p>The following capabilities are guaranteed to be available on
2436      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} <code>==</code> FULL devices:</p>
2437      * <ul>
2438      * <li>MANUAL_SENSOR</li>
2439      * <li>MANUAL_POST_PROCESSING</li>
2440      * </ul>
2441      * <p>Other capabilities may be available on either FULL or LIMITED
2442      * devices, but the application should query this key to be sure.</p>
2443      * <p><b>Possible values:</b></p>
2444      * <ul>
2445      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE BACKWARD_COMPATIBLE}</li>
2446      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR MANUAL_SENSOR}</li>
2447      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING MANUAL_POST_PROCESSING}</li>
2448      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_RAW RAW}</li>
2449      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING PRIVATE_REPROCESSING}</li>
2450      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS READ_SENSOR_SETTINGS}</li>
2451      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE BURST_CAPTURE}</li>
2452      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING YUV_REPROCESSING}</li>
2453      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT DEPTH_OUTPUT}</li>
2454      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO CONSTRAINED_HIGH_SPEED_VIDEO}</li>
2455      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING MOTION_TRACKING}</li>
2456      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA LOGICAL_MULTI_CAMERA}</li>
2457      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME MONOCHROME}</li>
2458      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_SECURE_IMAGE_DATA SECURE_IMAGE_DATA}</li>
2459      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_SYSTEM_CAMERA SYSTEM_CAMERA}</li>
2460      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_OFFLINE_PROCESSING OFFLINE_PROCESSING}</li>
2461      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR ULTRA_HIGH_RESOLUTION_SENSOR}</li>
2462      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_REMOSAIC_REPROCESSING REMOSAIC_REPROCESSING}</li>
2463      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT DYNAMIC_RANGE_TEN_BIT}</li>
2464      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE STREAM_USE_CASE}</li>
2465      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_COLOR_SPACE_PROFILES COLOR_SPACE_PROFILES}</li>
2466      * </ul>
2467      *
2468      * <p>This key is available on all devices.</p>
2469      *
2470      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2471      * @see #REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE
2472      * @see #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR
2473      * @see #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING
2474      * @see #REQUEST_AVAILABLE_CAPABILITIES_RAW
2475      * @see #REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING
2476      * @see #REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS
2477      * @see #REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE
2478      * @see #REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING
2479      * @see #REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT
2480      * @see #REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO
2481      * @see #REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING
2482      * @see #REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA
2483      * @see #REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME
2484      * @see #REQUEST_AVAILABLE_CAPABILITIES_SECURE_IMAGE_DATA
2485      * @see #REQUEST_AVAILABLE_CAPABILITIES_SYSTEM_CAMERA
2486      * @see #REQUEST_AVAILABLE_CAPABILITIES_OFFLINE_PROCESSING
2487      * @see #REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR
2488      * @see #REQUEST_AVAILABLE_CAPABILITIES_REMOSAIC_REPROCESSING
2489      * @see #REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT
2490      * @see #REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE
2491      * @see #REQUEST_AVAILABLE_CAPABILITIES_COLOR_SPACE_PROFILES
2492      */
2493     @PublicKey
2494     @NonNull
2495     public static final Key<int[]> REQUEST_AVAILABLE_CAPABILITIES =
2496             new Key<int[]>("android.request.availableCapabilities", int[].class);
2497 
2498     /**
2499      * <p>A list of all keys that the camera device has available
2500      * to use with {@link android.hardware.camera2.CaptureRequest }.</p>
2501      * <p>Attempting to set a key into a CaptureRequest that is not
2502      * listed here will result in an invalid request and will be rejected
2503      * by the camera device.</p>
2504      * <p>This field can be used to query the feature set of a camera device
2505      * at a more granular level than capabilities. This is especially
2506      * important for optional keys that are not listed under any capability
2507      * in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.</p>
2508      * <p>This key is available on all devices.</p>
2509      *
2510      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
2511      * @hide
2512      */
2513     public static final Key<int[]> REQUEST_AVAILABLE_REQUEST_KEYS =
2514             new Key<int[]>("android.request.availableRequestKeys", int[].class);
2515 
2516     /**
2517      * <p>A list of all keys that the camera device has available to use with {@link android.hardware.camera2.CaptureResult }.</p>
2518      * <p>Attempting to get a key from a CaptureResult that is not
2519      * listed here will always return a <code>null</code> value. Getting a key from
2520      * a CaptureResult that is listed here will generally never return a <code>null</code>
2521      * value.</p>
2522      * <p>The following keys may return <code>null</code> unless they are enabled:</p>
2523      * <ul>
2524      * <li>android.statistics.lensShadingMap (non-null iff {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON)</li>
2525      * </ul>
2526      * <p>(Those sometimes-null keys will nevertheless be listed here
2527      * if they are available.)</p>
2528      * <p>This field can be used to query the feature set of a camera device
2529      * at a more granular level than capabilities. This is especially
2530      * important for optional keys that are not listed under any capability
2531      * in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.</p>
2532      * <p>This key is available on all devices.</p>
2533      *
2534      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
2535      * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
2536      * @hide
2537      */
2538     public static final Key<int[]> REQUEST_AVAILABLE_RESULT_KEYS =
2539             new Key<int[]>("android.request.availableResultKeys", int[].class);
2540 
2541     /**
2542      * <p>A list of all keys that the camera device has available to use with {@link android.hardware.camera2.CameraCharacteristics }.</p>
2543      * <p>This entry follows the same rules as
2544      * android.request.availableResultKeys (except that it applies for
2545      * CameraCharacteristics instead of CaptureResult). See above for more
2546      * details.</p>
2547      * <p>This key is available on all devices.</p>
2548      * @hide
2549      */
2550     public static final Key<int[]> REQUEST_AVAILABLE_CHARACTERISTICS_KEYS =
2551             new Key<int[]>("android.request.availableCharacteristicsKeys", int[].class);
2552 
2553     /**
2554      * <p>A subset of the available request keys that the camera device
2555      * can pass as part of the capture session initialization.</p>
2556      * <p>This is a subset of android.request.availableRequestKeys which
2557      * contains a list of keys that are difficult to apply per-frame and
2558      * can result in unexpected delays when modified during the capture session
2559      * lifetime. Typical examples include parameters that require a
2560      * time-consuming hardware re-configuration or internal camera pipeline
2561      * change. For performance reasons we advise clients to pass their initial
2562      * values as part of
2563      * {@link SessionConfiguration#setSessionParameters }.
2564      * Once the camera capture session is enabled it is also recommended to avoid
2565      * changing them from their initial values set in
2566      * {@link SessionConfiguration#setSessionParameters }.
2567      * Control over session parameters can still be exerted in capture requests
2568      * but clients should be aware and expect delays during their application.
2569      * An example usage scenario could look like this:</p>
2570      * <ul>
2571      * <li>The camera client starts by querying the session parameter key list via
2572      *   {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys }.</li>
2573      * <li>Before triggering the capture session create sequence, a capture request
2574      *   must be built via
2575      *   {@link CameraDevice#createCaptureRequest }
2576      *   using an appropriate template matching the particular use case.</li>
2577      * <li>The client should go over the list of session parameters and check
2578      *   whether some of the keys listed matches with the parameters that
2579      *   they intend to modify as part of the first capture request.</li>
2580      * <li>If there is no such match, the capture request can be  passed
2581      *   unmodified to
2582      *   {@link SessionConfiguration#setSessionParameters }.</li>
2583      * <li>If matches do exist, the client should update the respective values
2584      *   and pass the request to
2585      *   {@link SessionConfiguration#setSessionParameters }.</li>
2586      * <li>After the capture session initialization completes the session parameter
2587      *   key list can continue to serve as reference when posting or updating
2588      *   further requests. As mentioned above further changes to session
2589      *   parameters should ideally be avoided, if updates are necessary
2590      *   however clients could expect a delay/glitch during the
2591      *   parameter switch.</li>
2592      * </ul>
2593      * <p>This key is available on all devices.</p>
2594      * @hide
2595      */
2596     public static final Key<int[]> REQUEST_AVAILABLE_SESSION_KEYS =
2597             new Key<int[]>("android.request.availableSessionKeys", int[].class);
2598 
2599     /**
2600      * <p>A subset of the available request keys that can be overridden for
2601      * physical devices backing a logical multi-camera.</p>
2602      * <p>This is a subset of android.request.availableRequestKeys which contains a list
2603      * of keys that can be overridden using
2604      * {@link android.hardware.camera2.CaptureRequest.Builder#setPhysicalCameraKey }.
2605      * The respective value of such request key can be obtained by calling
2606      * {@link android.hardware.camera2.CaptureRequest.Builder#getPhysicalCameraKey }.
2607      * Capture requests that contain individual physical device requests must be built via
2608      * {@link android.hardware.camera2.CameraDevice#createCaptureRequest(int, Set)}.</p>
2609      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2610      * <p><b>Limited capability</b> -
2611      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2612      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2613      *
2614      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2615      * @hide
2616      */
2617     public static final Key<int[]> REQUEST_AVAILABLE_PHYSICAL_CAMERA_REQUEST_KEYS =
2618             new Key<int[]>("android.request.availablePhysicalCameraRequestKeys", int[].class);
2619 
2620     /**
2621      * <p>A list of camera characteristics keys that are only available
2622      * in case the camera client has camera permission.</p>
2623      * <p>The entry contains a subset of
2624      * {@link android.hardware.camera2.CameraCharacteristics#getKeys } that require camera clients
2625      * to acquire the {@link android.Manifest.permission#CAMERA } permission before calling
2626      * {@link android.hardware.camera2.CameraManager#getCameraCharacteristics }. If the
2627      * permission is not held by the camera client, then the values of the respective properties
2628      * will not be present in {@link android.hardware.camera2.CameraCharacteristics }.</p>
2629      * <p>This key is available on all devices.</p>
2630      * @hide
2631      */
2632     public static final Key<int[]> REQUEST_CHARACTERISTIC_KEYS_NEEDING_PERMISSION =
2633             new Key<int[]>("android.request.characteristicKeysNeedingPermission", int[].class);
2634 
2635     /**
2636      * <p>Devices supporting the 10-bit output capability
2637      * {@link android.hardware.camera2.CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT }
2638      * must list their supported dynamic range profiles along with capture request
2639      * constraints for specific profile combinations.</p>
2640      * <p>Camera clients can retrieve the list of supported 10-bit dynamic range profiles by calling
2641      * {@link android.hardware.camera2.params.DynamicRangeProfiles#getSupportedProfiles }.
2642      * Any of them can be configured by setting OutputConfiguration dynamic range profile in
2643      * {@link android.hardware.camera2.params.OutputConfiguration#setDynamicRangeProfile }.
2644      * Clients can also check if there are any constraints that limit the combination
2645      * of supported profiles that can be referenced within a single capture request by calling
2646      * {@link android.hardware.camera2.params.DynamicRangeProfiles#getProfileCaptureRequestConstraints }.</p>
2647      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2648      */
2649     @PublicKey
2650     @NonNull
2651     @SyntheticKey
2652     public static final Key<android.hardware.camera2.params.DynamicRangeProfiles> REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES =
2653             new Key<android.hardware.camera2.params.DynamicRangeProfiles>("android.request.availableDynamicRangeProfiles", android.hardware.camera2.params.DynamicRangeProfiles.class);
2654 
2655     /**
2656      * <p>A map of all available 10-bit dynamic range profiles along with their
2657      * capture request constraints.</p>
2658      * <p>Devices supporting the 10-bit output capability
2659      * {@link android.hardware.camera2.CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT }
2660      * must list their supported dynamic range profiles. In case the camera is not able to
2661      * support every possible profile combination within a single capture request, then the
2662      * constraints must be listed here as well.</p>
2663      * <p><b>Possible values:</b></p>
2664      * <ul>
2665      *   <li>{@link #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD STANDARD}</li>
2666      *   <li>{@link #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10 HLG10}</li>
2667      *   <li>{@link #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10 HDR10}</li>
2668      *   <li>{@link #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10_PLUS HDR10_PLUS}</li>
2669      *   <li>{@link #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF DOLBY_VISION_10B_HDR_REF}</li>
2670      *   <li>{@link #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF_PO DOLBY_VISION_10B_HDR_REF_PO}</li>
2671      *   <li>{@link #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM DOLBY_VISION_10B_HDR_OEM}</li>
2672      *   <li>{@link #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM_PO DOLBY_VISION_10B_HDR_OEM_PO}</li>
2673      *   <li>{@link #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF DOLBY_VISION_8B_HDR_REF}</li>
2674      *   <li>{@link #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF_PO DOLBY_VISION_8B_HDR_REF_PO}</li>
2675      *   <li>{@link #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM DOLBY_VISION_8B_HDR_OEM}</li>
2676      *   <li>{@link #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM_PO DOLBY_VISION_8B_HDR_OEM_PO}</li>
2677      *   <li>{@link #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_MAX MAX}</li>
2678      * </ul>
2679      *
2680      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2681      * @see #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD
2682      * @see #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10
2683      * @see #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10
2684      * @see #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10_PLUS
2685      * @see #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF
2686      * @see #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF_PO
2687      * @see #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM
2688      * @see #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM_PO
2689      * @see #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF
2690      * @see #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF_PO
2691      * @see #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM
2692      * @see #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM_PO
2693      * @see #REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_MAX
2694      * @hide
2695      */
2696     public static final Key<long[]> REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP =
2697             new Key<long[]>("android.request.availableDynamicRangeProfilesMap", long[].class);
2698 
2699     /**
2700      * <p>Recommended 10-bit dynamic range profile.</p>
2701      * <p>Devices supporting the 10-bit output capability
2702      * {@link android.hardware.camera2.CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT }
2703      * must list a 10-bit supported dynamic range profile that is expected to perform
2704      * optimally in terms of image quality, power and performance.
2705      * The value advertised can be used as a hint by camera clients when configuring the dynamic
2706      * range profile when calling
2707      * {@link android.hardware.camera2.params.OutputConfiguration#setDynamicRangeProfile }.</p>
2708      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2709      */
2710     @PublicKey
2711     @NonNull
2712     public static final Key<Long> REQUEST_RECOMMENDED_TEN_BIT_DYNAMIC_RANGE_PROFILE =
2713             new Key<Long>("android.request.recommendedTenBitDynamicRangeProfile", long.class);
2714 
2715     /**
2716      * <p>An interface for querying the color space profiles supported by a camera device.</p>
2717      * <p>A color space profile is a combination of a color space, an image format, and a dynamic
2718      * range profile. Camera clients can retrieve the list of supported color spaces by calling
2719      * {@link android.hardware.camera2.params.ColorSpaceProfiles#getSupportedColorSpaces } or
2720      * {@link android.hardware.camera2.params.ColorSpaceProfiles#getSupportedColorSpacesForDynamicRange }.
2721      * If a camera does not support the
2722      * {@link android.hardware.camera2.CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT }
2723      * capability, the dynamic range profile will always be
2724      * {@link android.hardware.camera2.params.DynamicRangeProfiles#STANDARD }. Color space
2725      * capabilities are queried in combination with an {@link android.graphics.ImageFormat }.
2726      * If a camera client wants to know the general color space capabilities of a camera device
2727      * regardless of image format, it can specify {@link android.graphics.ImageFormat#UNKNOWN }.
2728      * The color space for a session can be configured by setting the SessionConfiguration
2729      * color space via {@link android.hardware.camera2.params.SessionConfiguration#setColorSpace }.</p>
2730      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2731      */
2732     @PublicKey
2733     @NonNull
2734     @SyntheticKey
2735     public static final Key<android.hardware.camera2.params.ColorSpaceProfiles> REQUEST_AVAILABLE_COLOR_SPACE_PROFILES =
2736             new Key<android.hardware.camera2.params.ColorSpaceProfiles>("android.request.availableColorSpaceProfiles", android.hardware.camera2.params.ColorSpaceProfiles.class);
2737 
2738     /**
2739      * <p>A list of all possible color space profiles supported by a camera device.</p>
2740      * <p>A color space profile is a combination of a color space, an image format, and a dynamic range
2741      * profile. If a camera does not support the
2742      * {@link android.hardware.camera2.CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT }
2743      * capability, the dynamic range profile will always be
2744      * {@link android.hardware.camera2.params.DynamicRangeProfiles#STANDARD }. Camera clients can
2745      * use {@link android.hardware.camera2.params.SessionConfiguration#setColorSpace } to select
2746      * a color space.</p>
2747      * <p><b>Possible values:</b></p>
2748      * <ul>
2749      *   <li>{@link #REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP_UNSPECIFIED UNSPECIFIED}</li>
2750      *   <li>{@link #REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP_SRGB SRGB}</li>
2751      *   <li>{@link #REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP_DISPLAY_P3 DISPLAY_P3}</li>
2752      *   <li>{@link #REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP_BT2020_HLG BT2020_HLG}</li>
2753      * </ul>
2754      *
2755      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2756      * @see #REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP_UNSPECIFIED
2757      * @see #REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP_SRGB
2758      * @see #REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP_DISPLAY_P3
2759      * @see #REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP_BT2020_HLG
2760      * @hide
2761      */
2762     public static final Key<long[]> REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP =
2763             new Key<long[]>("android.request.availableColorSpaceProfilesMap", long[].class);
2764 
2765     /**
2766      * <p>The list of image formats that are supported by this
2767      * camera device for output streams.</p>
2768      * <p>All camera devices will support JPEG and YUV_420_888 formats.</p>
2769      * <p>When set to YUV_420_888, application can access the YUV420 data directly.</p>
2770      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2771      * @deprecated
2772      * <p>Not used in HALv3 or newer</p>
2773 
2774      * @hide
2775      */
2776     @Deprecated
2777     public static final Key<int[]> SCALER_AVAILABLE_FORMATS =
2778             new Key<int[]>("android.scaler.availableFormats", int[].class);
2779 
2780     /**
2781      * <p>The minimum frame duration that is supported
2782      * for each resolution in android.scaler.availableJpegSizes.</p>
2783      * <p>This corresponds to the minimum steady-state frame duration when only
2784      * that JPEG stream is active and captured in a burst, with all
2785      * processing (typically in android.*.mode) set to FAST.</p>
2786      * <p>When multiple streams are configured, the minimum
2787      * frame duration will be &gt;= max(individual stream min
2788      * durations)</p>
2789      * <p><b>Units</b>: Nanoseconds</p>
2790      * <p><b>Range of valid values:</b><br>
2791      * TODO: Remove property.</p>
2792      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2793      * @deprecated
2794      * <p>Not used in HALv3 or newer</p>
2795 
2796      * @hide
2797      */
2798     @Deprecated
2799     public static final Key<long[]> SCALER_AVAILABLE_JPEG_MIN_DURATIONS =
2800             new Key<long[]>("android.scaler.availableJpegMinDurations", long[].class);
2801 
2802     /**
2803      * <p>The JPEG resolutions that are supported by this camera device.</p>
2804      * <p>The resolutions are listed as <code>(width, height)</code> pairs. All camera devices will support
2805      * sensor maximum resolution (defined by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}).</p>
2806      * <p><b>Range of valid values:</b><br>
2807      * TODO: Remove property.</p>
2808      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2809      *
2810      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2811      * @deprecated
2812      * <p>Not used in HALv3 or newer</p>
2813 
2814      * @hide
2815      */
2816     @Deprecated
2817     public static final Key<android.util.Size[]> SCALER_AVAILABLE_JPEG_SIZES =
2818             new Key<android.util.Size[]>("android.scaler.availableJpegSizes", android.util.Size[].class);
2819 
2820     /**
2821      * <p>The maximum ratio between both active area width
2822      * and crop region width, and active area height and
2823      * crop region height, for {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
2824      * <p>This represents the maximum amount of zooming possible by
2825      * the camera device, or equivalently, the minimum cropping
2826      * window size.</p>
2827      * <p>Crop regions that have a width or height that is smaller
2828      * than this ratio allows will be rounded up to the minimum
2829      * allowed size by the camera device.</p>
2830      * <p>Starting from API level 30, when using {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} to zoom in or out,
2831      * the application must use {@link CameraCharacteristics#CONTROL_ZOOM_RATIO_RANGE android.control.zoomRatioRange} to query both the minimum and
2832      * maximum zoom ratio.</p>
2833      * <p><b>Units</b>: Zoom scale factor</p>
2834      * <p><b>Range of valid values:</b><br>
2835      * &gt;=1</p>
2836      * <p>This key is available on all devices.</p>
2837      *
2838      * @see CaptureRequest#CONTROL_ZOOM_RATIO
2839      * @see CameraCharacteristics#CONTROL_ZOOM_RATIO_RANGE
2840      * @see CaptureRequest#SCALER_CROP_REGION
2841      */
2842     @PublicKey
2843     @NonNull
2844     public static final Key<Float> SCALER_AVAILABLE_MAX_DIGITAL_ZOOM =
2845             new Key<Float>("android.scaler.availableMaxDigitalZoom", float.class);
2846 
2847     /**
2848      * <p>For each available processed output size (defined in
2849      * android.scaler.availableProcessedSizes), this property lists the
2850      * minimum supportable frame duration for that size.</p>
2851      * <p>This should correspond to the frame duration when only that processed
2852      * stream is active, with all processing (typically in android.*.mode)
2853      * set to FAST.</p>
2854      * <p>When multiple streams are configured, the minimum frame duration will
2855      * be &gt;= max(individual stream min durations).</p>
2856      * <p><b>Units</b>: Nanoseconds</p>
2857      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2858      * @deprecated
2859      * <p>Not used in HALv3 or newer</p>
2860 
2861      * @hide
2862      */
2863     @Deprecated
2864     public static final Key<long[]> SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS =
2865             new Key<long[]>("android.scaler.availableProcessedMinDurations", long[].class);
2866 
2867     /**
2868      * <p>The resolutions available for use with
2869      * processed output streams, such as YV12, NV12, and
2870      * platform opaque YUV/RGB streams to the GPU or video
2871      * encoders.</p>
2872      * <p>The resolutions are listed as <code>(width, height)</code> pairs.</p>
2873      * <p>For a given use case, the actual maximum supported resolution
2874      * may be lower than what is listed here, depending on the destination
2875      * Surface for the image data. For example, for recording video,
2876      * the video encoder chosen may have a maximum size limit (e.g. 1080p)
2877      * smaller than what the camera (e.g. maximum resolution is 3264x2448)
2878      * can provide.</p>
2879      * <p>Please reference the documentation for the image data destination to
2880      * check if it limits the maximum size for image data.</p>
2881      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2882      * @deprecated
2883      * <p>Not used in HALv3 or newer</p>
2884 
2885      * @hide
2886      */
2887     @Deprecated
2888     public static final Key<android.util.Size[]> SCALER_AVAILABLE_PROCESSED_SIZES =
2889             new Key<android.util.Size[]>("android.scaler.availableProcessedSizes", android.util.Size[].class);
2890 
2891     /**
2892      * <p>The mapping of image formats that are supported by this
2893      * camera device for input streams, to their corresponding output formats.</p>
2894      * <p>All camera devices with at least 1
2895      * {@link CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS android.request.maxNumInputStreams} will have at least one
2896      * available input format.</p>
2897      * <p>The camera device will support the following map of formats,
2898      * if its dependent capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}) is supported:</p>
2899      * <table>
2900      * <thead>
2901      * <tr>
2902      * <th style="text-align: left;">Input Format</th>
2903      * <th style="text-align: left;">Output Format</th>
2904      * <th style="text-align: left;">Capability</th>
2905      * </tr>
2906      * </thead>
2907      * <tbody>
2908      * <tr>
2909      * <td style="text-align: left;">{@link android.graphics.ImageFormat#PRIVATE }</td>
2910      * <td style="text-align: left;">{@link android.graphics.ImageFormat#JPEG }</td>
2911      * <td style="text-align: left;">PRIVATE_REPROCESSING</td>
2912      * </tr>
2913      * <tr>
2914      * <td style="text-align: left;">{@link android.graphics.ImageFormat#PRIVATE }</td>
2915      * <td style="text-align: left;">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
2916      * <td style="text-align: left;">PRIVATE_REPROCESSING</td>
2917      * </tr>
2918      * <tr>
2919      * <td style="text-align: left;">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
2920      * <td style="text-align: left;">{@link android.graphics.ImageFormat#JPEG }</td>
2921      * <td style="text-align: left;">YUV_REPROCESSING</td>
2922      * </tr>
2923      * <tr>
2924      * <td style="text-align: left;">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
2925      * <td style="text-align: left;">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
2926      * <td style="text-align: left;">YUV_REPROCESSING</td>
2927      * </tr>
2928      * </tbody>
2929      * </table>
2930      * <p>PRIVATE refers to a device-internal format that is not directly application-visible.  A
2931      * PRIVATE input surface can be acquired by {@link android.media.ImageReader#newInstance }
2932      * with {@link android.graphics.ImageFormat#PRIVATE } as the format.</p>
2933      * <p>For a PRIVATE_REPROCESSING-capable camera device, using the PRIVATE format as either input
2934      * 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>
2935      * <p>Attempting to configure an input stream with output streams not
2936      * listed as available in this map is not valid.</p>
2937      * <p>Additionally, if the camera device is MONOCHROME with Y8 support, it will also support
2938      * the following map of formats if its dependent capability
2939      * ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}) is supported:</p>
2940      * <table>
2941      * <thead>
2942      * <tr>
2943      * <th style="text-align: left;">Input Format</th>
2944      * <th style="text-align: left;">Output Format</th>
2945      * <th style="text-align: left;">Capability</th>
2946      * </tr>
2947      * </thead>
2948      * <tbody>
2949      * <tr>
2950      * <td style="text-align: left;">{@link android.graphics.ImageFormat#PRIVATE }</td>
2951      * <td style="text-align: left;">{@link android.graphics.ImageFormat#Y8 }</td>
2952      * <td style="text-align: left;">PRIVATE_REPROCESSING</td>
2953      * </tr>
2954      * <tr>
2955      * <td style="text-align: left;">{@link android.graphics.ImageFormat#Y8 }</td>
2956      * <td style="text-align: left;">{@link android.graphics.ImageFormat#JPEG }</td>
2957      * <td style="text-align: left;">YUV_REPROCESSING</td>
2958      * </tr>
2959      * <tr>
2960      * <td style="text-align: left;">{@link android.graphics.ImageFormat#Y8 }</td>
2961      * <td style="text-align: left;">{@link android.graphics.ImageFormat#Y8 }</td>
2962      * <td style="text-align: left;">YUV_REPROCESSING</td>
2963      * </tr>
2964      * </tbody>
2965      * </table>
2966      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
2967      *
2968      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
2969      * @see CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS
2970      * @hide
2971      */
2972     public static final Key<android.hardware.camera2.params.ReprocessFormatsMap> SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP =
2973             new Key<android.hardware.camera2.params.ReprocessFormatsMap>("android.scaler.availableInputOutputFormatsMap", android.hardware.camera2.params.ReprocessFormatsMap.class);
2974 
2975     /**
2976      * <p>The available stream configurations that this
2977      * camera device supports
2978      * (i.e. format, width, height, output/input stream).</p>
2979      * <p>The configurations are listed as <code>(format, width, height, input?)</code>
2980      * tuples.</p>
2981      * <p>For a given use case, the actual maximum supported resolution
2982      * may be lower than what is listed here, depending on the destination
2983      * Surface for the image data. For example, for recording video,
2984      * the video encoder chosen may have a maximum size limit (e.g. 1080p)
2985      * smaller than what the camera (e.g. maximum resolution is 3264x2448)
2986      * can provide.</p>
2987      * <p>Please reference the documentation for the image data destination to
2988      * check if it limits the maximum size for image data.</p>
2989      * <p>Not all output formats may be supported in a configuration with
2990      * an input stream of a particular format. For more details, see
2991      * android.scaler.availableInputOutputFormatsMap.</p>
2992      * <p>For applications targeting SDK version older than 31, the following table
2993      * describes the minimum required output stream configurations based on the hardware level
2994      * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}):</p>
2995      * <table>
2996      * <thead>
2997      * <tr>
2998      * <th style="text-align: center;">Format</th>
2999      * <th style="text-align: center;">Size</th>
3000      * <th style="text-align: center;">Hardware Level</th>
3001      * <th style="text-align: center;">Notes</th>
3002      * </tr>
3003      * </thead>
3004      * <tbody>
3005      * <tr>
3006      * <td style="text-align: center;">JPEG</td>
3007      * <td style="text-align: center;">{@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</td>
3008      * <td style="text-align: center;">Any</td>
3009      * <td style="text-align: center;"></td>
3010      * </tr>
3011      * <tr>
3012      * <td style="text-align: center;">JPEG</td>
3013      * <td style="text-align: center;">1920x1080 (1080p)</td>
3014      * <td style="text-align: center;">Any</td>
3015      * <td style="text-align: center;">if 1080p &lt;= activeArraySize</td>
3016      * </tr>
3017      * <tr>
3018      * <td style="text-align: center;">JPEG</td>
3019      * <td style="text-align: center;">1280x720 (720)</td>
3020      * <td style="text-align: center;">Any</td>
3021      * <td style="text-align: center;">if 720p &lt;= activeArraySize</td>
3022      * </tr>
3023      * <tr>
3024      * <td style="text-align: center;">JPEG</td>
3025      * <td style="text-align: center;">640x480 (480p)</td>
3026      * <td style="text-align: center;">Any</td>
3027      * <td style="text-align: center;">if 480p &lt;= activeArraySize</td>
3028      * </tr>
3029      * <tr>
3030      * <td style="text-align: center;">JPEG</td>
3031      * <td style="text-align: center;">320x240 (240p)</td>
3032      * <td style="text-align: center;">Any</td>
3033      * <td style="text-align: center;">if 240p &lt;= activeArraySize</td>
3034      * </tr>
3035      * <tr>
3036      * <td style="text-align: center;">YUV_420_888</td>
3037      * <td style="text-align: center;">all output sizes available for JPEG</td>
3038      * <td style="text-align: center;">FULL</td>
3039      * <td style="text-align: center;"></td>
3040      * </tr>
3041      * <tr>
3042      * <td style="text-align: center;">YUV_420_888</td>
3043      * <td style="text-align: center;">all output sizes available for JPEG, up to the maximum video size</td>
3044      * <td style="text-align: center;">LIMITED</td>
3045      * <td style="text-align: center;"></td>
3046      * </tr>
3047      * <tr>
3048      * <td style="text-align: center;">IMPLEMENTATION_DEFINED</td>
3049      * <td style="text-align: center;">same as YUV_420_888</td>
3050      * <td style="text-align: center;">Any</td>
3051      * <td style="text-align: center;"></td>
3052      * </tr>
3053      * </tbody>
3054      * </table>
3055      * <p>For applications targeting SDK version 31 or newer, if the mobile device declares to be
3056      * media performance class 12 or higher by setting
3057      * {@link android.os.Build.VERSION#MEDIA_PERFORMANCE_CLASS } to be 31 or larger,
3058      * the primary camera devices (first rear/front camera in the camera ID list) will not
3059      * support JPEG sizes smaller than 1080p. If the application configures a JPEG stream
3060      * smaller than 1080p, the camera device will round up the JPEG image size to at least
3061      * 1080p. The requirements for IMPLEMENTATION_DEFINED and YUV_420_888 stay the same.
3062      * This new minimum required output stream configurations are illustrated by the table below:</p>
3063      * <table>
3064      * <thead>
3065      * <tr>
3066      * <th style="text-align: center;">Format</th>
3067      * <th style="text-align: center;">Size</th>
3068      * <th style="text-align: center;">Hardware Level</th>
3069      * <th style="text-align: center;">Notes</th>
3070      * </tr>
3071      * </thead>
3072      * <tbody>
3073      * <tr>
3074      * <td style="text-align: center;">JPEG</td>
3075      * <td style="text-align: center;">{@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</td>
3076      * <td style="text-align: center;">Any</td>
3077      * <td style="text-align: center;"></td>
3078      * </tr>
3079      * <tr>
3080      * <td style="text-align: center;">JPEG</td>
3081      * <td style="text-align: center;">1920x1080 (1080p)</td>
3082      * <td style="text-align: center;">Any</td>
3083      * <td style="text-align: center;">if 1080p &lt;= activeArraySize</td>
3084      * </tr>
3085      * <tr>
3086      * <td style="text-align: center;">YUV_420_888</td>
3087      * <td style="text-align: center;">{@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</td>
3088      * <td style="text-align: center;">FULL</td>
3089      * <td style="text-align: center;"></td>
3090      * </tr>
3091      * <tr>
3092      * <td style="text-align: center;">YUV_420_888</td>
3093      * <td style="text-align: center;">1920x1080 (1080p)</td>
3094      * <td style="text-align: center;">FULL</td>
3095      * <td style="text-align: center;">if 1080p &lt;= activeArraySize</td>
3096      * </tr>
3097      * <tr>
3098      * <td style="text-align: center;">YUV_420_888</td>
3099      * <td style="text-align: center;">1280x720 (720)</td>
3100      * <td style="text-align: center;">FULL</td>
3101      * <td style="text-align: center;">if 720p &lt;= activeArraySize</td>
3102      * </tr>
3103      * <tr>
3104      * <td style="text-align: center;">YUV_420_888</td>
3105      * <td style="text-align: center;">640x480 (480p)</td>
3106      * <td style="text-align: center;">FULL</td>
3107      * <td style="text-align: center;">if 480p &lt;= activeArraySize</td>
3108      * </tr>
3109      * <tr>
3110      * <td style="text-align: center;">YUV_420_888</td>
3111      * <td style="text-align: center;">320x240 (240p)</td>
3112      * <td style="text-align: center;">FULL</td>
3113      * <td style="text-align: center;">if 240p &lt;= activeArraySize</td>
3114      * </tr>
3115      * <tr>
3116      * <td style="text-align: center;">YUV_420_888</td>
3117      * <td style="text-align: center;">all output sizes available for FULL hardware level, up to the maximum video size</td>
3118      * <td style="text-align: center;">LIMITED</td>
3119      * <td style="text-align: center;"></td>
3120      * </tr>
3121      * <tr>
3122      * <td style="text-align: center;">IMPLEMENTATION_DEFINED</td>
3123      * <td style="text-align: center;">same as YUV_420_888</td>
3124      * <td style="text-align: center;">Any</td>
3125      * <td style="text-align: center;"></td>
3126      * </tr>
3127      * </tbody>
3128      * </table>
3129      * <p>For applications targeting SDK version 31 or newer, if the mobile device doesn't declare
3130      * to be media performance class 12 or better by setting
3131      * {@link android.os.Build.VERSION#MEDIA_PERFORMANCE_CLASS } to be 31 or larger,
3132      * or if the camera device isn't a primary rear/front camera, the minimum required output
3133      * stream configurations are the same as for applications targeting SDK version older than
3134      * 31.</p>
3135      * <p>Refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} for additional
3136      * mandatory stream configurations on a per-capability basis.</p>
3137      * <p>Exception on 176x144 (QCIF) resolution: camera devices usually have a fixed capability for
3138      * downscaling from larger resolution to smaller, and the QCIF resolution sometimes is not
3139      * fully supported due to this limitation on devices with high-resolution image sensors.
3140      * Therefore, trying to configure a QCIF resolution stream together with any other
3141      * stream larger than 1920x1080 resolution (either width or height) might not be supported,
3142      * and capture session creation will fail if it is not.</p>
3143      * <p>This key is available on all devices.</p>
3144      *
3145      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3146      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
3147      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3148      * @hide
3149      */
3150     public static final Key<android.hardware.camera2.params.StreamConfiguration[]> SCALER_AVAILABLE_STREAM_CONFIGURATIONS =
3151             new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.scaler.availableStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
3152 
3153     /**
3154      * <p>This lists the minimum frame duration for each
3155      * format/size combination.</p>
3156      * <p>This should correspond to the frame duration when only that
3157      * stream is active, with all processing (typically in android.*.mode)
3158      * set to either OFF or FAST.</p>
3159      * <p>When multiple streams are used in a request, the minimum frame
3160      * duration will be max(individual stream min durations).</p>
3161      * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
3162      * android.scaler.availableStallDurations for more details about
3163      * calculating the max frame rate.</p>
3164      * <p><b>Units</b>: (format, width, height, ns) x n</p>
3165      * <p>This key is available on all devices.</p>
3166      *
3167      * @see CaptureRequest#SENSOR_FRAME_DURATION
3168      * @hide
3169      */
3170     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> SCALER_AVAILABLE_MIN_FRAME_DURATIONS =
3171             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.scaler.availableMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
3172 
3173     /**
3174      * <p>This lists the maximum stall duration for each
3175      * output format/size combination.</p>
3176      * <p>A stall duration is how much extra time would get added
3177      * to the normal minimum frame duration for a repeating request
3178      * that has streams with non-zero stall.</p>
3179      * <p>For example, consider JPEG captures which have the following
3180      * characteristics:</p>
3181      * <ul>
3182      * <li>JPEG streams act like processed YUV streams in requests for which
3183      * they are not included; in requests in which they are directly
3184      * referenced, they act as JPEG streams. This is because supporting a
3185      * JPEG stream requires the underlying YUV data to always be ready for
3186      * use by a JPEG encoder, but the encoder will only be used (and impact
3187      * frame duration) on requests that actually reference a JPEG stream.</li>
3188      * <li>The JPEG processor can run concurrently to the rest of the camera
3189      * pipeline, but cannot process more than 1 capture at a time.</li>
3190      * </ul>
3191      * <p>In other words, using a repeating YUV request would result
3192      * in a steady frame rate (let's say it's 30 FPS). If a single
3193      * JPEG request is submitted periodically, the frame rate will stay
3194      * at 30 FPS (as long as we wait for the previous JPEG to return each
3195      * time). If we try to submit a repeating YUV + JPEG request, then
3196      * the frame rate will drop from 30 FPS.</p>
3197      * <p>In general, submitting a new request with a non-0 stall time
3198      * stream will <em>not</em> cause a frame rate drop unless there are still
3199      * outstanding buffers for that stream from previous requests.</p>
3200      * <p>Submitting a repeating request with streams (call this <code>S</code>)
3201      * is the same as setting the minimum frame duration from
3202      * the normal minimum frame duration corresponding to <code>S</code>, added with
3203      * the maximum stall duration for <code>S</code>.</p>
3204      * <p>If interleaving requests with and without a stall duration,
3205      * a request will stall by the maximum of the remaining times
3206      * for each can-stall stream with outstanding buffers.</p>
3207      * <p>This means that a stalling request will not have an exposure start
3208      * until the stall has completed.</p>
3209      * <p>This should correspond to the stall duration when only that stream is
3210      * active, with all processing (typically in android.*.mode) set to FAST
3211      * or OFF. Setting any of the processing modes to HIGH_QUALITY
3212      * effectively results in an indeterminate stall duration for all
3213      * streams in a request (the regular stall calculation rules are
3214      * ignored).</p>
3215      * <p>The following formats may always have a stall duration:</p>
3216      * <ul>
3217      * <li>{@link android.graphics.ImageFormat#JPEG }</li>
3218      * <li>{@link android.graphics.ImageFormat#RAW_SENSOR }</li>
3219      * </ul>
3220      * <p>The following formats will never have a stall duration:</p>
3221      * <ul>
3222      * <li>{@link android.graphics.ImageFormat#YUV_420_888 }</li>
3223      * <li>{@link android.graphics.ImageFormat#RAW10 }</li>
3224      * <li>{@link android.graphics.ImageFormat#RAW12 }</li>
3225      * <li>{@link android.graphics.ImageFormat#Y8 }</li>
3226      * </ul>
3227      * <p>All other formats may or may not have an allowed stall duration on
3228      * a per-capability basis; refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
3229      * for more details.</p>
3230      * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} for more information about
3231      * calculating the max frame rate (absent stalls).</p>
3232      * <p><b>Units</b>: (format, width, height, ns) x n</p>
3233      * <p>This key is available on all devices.</p>
3234      *
3235      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
3236      * @see CaptureRequest#SENSOR_FRAME_DURATION
3237      * @hide
3238      */
3239     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> SCALER_AVAILABLE_STALL_DURATIONS =
3240             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.scaler.availableStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
3241 
3242     /**
3243      * <p>The available stream configurations that this
3244      * camera device supports; also includes the minimum frame durations
3245      * and the stall durations for each format/size combination.</p>
3246      * <p>All camera devices will support sensor maximum resolution (defined by
3247      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}) for the JPEG format.</p>
3248      * <p>For a given use case, the actual maximum supported resolution
3249      * may be lower than what is listed here, depending on the destination
3250      * Surface for the image data. For example, for recording video,
3251      * the video encoder chosen may have a maximum size limit (e.g. 1080p)
3252      * smaller than what the camera (e.g. maximum resolution is 3264x2448)
3253      * can provide.</p>
3254      * <p>Please reference the documentation for the image data destination to
3255      * check if it limits the maximum size for image data.</p>
3256      * <p>For applications targeting SDK version older than 31, the following table
3257      * describes the minimum required output stream configurations based on the
3258      * hardware level ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}):</p>
3259      * <table>
3260      * <thead>
3261      * <tr>
3262      * <th style="text-align: center;">Format</th>
3263      * <th style="text-align: center;">Size</th>
3264      * <th style="text-align: center;">Hardware Level</th>
3265      * <th style="text-align: center;">Notes</th>
3266      * </tr>
3267      * </thead>
3268      * <tbody>
3269      * <tr>
3270      * <td style="text-align: center;">{@link android.graphics.ImageFormat#JPEG }</td>
3271      * <td style="text-align: center;">{@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} (*1)</td>
3272      * <td style="text-align: center;">Any</td>
3273      * <td style="text-align: center;"></td>
3274      * </tr>
3275      * <tr>
3276      * <td style="text-align: center;">{@link android.graphics.ImageFormat#JPEG }</td>
3277      * <td style="text-align: center;">1920x1080 (1080p)</td>
3278      * <td style="text-align: center;">Any</td>
3279      * <td style="text-align: center;">if 1080p &lt;= activeArraySize</td>
3280      * </tr>
3281      * <tr>
3282      * <td style="text-align: center;">{@link android.graphics.ImageFormat#JPEG }</td>
3283      * <td style="text-align: center;">1280x720 (720p)</td>
3284      * <td style="text-align: center;">Any</td>
3285      * <td style="text-align: center;">if 720p &lt;= activeArraySize</td>
3286      * </tr>
3287      * <tr>
3288      * <td style="text-align: center;">{@link android.graphics.ImageFormat#JPEG }</td>
3289      * <td style="text-align: center;">640x480 (480p)</td>
3290      * <td style="text-align: center;">Any</td>
3291      * <td style="text-align: center;">if 480p &lt;= activeArraySize</td>
3292      * </tr>
3293      * <tr>
3294      * <td style="text-align: center;">{@link android.graphics.ImageFormat#JPEG }</td>
3295      * <td style="text-align: center;">320x240 (240p)</td>
3296      * <td style="text-align: center;">Any</td>
3297      * <td style="text-align: center;">if 240p &lt;= activeArraySize</td>
3298      * </tr>
3299      * <tr>
3300      * <td style="text-align: center;">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
3301      * <td style="text-align: center;">all output sizes available for JPEG</td>
3302      * <td style="text-align: center;">FULL</td>
3303      * <td style="text-align: center;"></td>
3304      * </tr>
3305      * <tr>
3306      * <td style="text-align: center;">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
3307      * <td style="text-align: center;">all output sizes available for JPEG, up to the maximum video size</td>
3308      * <td style="text-align: center;">LIMITED</td>
3309      * <td style="text-align: center;"></td>
3310      * </tr>
3311      * <tr>
3312      * <td style="text-align: center;">{@link android.graphics.ImageFormat#PRIVATE }</td>
3313      * <td style="text-align: center;">same as YUV_420_888</td>
3314      * <td style="text-align: center;">Any</td>
3315      * <td style="text-align: center;"></td>
3316      * </tr>
3317      * </tbody>
3318      * </table>
3319      * <p>For applications targeting SDK version 31 or newer, if the mobile device declares to be
3320      * media performance class 12 or higher by setting
3321      * {@link android.os.Build.VERSION#MEDIA_PERFORMANCE_CLASS } to be 31 or larger,
3322      * the primary camera devices (first rear/front camera in the camera ID list) will not
3323      * support JPEG sizes smaller than 1080p. If the application configures a JPEG stream
3324      * smaller than 1080p, the camera device will round up the JPEG image size to at least
3325      * 1080p. The requirements for IMPLEMENTATION_DEFINED and YUV_420_888 stay the same.
3326      * This new minimum required output stream configurations are illustrated by the table below:</p>
3327      * <table>
3328      * <thead>
3329      * <tr>
3330      * <th style="text-align: center;">Format</th>
3331      * <th style="text-align: center;">Size</th>
3332      * <th style="text-align: center;">Hardware Level</th>
3333      * <th style="text-align: center;">Notes</th>
3334      * </tr>
3335      * </thead>
3336      * <tbody>
3337      * <tr>
3338      * <td style="text-align: center;">{@link android.graphics.ImageFormat#JPEG }</td>
3339      * <td style="text-align: center;">{@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} (*1)</td>
3340      * <td style="text-align: center;">Any</td>
3341      * <td style="text-align: center;"></td>
3342      * </tr>
3343      * <tr>
3344      * <td style="text-align: center;">{@link android.graphics.ImageFormat#JPEG }</td>
3345      * <td style="text-align: center;">1920x1080 (1080p)</td>
3346      * <td style="text-align: center;">Any</td>
3347      * <td style="text-align: center;">if 1080p &lt;= activeArraySize</td>
3348      * </tr>
3349      * <tr>
3350      * <td style="text-align: center;">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
3351      * <td style="text-align: center;">{@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</td>
3352      * <td style="text-align: center;">FULL</td>
3353      * <td style="text-align: center;"></td>
3354      * </tr>
3355      * <tr>
3356      * <td style="text-align: center;">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
3357      * <td style="text-align: center;">1920x1080 (1080p)</td>
3358      * <td style="text-align: center;">FULL</td>
3359      * <td style="text-align: center;">if 1080p &lt;= activeArraySize</td>
3360      * </tr>
3361      * <tr>
3362      * <td style="text-align: center;">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
3363      * <td style="text-align: center;">1280x720 (720)</td>
3364      * <td style="text-align: center;">FULL</td>
3365      * <td style="text-align: center;">if 720p &lt;= activeArraySize</td>
3366      * </tr>
3367      * <tr>
3368      * <td style="text-align: center;">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
3369      * <td style="text-align: center;">640x480 (480p)</td>
3370      * <td style="text-align: center;">FULL</td>
3371      * <td style="text-align: center;">if 480p &lt;= activeArraySize</td>
3372      * </tr>
3373      * <tr>
3374      * <td style="text-align: center;">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
3375      * <td style="text-align: center;">320x240 (240p)</td>
3376      * <td style="text-align: center;">FULL</td>
3377      * <td style="text-align: center;">if 240p &lt;= activeArraySize</td>
3378      * </tr>
3379      * <tr>
3380      * <td style="text-align: center;">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
3381      * <td style="text-align: center;">all output sizes available for FULL hardware level, up to the maximum video size</td>
3382      * <td style="text-align: center;">LIMITED</td>
3383      * <td style="text-align: center;"></td>
3384      * </tr>
3385      * <tr>
3386      * <td style="text-align: center;">{@link android.graphics.ImageFormat#PRIVATE }</td>
3387      * <td style="text-align: center;">same as YUV_420_888</td>
3388      * <td style="text-align: center;">Any</td>
3389      * <td style="text-align: center;"></td>
3390      * </tr>
3391      * </tbody>
3392      * </table>
3393      * <p>For applications targeting SDK version 31 or newer, if the mobile device doesn't declare
3394      * to be media performance class 12 or better by setting
3395      * {@link android.os.Build.VERSION#MEDIA_PERFORMANCE_CLASS } to be 31 or larger,
3396      * or if the camera device isn't a primary rear/front camera, the minimum required output
3397      * stream configurations are the same as for applications targeting SDK version older than
3398      * 31.</p>
3399      * <p>Refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} and
3400      * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraDevice#legacy-level-guaranteed-configurations">the table</a>
3401      * for additional mandatory stream configurations on a per-capability basis.</p>
3402      * <p>*1: For JPEG format, the sizes may be restricted by below conditions:</p>
3403      * <ul>
3404      * <li>The HAL may choose the aspect ratio of each Jpeg size to be one of well known ones
3405      * (e.g. 4:3, 16:9, 3:2 etc.). If the sensor maximum resolution
3406      * (defined by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}) has an aspect ratio other than these,
3407      * it does not have to be included in the supported JPEG sizes.</li>
3408      * <li>Some hardware JPEG encoders may have pixel boundary alignment requirements, such as
3409      * the dimensions being a multiple of 16.
3410      * Therefore, the maximum JPEG size may be smaller than sensor maximum resolution.
3411      * However, the largest JPEG size will be as close as possible to the sensor maximum
3412      * resolution given above constraints. It is required that after aspect ratio adjustments,
3413      * additional size reduction due to other issues must be less than 3% in area. For example,
3414      * if the sensor maximum resolution is 3280x2464, if the maximum JPEG size has aspect
3415      * ratio 4:3, and the JPEG encoder alignment requirement is 16, the maximum JPEG size will be
3416      * 3264x2448.</li>
3417      * </ul>
3418      * <p>Exception on 176x144 (QCIF) resolution: camera devices usually have a fixed capability on
3419      * downscaling from larger resolution to smaller ones, and the QCIF resolution can sometimes
3420      * not be fully supported due to this limitation on devices with high-resolution image
3421      * sensors. Therefore, trying to configure a QCIF resolution stream together with any other
3422      * stream larger than 1920x1080 resolution (either width or height) might not be supported,
3423      * and capture session creation will fail if it is not.</p>
3424      * <p>This key is available on all devices.</p>
3425      *
3426      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3427      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
3428      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3429      */
3430     @PublicKey
3431     @NonNull
3432     @SyntheticKey
3433     public static final Key<android.hardware.camera2.params.StreamConfigurationMap> SCALER_STREAM_CONFIGURATION_MAP =
3434             new Key<android.hardware.camera2.params.StreamConfigurationMap>("android.scaler.streamConfigurationMap", android.hardware.camera2.params.StreamConfigurationMap.class);
3435 
3436     /**
3437      * <p>The crop type that this camera device supports.</p>
3438      * <p>When passing a non-centered crop region ({@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}) to a camera
3439      * device that only supports CENTER_ONLY cropping, the camera device will move the
3440      * crop region to the center of the sensor active array ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize})
3441      * and keep the crop region width and height unchanged. The camera device will return the
3442      * final used crop region in metadata result {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
3443      * <p>Camera devices that support FREEFORM cropping will support any crop region that
3444      * is inside of the active array. The camera device will apply the same crop region and
3445      * return the final used crop region in capture result metadata {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
3446      * <p>Starting from API level 30,</p>
3447      * <ul>
3448      * <li>If the camera device supports FREEFORM cropping, in order to do FREEFORM cropping, the
3449      * application must set {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} to 1.0, and use {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}
3450      * for zoom.</li>
3451      * <li>To do CENTER_ONLY zoom, the application has below 2 options:<ol>
3452      * <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>
3453      * <li>Adjust zoom by {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio}; use {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to crop
3454      * the field of view vertically (letterboxing) or horizontally (pillarboxing), but not
3455      * windowboxing.</li>
3456      * </ol>
3457      * </li>
3458      * <li>Setting {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio} to values different than 1.0 and
3459      * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to be windowboxing at the same time are not supported. In this
3460      * case, the camera framework will override the {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to be the active
3461      * array.</li>
3462      * </ul>
3463      * <p>LEGACY capability devices will only support CENTER_ONLY cropping.</p>
3464      * <p><b>Possible values:</b></p>
3465      * <ul>
3466      *   <li>{@link #SCALER_CROPPING_TYPE_CENTER_ONLY CENTER_ONLY}</li>
3467      *   <li>{@link #SCALER_CROPPING_TYPE_FREEFORM FREEFORM}</li>
3468      * </ul>
3469      *
3470      * <p>This key is available on all devices.</p>
3471      *
3472      * @see CaptureRequest#CONTROL_ZOOM_RATIO
3473      * @see CaptureRequest#SCALER_CROP_REGION
3474      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3475      * @see #SCALER_CROPPING_TYPE_CENTER_ONLY
3476      * @see #SCALER_CROPPING_TYPE_FREEFORM
3477      */
3478     @PublicKey
3479     @NonNull
3480     public static final Key<Integer> SCALER_CROPPING_TYPE =
3481             new Key<Integer>("android.scaler.croppingType", int.class);
3482 
3483     /**
3484      * <p>Recommended stream configurations for common client use cases.</p>
3485      * <p>Optional subset of the android.scaler.availableStreamConfigurations that contains
3486      * similar tuples listed as
3487      * (i.e. width, height, format, output/input stream, usecase bit field).
3488      * Camera devices will be able to suggest particular stream configurations which are
3489      * power and performance efficient for specific use cases. For more information about
3490      * retrieving the suggestions see
3491      * {@link android.hardware.camera2.CameraCharacteristics#getRecommendedStreamConfigurationMap }.</p>
3492      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3493      * @hide
3494      */
3495     public static final Key<android.hardware.camera2.params.RecommendedStreamConfiguration[]> SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS =
3496             new Key<android.hardware.camera2.params.RecommendedStreamConfiguration[]>("android.scaler.availableRecommendedStreamConfigurations", android.hardware.camera2.params.RecommendedStreamConfiguration[].class);
3497 
3498     /**
3499      * <p>Recommended mappings of image formats that are supported by this
3500      * camera device for input streams, to their corresponding output formats.</p>
3501      * <p>This is a recommended subset of the complete list of mappings found in
3502      * android.scaler.availableInputOutputFormatsMap. The same requirements apply here as well.
3503      * The list however doesn't need to contain all available and supported mappings. Instead of
3504      * this developers must list only recommended and efficient entries.
3505      * If set, the information will be available in the ZERO_SHUTTER_LAG recommended stream
3506      * configuration see
3507      * {@link android.hardware.camera2.CameraCharacteristics#getRecommendedStreamConfigurationMap }.</p>
3508      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3509      * @hide
3510      */
3511     public static final Key<android.hardware.camera2.params.ReprocessFormatsMap> SCALER_AVAILABLE_RECOMMENDED_INPUT_OUTPUT_FORMATS_MAP =
3512             new Key<android.hardware.camera2.params.ReprocessFormatsMap>("android.scaler.availableRecommendedInputOutputFormatsMap", android.hardware.camera2.params.ReprocessFormatsMap.class);
3513 
3514     /**
3515      * <p>An array of mandatory stream combinations generated according to the camera device
3516      * {@link android.hardware.camera2.CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL }
3517      * and {@link android.hardware.camera2.CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES }.
3518      * This is an app-readable conversion of the mandatory stream combination
3519      * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraDevice#legacy-level-guaranteed-configurations">tables</a>.</p>
3520      * <p>The array of
3521      * {@link android.hardware.camera2.params.MandatoryStreamCombination combinations} is
3522      * generated according to the documented
3523      * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraDevice#legacy-level-guaranteed-configurations">guideline</a>.
3524      * based on specific device level and capabilities.
3525      * Clients can use the array as a quick reference to find an appropriate camera stream
3526      * combination.
3527      * As per documentation, the stream combinations with given PREVIEW, RECORD and
3528      * MAXIMUM resolutions and anything smaller from the list given by
3529      * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes } are
3530      * guaranteed to work.
3531      * For a physical camera not independently exposed in
3532      * {@link android.hardware.camera2.CameraManager#getCameraIdList }, the mandatory stream
3533      * combinations for that physical camera Id are also generated, so that the application can
3534      * configure them as physical streams via the logical camera.
3535      * The mandatory stream combination array will be {@code null} in case the device is not
3536      * backward compatible.</p>
3537      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3538      * <p><b>Limited capability</b> -
3539      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3540      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3541      *
3542      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3543      */
3544     @PublicKey
3545     @NonNull
3546     @SyntheticKey
3547     public static final Key<android.hardware.camera2.params.MandatoryStreamCombination[]> SCALER_MANDATORY_STREAM_COMBINATIONS =
3548             new Key<android.hardware.camera2.params.MandatoryStreamCombination[]>("android.scaler.mandatoryStreamCombinations", android.hardware.camera2.params.MandatoryStreamCombination[].class);
3549 
3550     /**
3551      * <p>An array of mandatory concurrent stream combinations.
3552      * This is an app-readable conversion of the concurrent mandatory stream combination
3553      * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraDevice#concurrent-stream-guaranteed-configurations">tables</a>.</p>
3554      * <p>The array of
3555      * {@link android.hardware.camera2.params.MandatoryStreamCombination combinations} is
3556      * generated according to the documented
3557      * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraDevice#concurrent-stream-guaranteed-configurations">guideline</a>
3558      * for each device which has its Id present in the set returned by
3559      * {@link android.hardware.camera2.CameraManager#getConcurrentCameraIds }.
3560      * Clients can use the array as a quick reference to find an appropriate camera stream
3561      * combination.
3562      * The mandatory stream combination array will be {@code null} in case the device is not a
3563      * part of at least one set of combinations returned by
3564      * {@link android.hardware.camera2.CameraManager#getConcurrentCameraIds }.</p>
3565      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3566      */
3567     @PublicKey
3568     @NonNull
3569     @SyntheticKey
3570     public static final Key<android.hardware.camera2.params.MandatoryStreamCombination[]> SCALER_MANDATORY_CONCURRENT_STREAM_COMBINATIONS =
3571             new Key<android.hardware.camera2.params.MandatoryStreamCombination[]>("android.scaler.mandatoryConcurrentStreamCombinations", android.hardware.camera2.params.MandatoryStreamCombination[].class);
3572 
3573     /**
3574      * <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>
3575      * <p>This entry lists the valid modes for {@link CaptureRequest#SCALER_ROTATE_AND_CROP android.scaler.rotateAndCrop} for this camera device.</p>
3576      * <p>Starting with API level 30, all devices will list at least <code>ROTATE_AND_CROP_NONE</code>.
3577      * Devices with support for rotate-and-crop will additionally list at least
3578      * <code>ROTATE_AND_CROP_AUTO</code> and <code>ROTATE_AND_CROP_90</code>.</p>
3579      * <p><b>Range of valid values:</b><br>
3580      * Any value listed in {@link CaptureRequest#SCALER_ROTATE_AND_CROP android.scaler.rotateAndCrop}</p>
3581      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3582      *
3583      * @see CaptureRequest#SCALER_ROTATE_AND_CROP
3584      */
3585     @PublicKey
3586     @NonNull
3587     public static final Key<int[]> SCALER_AVAILABLE_ROTATE_AND_CROP_MODES =
3588             new Key<int[]>("android.scaler.availableRotateAndCropModes", int[].class);
3589 
3590     /**
3591      * <p>Default YUV/PRIVATE size to use for requesting secure image buffers.</p>
3592      * <p>This entry lists the default size supported in the secure camera mode. This entry is
3593      * optional on devices support the SECURE_IMAGE_DATA capability. This entry will be null
3594      * if the camera device does not list SECURE_IMAGE_DATA capability.</p>
3595      * <p>When the key is present, only a PRIVATE/YUV output of the specified size is guaranteed
3596      * to be supported by the camera HAL in the secure camera mode. Any other format or
3597      * resolutions might not be supported. Use
3598      * {@link CameraDevice#isSessionConfigurationSupported }
3599      * API to query if a secure session configuration is supported if the device supports this
3600      * API.</p>
3601      * <p>If this key returns null on a device with SECURE_IMAGE_DATA capability, the application
3602      * can assume all output sizes listed in the
3603      * {@link android.hardware.camera2.params.StreamConfigurationMap }
3604      * are supported.</p>
3605      * <p><b>Units</b>: Pixels</p>
3606      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3607      */
3608     @PublicKey
3609     @NonNull
3610     public static final Key<android.util.Size> SCALER_DEFAULT_SECURE_IMAGE_SIZE =
3611             new Key<android.util.Size>("android.scaler.defaultSecureImageSize", android.util.Size.class);
3612 
3613     /**
3614      * <p>The available multi-resolution stream configurations that this
3615      * physical camera device supports
3616      * (i.e. format, width, height, output/input stream).</p>
3617      * <p>This list contains a subset of the parent logical camera's multi-resolution stream
3618      * configurations which belong to this physical camera, and it will advertise and will only
3619      * advertise the maximum supported resolutions for a particular format.</p>
3620      * <p>If this camera device isn't a physical camera device constituting a logical camera,
3621      * but a standalone {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR }
3622      * camera, this field represents the multi-resolution input/output stream configurations of
3623      * default mode and max resolution modes. The sizes will be the maximum resolution of a
3624      * particular format for default mode and max resolution mode.</p>
3625      * <p>This field will only be advertised if the device is a physical camera of a
3626      * logical multi-camera device or an ultra high resolution sensor camera. For a logical
3627      * multi-camera, the camera API will derive the logical camera’s multi-resolution stream
3628      * configurations from all physical cameras. For an ultra high resolution sensor camera, this
3629      * is used directly as the camera’s multi-resolution stream configurations.</p>
3630      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3631      * <p><b>Limited capability</b> -
3632      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3633      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3634      *
3635      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3636      * @hide
3637      */
3638     public static final Key<android.hardware.camera2.params.StreamConfiguration[]> SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS =
3639             new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.scaler.physicalCameraMultiResolutionStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
3640 
3641     /**
3642      * <p>The multi-resolution stream configurations supported by this logical camera
3643      * or ultra high resolution sensor camera device.</p>
3644      * <p>Multi-resolution streams can be used by a LOGICAL_MULTI_CAMERA or an
3645      * ULTRA_HIGH_RESOLUTION_SENSOR camera where the images sent or received can vary in
3646      * resolution per frame. This is useful in cases where the camera device's effective full
3647      * resolution changes depending on factors such as the current zoom level, lighting
3648      * condition, focus distance, or pixel mode.</p>
3649      * <ul>
3650      * <li>For a logical multi-camera implementing optical zoom, at different zoom level, a
3651      * different physical camera may be active, resulting in different full-resolution image
3652      * sizes.</li>
3653      * <li>For an ultra high resolution camera, depending on whether the camera operates in default
3654      * mode, or maximum resolution mode, the output full-size images may be of either binned
3655      * resolution or maximum resolution.</li>
3656      * </ul>
3657      * <p>To use multi-resolution output streams, the supported formats can be queried by {@link android.hardware.camera2.params.MultiResolutionStreamConfigurationMap#getOutputFormats }.
3658      * A {@link android.hardware.camera2.MultiResolutionImageReader } can then be created for a
3659      * supported format with the MultiResolutionStreamInfo group queried by {@link android.hardware.camera2.params.MultiResolutionStreamConfigurationMap#getOutputInfo }.</p>
3660      * <p>If a camera device supports multi-resolution output streams for a particular format, for
3661      * each of its mandatory stream combinations, the camera device will support using a
3662      * MultiResolutionImageReader for the MAXIMUM stream of supported formats. Refer to
3663      * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraDevice#legacy-level-additional-guaranteed-combinations-with-multiresolutionoutputs">the table</a>
3664      * for additional details.</p>
3665      * <p>To use multi-resolution input streams, the supported formats can be queried by {@link android.hardware.camera2.params.MultiResolutionStreamConfigurationMap#getInputFormats }.
3666      * A reprocessable CameraCaptureSession can then be created using an {@link android.hardware.camera2.params.InputConfiguration InputConfiguration} constructed with
3667      * the input MultiResolutionStreamInfo group, queried by {@link android.hardware.camera2.params.MultiResolutionStreamConfigurationMap#getInputInfo }.</p>
3668      * <p>If a camera device supports multi-resolution {@code YUV} input and multi-resolution
3669      * {@code YUV} output, or multi-resolution {@code PRIVATE} input and multi-resolution
3670      * {@code PRIVATE} output, {@code JPEG} and {@code YUV} are guaranteed to be supported
3671      * multi-resolution output stream formats. Refer to
3672      * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraDevice#legacy-level-additional-guaranteed-combinations-with-multiresolutionoutputs">the table</a>
3673      * for details about the additional mandatory stream combinations in this case.</p>
3674      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3675      */
3676     @PublicKey
3677     @NonNull
3678     @SyntheticKey
3679     public static final Key<android.hardware.camera2.params.MultiResolutionStreamConfigurationMap> SCALER_MULTI_RESOLUTION_STREAM_CONFIGURATION_MAP =
3680             new Key<android.hardware.camera2.params.MultiResolutionStreamConfigurationMap>("android.scaler.multiResolutionStreamConfigurationMap", android.hardware.camera2.params.MultiResolutionStreamConfigurationMap.class);
3681 
3682     /**
3683      * <p>The available stream configurations that this
3684      * camera device supports (i.e. format, width, height, output/input stream) for a
3685      * CaptureRequest with {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} set to
3686      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
3687      * <p>Analogous to android.scaler.availableStreamConfigurations, for configurations
3688      * which are applicable when {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
3689      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
3690      * <p>Not all output formats may be supported in a configuration with
3691      * an input stream of a particular format. For more details, see
3692      * android.scaler.availableInputOutputFormatsMapMaximumResolution.</p>
3693      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3694      *
3695      * @see CaptureRequest#SENSOR_PIXEL_MODE
3696      * @hide
3697      */
3698     public static final Key<android.hardware.camera2.params.StreamConfiguration[]> SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION =
3699             new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.scaler.availableStreamConfigurationsMaximumResolution", android.hardware.camera2.params.StreamConfiguration[].class);
3700 
3701     /**
3702      * <p>This lists the minimum frame duration for each
3703      * format/size combination when the camera device is sent a CaptureRequest with
3704      * {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} set to
3705      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
3706      * <p>Analogous to android.scaler.availableMinFrameDurations, for configurations
3707      * which are applicable when {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
3708      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
3709      * <p>When multiple streams are used in a request (if supported, when {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode}
3710      * is set to
3711      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }), the
3712      * minimum frame duration will be max(individual stream min durations).</p>
3713      * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
3714      * android.scaler.availableStallDurationsMaximumResolution for more details about
3715      * calculating the max frame rate.</p>
3716      * <p><b>Units</b>: (format, width, height, ns) x n</p>
3717      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3718      *
3719      * @see CaptureRequest#SENSOR_FRAME_DURATION
3720      * @see CaptureRequest#SENSOR_PIXEL_MODE
3721      * @hide
3722      */
3723     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> SCALER_AVAILABLE_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION =
3724             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.scaler.availableMinFrameDurationsMaximumResolution", android.hardware.camera2.params.StreamConfigurationDuration[].class);
3725 
3726     /**
3727      * <p>This lists the maximum stall duration for each
3728      * output format/size combination when CaptureRequests are submitted with
3729      * {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} set to
3730      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }</p>
3731      * <p>Analogous to android.scaler.availableMinFrameDurations, for configurations
3732      * which are applicable when {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
3733      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
3734      * <p><b>Units</b>: (format, width, height, ns) x n</p>
3735      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3736      *
3737      * @see CaptureRequest#SENSOR_PIXEL_MODE
3738      * @hide
3739      */
3740     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> SCALER_AVAILABLE_STALL_DURATIONS_MAXIMUM_RESOLUTION =
3741             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.scaler.availableStallDurationsMaximumResolution", android.hardware.camera2.params.StreamConfigurationDuration[].class);
3742 
3743     /**
3744      * <p>The available stream configurations that this
3745      * camera device supports when given a CaptureRequest with {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode}
3746      * set to
3747      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION };
3748      * also includes the minimum frame durations
3749      * and the stall durations for each format/size combination.</p>
3750      * <p>Analogous to {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} for CaptureRequests where
3751      * {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is
3752      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
3753      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3754      *
3755      * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
3756      * @see CaptureRequest#SENSOR_PIXEL_MODE
3757      */
3758     @PublicKey
3759     @NonNull
3760     @SyntheticKey
3761     public static final Key<android.hardware.camera2.params.StreamConfigurationMap> SCALER_STREAM_CONFIGURATION_MAP_MAXIMUM_RESOLUTION =
3762             new Key<android.hardware.camera2.params.StreamConfigurationMap>("android.scaler.streamConfigurationMapMaximumResolution", android.hardware.camera2.params.StreamConfigurationMap.class);
3763 
3764     /**
3765      * <p>The mapping of image formats that are supported by this
3766      * camera device for input streams, to their corresponding output formats, when
3767      * {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
3768      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
3769      * <p>Analogous to android.scaler.availableInputOutputFormatsMap for CaptureRequests where
3770      * {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is
3771      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
3772      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3773      *
3774      * @see CaptureRequest#SENSOR_PIXEL_MODE
3775      * @hide
3776      */
3777     public static final Key<android.hardware.camera2.params.ReprocessFormatsMap> SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP_MAXIMUM_RESOLUTION =
3778             new Key<android.hardware.camera2.params.ReprocessFormatsMap>("android.scaler.availableInputOutputFormatsMapMaximumResolution", android.hardware.camera2.params.ReprocessFormatsMap.class);
3779 
3780     /**
3781      * <p>An array of mandatory stream combinations which are applicable when
3782      * {@link android.hardware.camera2.CaptureRequest } has {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} set
3783      * to {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.
3784      * This is an app-readable conversion of the maximum resolution mandatory stream combination
3785      * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraDevice#additional-guaranteed-combinations-for-ultra-high-resolution-sensors">tables</a>.</p>
3786      * <p>The array of
3787      * {@link android.hardware.camera2.params.MandatoryStreamCombination combinations} is
3788      * generated according to the documented
3789      * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraDevice#additional-guaranteed-combinations-for-ultra-high-resolution-sensors">guideline</a>
3790      * for each device which has the
3791      * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR }
3792      * capability.
3793      * Clients can use the array as a quick reference to find an appropriate camera stream
3794      * combination.
3795      * The mandatory stream combination array will be {@code null} in case the device is not an
3796      * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR }
3797      * device.</p>
3798      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3799      *
3800      * @see CaptureRequest#SENSOR_PIXEL_MODE
3801      */
3802     @PublicKey
3803     @NonNull
3804     @SyntheticKey
3805     public static final Key<android.hardware.camera2.params.MandatoryStreamCombination[]> SCALER_MANDATORY_MAXIMUM_RESOLUTION_STREAM_COMBINATIONS =
3806             new Key<android.hardware.camera2.params.MandatoryStreamCombination[]>("android.scaler.mandatoryMaximumResolutionStreamCombinations", android.hardware.camera2.params.MandatoryStreamCombination[].class);
3807 
3808     /**
3809      * <p>An array of mandatory stream combinations which are applicable when device support the
3810      * 10-bit output capability
3811      * {@link android.hardware.camera2.CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT }
3812      * This is an app-readable conversion of the 10 bit output mandatory stream combination
3813      * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraDevice#10-bit-output-additional-guaranteed-configurations">tables</a>.</p>
3814      * <p>The array of
3815      * {@link android.hardware.camera2.params.MandatoryStreamCombination combinations} is
3816      * generated according to the documented
3817      * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraDevice#10-bit-output-additional-guaranteed-configurations">guideline</a>
3818      * for each device which has the
3819      * {@link android.hardware.camera2.CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT }
3820      * capability.
3821      * Clients can use the array as a quick reference to find an appropriate camera stream
3822      * combination.
3823      * The mandatory stream combination array will be {@code null} in case the device is not an
3824      * {@link android.hardware.camera2.CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT }
3825      * device.</p>
3826      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3827      */
3828     @PublicKey
3829     @NonNull
3830     @SyntheticKey
3831     public static final Key<android.hardware.camera2.params.MandatoryStreamCombination[]> SCALER_MANDATORY_TEN_BIT_OUTPUT_STREAM_COMBINATIONS =
3832             new Key<android.hardware.camera2.params.MandatoryStreamCombination[]>("android.scaler.mandatoryTenBitOutputStreamCombinations", android.hardware.camera2.params.MandatoryStreamCombination[].class);
3833 
3834     /**
3835      * <p>An array of mandatory stream combinations which are applicable when device lists
3836      * {@code PREVIEW_STABILIZATION} in {@link CameraCharacteristics#CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES android.control.availableVideoStabilizationModes}.
3837      * This is an app-readable conversion of the preview stabilization mandatory stream
3838      * combination
3839      * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraDevice#preview-stabilization-guaranteed-stream-configurations">tables</a>.</p>
3840      * <p>The array of
3841      * {@link android.hardware.camera2.params.MandatoryStreamCombination combinations} is
3842      * generated according to the documented
3843      * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraDevice#preview-stabilization-guaranteed-stream-configurations">guideline</a>
3844      * for each device which supports {@code PREVIEW_STABILIZATION}
3845      * Clients can use the array as a quick reference to find an appropriate camera stream
3846      * combination.
3847      * The mandatory stream combination array will be {@code null} in case the device does not
3848      * list {@code PREVIEW_STABILIZATION} in {@link CameraCharacteristics#CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES android.control.availableVideoStabilizationModes}.</p>
3849      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3850      *
3851      * @see CameraCharacteristics#CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES
3852      */
3853     @PublicKey
3854     @NonNull
3855     @SyntheticKey
3856     public static final Key<android.hardware.camera2.params.MandatoryStreamCombination[]> SCALER_MANDATORY_PREVIEW_STABILIZATION_OUTPUT_STREAM_COMBINATIONS =
3857             new Key<android.hardware.camera2.params.MandatoryStreamCombination[]>("android.scaler.mandatoryPreviewStabilizationOutputStreamCombinations", android.hardware.camera2.params.MandatoryStreamCombination[].class);
3858 
3859     /**
3860      * <p>Whether the camera device supports multi-resolution input or output streams</p>
3861      * <p>A logical multi-camera or an ultra high resolution camera may support multi-resolution
3862      * input or output streams. With multi-resolution output streams, the camera device is able
3863      * to output different resolution images depending on the current active physical camera or
3864      * pixel mode. With multi-resolution input streams, the camera device can reprocess images
3865      * of different resolutions from different physical cameras or sensor pixel modes.</p>
3866      * <p>When set to TRUE:</p>
3867      * <ul>
3868      * <li>For a logical multi-camera, the camera framework derives
3869      * {@link CameraCharacteristics#SCALER_MULTI_RESOLUTION_STREAM_CONFIGURATION_MAP android.scaler.multiResolutionStreamConfigurationMap} by combining the
3870      * android.scaler.physicalCameraMultiResolutionStreamConfigurations from its physical
3871      * cameras.</li>
3872      * <li>For an ultra-high resolution sensor camera, the camera framework directly copies
3873      * the value of android.scaler.physicalCameraMultiResolutionStreamConfigurations to
3874      * {@link CameraCharacteristics#SCALER_MULTI_RESOLUTION_STREAM_CONFIGURATION_MAP android.scaler.multiResolutionStreamConfigurationMap}.</li>
3875      * </ul>
3876      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3877      * <p><b>Limited capability</b> -
3878      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3879      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3880      *
3881      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3882      * @see CameraCharacteristics#SCALER_MULTI_RESOLUTION_STREAM_CONFIGURATION_MAP
3883      * @hide
3884      */
3885     public static final Key<Boolean> SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED =
3886             new Key<Boolean>("android.scaler.multiResolutionStreamSupported", boolean.class);
3887 
3888     /**
3889      * <p>The stream use cases supported by this camera device.</p>
3890      * <p>The stream use case indicates the purpose of a particular camera stream from
3891      * the end-user perspective. Some examples of camera use cases are: preview stream for
3892      * live viewfinder shown to the user, still capture for generating high quality photo
3893      * capture, video record for encoding the camera output for the purpose of future playback,
3894      * and video call for live realtime video conferencing.</p>
3895      * <p>With this flag, the camera device can optimize the image processing pipeline
3896      * parameters, such as tuning, sensor mode, and ISP settings, independent of
3897      * the properties of the immediate camera output surface. For example, if the output
3898      * surface is a SurfaceTexture, the stream use case flag can be used to indicate whether
3899      * the camera frames eventually go to display, video encoder,
3900      * still image capture, or all of them combined.</p>
3901      * <p>The application sets the use case of a camera stream by calling
3902      * {@link android.hardware.camera2.params.OutputConfiguration#setStreamUseCase }.</p>
3903      * <p>A camera device with
3904      * {@link android.hardware.camera2.CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE }
3905      * capability must support the following stream use cases:</p>
3906      * <ul>
3907      * <li>DEFAULT</li>
3908      * <li>PREVIEW</li>
3909      * <li>STILL_CAPTURE</li>
3910      * <li>VIDEO_RECORD</li>
3911      * <li>PREVIEW_VIDEO_STILL</li>
3912      * <li>VIDEO_CALL</li>
3913      * </ul>
3914      * <p>The guaranteed stream combinations related to stream use case for a camera device with
3915      * {@link android.hardware.camera2.CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE }
3916      * capability is documented in the camera device
3917      * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraDevice#stream-use-case-capability-additional-guaranteed-configurations">guideline</a>.
3918      * The application is strongly recommended to use one of the guaranteed stream combinations.
3919      * If the application creates a session with a stream combination not in the guaranteed
3920      * list, or with mixed DEFAULT and non-DEFAULT use cases within the same session,
3921      * the camera device may ignore some stream use cases due to hardware constraints
3922      * and implementation details.</p>
3923      * <p>For stream combinations not covered by the stream use case mandatory lists, such as
3924      * reprocessable session, constrained high speed session, or RAW stream combinations, the
3925      * application should leave stream use cases within the session as DEFAULT.</p>
3926      * <p><b>Possible values:</b></p>
3927      * <ul>
3928      *   <li>{@link #SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT DEFAULT}</li>
3929      *   <li>{@link #SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW PREVIEW}</li>
3930      *   <li>{@link #SCALER_AVAILABLE_STREAM_USE_CASES_STILL_CAPTURE STILL_CAPTURE}</li>
3931      *   <li>{@link #SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_RECORD VIDEO_RECORD}</li>
3932      *   <li>{@link #SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW_VIDEO_STILL PREVIEW_VIDEO_STILL}</li>
3933      *   <li>{@link #SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL VIDEO_CALL}</li>
3934      *   <li>{@link #SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW CROPPED_RAW}</li>
3935      * </ul>
3936      *
3937      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3938      * @see #SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT
3939      * @see #SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW
3940      * @see #SCALER_AVAILABLE_STREAM_USE_CASES_STILL_CAPTURE
3941      * @see #SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_RECORD
3942      * @see #SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW_VIDEO_STILL
3943      * @see #SCALER_AVAILABLE_STREAM_USE_CASES_VIDEO_CALL
3944      * @see #SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW
3945      */
3946     @PublicKey
3947     @NonNull
3948     public static final Key<long[]> SCALER_AVAILABLE_STREAM_USE_CASES =
3949             new Key<long[]>("android.scaler.availableStreamUseCases", long[].class);
3950 
3951     /**
3952      * <p>An array of mandatory stream combinations with stream use cases.
3953      * This is an app-readable conversion of the mandatory stream combination
3954      * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraDevice#stream-use-case-capability-additional-guaranteed-configurations">tables</a>
3955      * with each stream's use case being set.</p>
3956      * <p>The array of
3957      * {@link android.hardware.camera2.params.MandatoryStreamCombination combinations} is
3958      * generated according to the documented
3959      * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraDevice#stream-use-case-capability-additional-guaranteed-configurations">guildeline</a>
3960      * for a camera device with
3961      * {@link android.hardware.camera2.CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE }
3962      * capability.
3963      * The mandatory stream combination array will be {@code null} in case the device doesn't
3964      * have {@link android.hardware.camera2.CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE }
3965      * capability.</p>
3966      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
3967      */
3968     @PublicKey
3969     @NonNull
3970     @SyntheticKey
3971     public static final Key<android.hardware.camera2.params.MandatoryStreamCombination[]> SCALER_MANDATORY_USE_CASE_STREAM_COMBINATIONS =
3972             new Key<android.hardware.camera2.params.MandatoryStreamCombination[]>("android.scaler.mandatoryUseCaseStreamCombinations", android.hardware.camera2.params.MandatoryStreamCombination[].class);
3973 
3974     /**
3975      * <p>The area of the image sensor which corresponds to active pixels after any geometric
3976      * distortion correction has been applied.</p>
3977      * <p>This is the rectangle representing the size of the active region of the sensor (i.e.
3978      * the region that actually receives light from the scene) after any geometric correction
3979      * has been applied, and should be treated as the maximum size in pixels of any of the
3980      * image output formats aside from the raw formats.</p>
3981      * <p>This rectangle is defined relative to the full pixel array; (0,0) is the top-left of
3982      * the full pixel array, and the size of the full pixel array is given by
3983      * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
3984      * <p>The coordinate system for most other keys that list pixel coordinates, including
3985      * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, is defined relative to the active array rectangle given in
3986      * this field, with <code>(0, 0)</code> being the top-left of this rectangle.</p>
3987      * <p>The active array may be smaller than the full pixel array, since the full array may
3988      * include black calibration pixels or other inactive regions.</p>
3989      * <p>For devices that do not support {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the active
3990      * array must be the same as {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.</p>
3991      * <p>For devices that support {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the active array must
3992      * be enclosed by {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}. The difference between
3993      * pre-correction active array and active array accounts for scaling or cropping caused
3994      * by lens geometric distortion correction.</p>
3995      * <p>In general, application should always refer to active array size for controls like
3996      * metering regions or crop region. Two exceptions are when the application is dealing with
3997      * RAW image buffers (RAW_SENSOR, RAW10, RAW12 etc), or when application explicitly set
3998      * {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} to OFF. In these cases, application should refer
3999      * to {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.</p>
4000      * <p><b>Units</b>: Pixel coordinates on the image sensor</p>
4001      * <p>This key is available on all devices.</p>
4002      *
4003      * @see CaptureRequest#DISTORTION_CORRECTION_MODE
4004      * @see CaptureRequest#SCALER_CROP_REGION
4005      * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
4006      * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
4007      */
4008     @PublicKey
4009     @NonNull
4010     public static final Key<android.graphics.Rect> SENSOR_INFO_ACTIVE_ARRAY_SIZE =
4011             new Key<android.graphics.Rect>("android.sensor.info.activeArraySize", android.graphics.Rect.class);
4012 
4013     /**
4014      * <p>Range of sensitivities for {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} supported by this
4015      * camera device.</p>
4016      * <p>The values are the standard ISO sensitivity values,
4017      * as defined in ISO 12232:2006.</p>
4018      * <p><b>Range of valid values:</b><br>
4019      * Min &lt;= 100, Max &gt;= 800</p>
4020      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4021      * <p><b>Full capability</b> -
4022      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4023      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
4024      *
4025      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
4026      * @see CaptureRequest#SENSOR_SENSITIVITY
4027      */
4028     @PublicKey
4029     @NonNull
4030     public static final Key<android.util.Range<Integer>> SENSOR_INFO_SENSITIVITY_RANGE =
4031             new Key<android.util.Range<Integer>>("android.sensor.info.sensitivityRange", new TypeReference<android.util.Range<Integer>>() {{ }});
4032 
4033     /**
4034      * <p>The arrangement of color filters on sensor;
4035      * represents the colors in the top-left 2x2 section of
4036      * the sensor, in reading order, for a Bayer camera, or the
4037      * light spectrum it captures for MONOCHROME camera.</p>
4038      * <p><b>Possible values:</b></p>
4039      * <ul>
4040      *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB RGGB}</li>
4041      *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG GRBG}</li>
4042      *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG GBRG}</li>
4043      *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR BGGR}</li>
4044      *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB RGB}</li>
4045      *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_MONO MONO}</li>
4046      *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_NIR NIR}</li>
4047      * </ul>
4048      *
4049      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4050      * <p><b>Full capability</b> -
4051      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4052      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
4053      *
4054      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
4055      * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB
4056      * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG
4057      * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG
4058      * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR
4059      * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB
4060      * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_MONO
4061      * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_NIR
4062      */
4063     @PublicKey
4064     @NonNull
4065     public static final Key<Integer> SENSOR_INFO_COLOR_FILTER_ARRANGEMENT =
4066             new Key<Integer>("android.sensor.info.colorFilterArrangement", int.class);
4067 
4068     /**
4069      * <p>The range of image exposure times for {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} supported
4070      * by this camera device.</p>
4071      * <p><b>Units</b>: Nanoseconds</p>
4072      * <p><b>Range of valid values:</b><br>
4073      * The minimum exposure time will be less than 100 us. For FULL
4074      * capability devices ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL),
4075      * the maximum exposure time will be greater than 100ms.</p>
4076      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4077      * <p><b>Full capability</b> -
4078      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4079      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
4080      *
4081      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
4082      * @see CaptureRequest#SENSOR_EXPOSURE_TIME
4083      */
4084     @PublicKey
4085     @NonNull
4086     public static final Key<android.util.Range<Long>> SENSOR_INFO_EXPOSURE_TIME_RANGE =
4087             new Key<android.util.Range<Long>>("android.sensor.info.exposureTimeRange", new TypeReference<android.util.Range<Long>>() {{ }});
4088 
4089     /**
4090      * <p>The maximum possible frame duration (minimum frame rate) for
4091      * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} that is supported this camera device.</p>
4092      * <p>Attempting to use frame durations beyond the maximum will result in the frame
4093      * duration being clipped to the maximum. See that control for a full definition of frame
4094      * durations.</p>
4095      * <p>Refer to {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }
4096      * for the minimum frame duration values.</p>
4097      * <p><b>Units</b>: Nanoseconds</p>
4098      * <p><b>Range of valid values:</b><br>
4099      * For FULL capability devices
4100      * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL), at least 100ms.</p>
4101      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4102      * <p><b>Full capability</b> -
4103      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4104      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
4105      *
4106      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
4107      * @see CaptureRequest#SENSOR_FRAME_DURATION
4108      */
4109     @PublicKey
4110     @NonNull
4111     public static final Key<Long> SENSOR_INFO_MAX_FRAME_DURATION =
4112             new Key<Long>("android.sensor.info.maxFrameDuration", long.class);
4113 
4114     /**
4115      * <p>The physical dimensions of the full pixel
4116      * array.</p>
4117      * <p>This is the physical size of the sensor pixel
4118      * array defined by {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
4119      * <p><b>Units</b>: Millimeters</p>
4120      * <p>This key is available on all devices.</p>
4121      *
4122      * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
4123      */
4124     @PublicKey
4125     @NonNull
4126     public static final Key<android.util.SizeF> SENSOR_INFO_PHYSICAL_SIZE =
4127             new Key<android.util.SizeF>("android.sensor.info.physicalSize", android.util.SizeF.class);
4128 
4129     /**
4130      * <p>Dimensions of the full pixel array, possibly
4131      * including black calibration pixels.</p>
4132      * <p>The pixel count of the full pixel array of the image sensor, which covers
4133      * {@link CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE android.sensor.info.physicalSize} area.  This represents the full pixel dimensions of
4134      * the raw buffers produced by this sensor.</p>
4135      * <p>If a camera device supports raw sensor formats, either this or
4136      * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} is the maximum dimensions for the raw
4137      * output formats listed in {@link android.hardware.camera2.params.StreamConfigurationMap }
4138      * (this depends on whether or not the image sensor returns buffers containing pixels that
4139      * are not part of the active array region for blacklevel calibration or other purposes).</p>
4140      * <p>Some parts of the full pixel array may not receive light from the scene,
4141      * or be otherwise inactive.  The {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} key
4142      * defines the rectangle of active pixels that will be included in processed image
4143      * formats.</p>
4144      * <p><b>Units</b>: Pixels</p>
4145      * <p>This key is available on all devices.</p>
4146      *
4147      * @see CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE
4148      * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
4149      */
4150     @PublicKey
4151     @NonNull
4152     public static final Key<android.util.Size> SENSOR_INFO_PIXEL_ARRAY_SIZE =
4153             new Key<android.util.Size>("android.sensor.info.pixelArraySize", android.util.Size.class);
4154 
4155     /**
4156      * <p>Maximum raw value output by sensor.</p>
4157      * <p>This specifies the fully-saturated encoding level for the raw
4158      * sample values from the sensor.  This is typically caused by the
4159      * sensor becoming highly non-linear or clipping. The minimum for
4160      * each channel is specified by the offset in the
4161      * {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} key.</p>
4162      * <p>The white level is typically determined either by sensor bit depth
4163      * (8-14 bits is expected), or by the point where the sensor response
4164      * becomes too non-linear to be useful.  The default value for this is
4165      * maximum representable value for a 16-bit raw sample (2^16 - 1).</p>
4166      * <p>The white level values of captured images may vary for different
4167      * capture settings (e.g., {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}). This key
4168      * represents a coarse approximation for such case. It is recommended
4169      * to use {@link CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL android.sensor.dynamicWhiteLevel} for captures when supported
4170      * by the camera device, which provides more accurate white level values.</p>
4171      * <p><b>Range of valid values:</b><br>
4172      * &gt; 255 (8-bit output)</p>
4173      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4174      *
4175      * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
4176      * @see CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL
4177      * @see CaptureRequest#SENSOR_SENSITIVITY
4178      */
4179     @PublicKey
4180     @NonNull
4181     public static final Key<Integer> SENSOR_INFO_WHITE_LEVEL =
4182             new Key<Integer>("android.sensor.info.whiteLevel", int.class);
4183 
4184     /**
4185      * <p>The time base source for sensor capture start timestamps.</p>
4186      * <p>The timestamps provided for captures are always in nanoseconds and monotonic, but
4187      * may not based on a time source that can be compared to other system time sources.</p>
4188      * <p>This characteristic defines the source for the timestamps, and therefore whether they
4189      * can be compared against other system time sources/timestamps.</p>
4190      * <p><b>Possible values:</b></p>
4191      * <ul>
4192      *   <li>{@link #SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN UNKNOWN}</li>
4193      *   <li>{@link #SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME REALTIME}</li>
4194      * </ul>
4195      *
4196      * <p>This key is available on all devices.</p>
4197      * @see #SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN
4198      * @see #SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME
4199      */
4200     @PublicKey
4201     @NonNull
4202     public static final Key<Integer> SENSOR_INFO_TIMESTAMP_SOURCE =
4203             new Key<Integer>("android.sensor.info.timestampSource", int.class);
4204 
4205     /**
4206      * <p>Whether the RAW images output from this camera device are subject to
4207      * lens shading correction.</p>
4208      * <p>If <code>true</code>, all images produced by the camera device in the <code>RAW</code> image formats will have
4209      * at least some lens shading correction already applied to it. If <code>false</code>, the images will
4210      * not be adjusted for lens shading correction.  See {@link CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW android.request.maxNumOutputRaw} for a
4211      * list of RAW image formats.</p>
4212      * <p>When <code>true</code>, the <code>lensShadingCorrectionMap</code> key may still have values greater than 1.0,
4213      * and those will need to be applied to any captured RAW frames for them to match the shading
4214      * correction of processed buffers such as <code>YUV</code> or <code>JPEG</code> images. This may occur, for
4215      * example, when some basic fixed lens shading correction is applied by hardware to RAW data,
4216      * and additional correction is done dynamically in the camera processing pipeline after
4217      * demosaicing.</p>
4218      * <p>This key will be <code>null</code> for all devices do not report this information.
4219      * Devices with RAW capability will always report this information in this key.</p>
4220      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4221      *
4222      * @see CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW
4223      */
4224     @PublicKey
4225     @NonNull
4226     public static final Key<Boolean> SENSOR_INFO_LENS_SHADING_APPLIED =
4227             new Key<Boolean>("android.sensor.info.lensShadingApplied", boolean.class);
4228 
4229     /**
4230      * <p>The area of the image sensor which corresponds to active pixels prior to the
4231      * application of any geometric distortion correction.</p>
4232      * <p>This is the rectangle representing the size of the active region of the sensor (i.e.
4233      * the region that actually receives light from the scene) before any geometric correction
4234      * has been applied, and should be treated as the active region rectangle for any of the
4235      * raw formats.  All metadata associated with raw processing (e.g. the lens shading
4236      * correction map, and radial distortion fields) treats the top, left of this rectangle as
4237      * the origin, (0,0).</p>
4238      * <p>The size of this region determines the maximum field of view and the maximum number of
4239      * pixels that an image from this sensor can contain, prior to the application of
4240      * geometric distortion correction. The effective maximum pixel dimensions of a
4241      * post-distortion-corrected image is given by the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}
4242      * field, and the effective maximum field of view for a post-distortion-corrected image
4243      * can be calculated by applying the geometric distortion correction fields to this
4244      * rectangle, and cropping to the rectangle given in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
4245      * <p>E.g. to calculate position of a pixel, (x,y), in a processed YUV output image with the
4246      * dimensions in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} given the position of a pixel,
4247      * (x', y'), in the raw pixel array with dimensions given in
4248      * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}:</p>
4249      * <ol>
4250      * <li>Choose a pixel (x', y') within the active array region of the raw buffer given in
4251      * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, otherwise this pixel is considered
4252      * to be outside of the FOV, and will not be shown in the processed output image.</li>
4253      * <li>Apply geometric distortion correction to get the post-distortion pixel coordinate,
4254      * (x_i, y_i). When applying geometric correction metadata, note that metadata for raw
4255      * buffers is defined relative to the top, left of the
4256      * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} rectangle.</li>
4257      * <li>If the resulting corrected pixel coordinate is within the region given in
4258      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, then the position of this pixel in the
4259      * processed output image buffer is <code>(x_i - activeArray.left, y_i - activeArray.top)</code>,
4260      * when the top, left coordinate of that buffer is treated as (0, 0).</li>
4261      * </ol>
4262      * <p>Thus, for pixel x',y' = (25, 25) on a sensor where {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}
4263      * is (100,100), {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} is (10, 10, 100, 100),
4264      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} is (20, 20, 80, 80), and the geometric distortion
4265      * correction doesn't change the pixel coordinate, the resulting pixel selected in
4266      * pixel coordinates would be x,y = (25, 25) relative to the top,left of the raw buffer
4267      * with dimensions given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}, and would be (5, 5)
4268      * relative to the top,left of post-processed YUV output buffer with dimensions given in
4269      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
4270      * <p>The currently supported fields that correct for geometric distortion are:</p>
4271      * <ol>
4272      * <li>{@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion}.</li>
4273      * </ol>
4274      * <p>If the camera device doesn't support geometric distortion correction, or all of the
4275      * geometric distortion fields are no-ops, this rectangle will be the same as the
4276      * post-distortion-corrected rectangle given in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
4277      * <p>This rectangle is defined relative to the full pixel array; (0,0) is the top-left of
4278      * the full pixel array, and the size of the full pixel array is given by
4279      * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
4280      * <p>The pre-correction active array may be smaller than the full pixel array, since the
4281      * full array may include black calibration pixels or other inactive regions.</p>
4282      * <p><b>Units</b>: Pixel coordinates on the image sensor</p>
4283      * <p>This key is available on all devices.</p>
4284      *
4285      * @see CameraCharacteristics#LENS_DISTORTION
4286      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
4287      * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
4288      * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
4289      */
4290     @PublicKey
4291     @NonNull
4292     public static final Key<android.graphics.Rect> SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE =
4293             new Key<android.graphics.Rect>("android.sensor.info.preCorrectionActiveArraySize", android.graphics.Rect.class);
4294 
4295     /**
4296      * <p>The area of the image sensor which corresponds to active pixels after any geometric
4297      * distortion correction has been applied, when the sensor runs in maximum resolution mode.</p>
4298      * <p>Analogous to {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, when {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode}
4299      * is set to
4300      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.
4301      * Refer to {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} for details, with sensor array related keys
4302      * replaced with their
4303      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }
4304      * counterparts.
4305      * This key will only be present for devices which advertise the
4306      * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR }
4307      * capability or devices where {@link CameraCharacteristics#getAvailableCaptureRequestKeys }
4308      * lists {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode}.</p>
4309      * <p><b>Units</b>: Pixel coordinates on the image sensor</p>
4310      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4311      *
4312      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
4313      * @see CaptureRequest#SENSOR_PIXEL_MODE
4314      */
4315     @PublicKey
4316     @NonNull
4317     public static final Key<android.graphics.Rect> SENSOR_INFO_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION =
4318             new Key<android.graphics.Rect>("android.sensor.info.activeArraySizeMaximumResolution", android.graphics.Rect.class);
4319 
4320     /**
4321      * <p>Dimensions of the full pixel array, possibly
4322      * including black calibration pixels, when the sensor runs in maximum resolution mode.
4323      * Analogous to {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}, when {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is
4324      * set to
4325      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
4326      * <p>The pixel count of the full pixel array of the image sensor, which covers
4327      * {@link CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE android.sensor.info.physicalSize} area. This represents the full pixel dimensions of
4328      * the raw buffers produced by this sensor, when it runs in maximum resolution mode. That
4329      * is, when {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
4330      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.
4331      * This key will only be present for devices which advertise the
4332      * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR }
4333      * capability or devices where {@link CameraCharacteristics#getAvailableCaptureRequestKeys }
4334      * lists {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode}.</p>
4335      * <p><b>Units</b>: Pixels</p>
4336      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4337      *
4338      * @see CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE
4339      * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
4340      * @see CaptureRequest#SENSOR_PIXEL_MODE
4341      */
4342     @PublicKey
4343     @NonNull
4344     public static final Key<android.util.Size> SENSOR_INFO_PIXEL_ARRAY_SIZE_MAXIMUM_RESOLUTION =
4345             new Key<android.util.Size>("android.sensor.info.pixelArraySizeMaximumResolution", android.util.Size.class);
4346 
4347     /**
4348      * <p>The area of the image sensor which corresponds to active pixels prior to the
4349      * application of any geometric distortion correction, when the sensor runs in maximum
4350      * resolution mode. This key must be used for crop / metering regions, only when
4351      * {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
4352      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
4353      * <p>Analogous to {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize},
4354      * when {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
4355      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.
4356      * This key will only be present for devices which advertise the
4357      * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR }
4358      * capability or devices where {@link CameraCharacteristics#getAvailableCaptureRequestKeys }
4359      * lists {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode}.</p>
4360      * <p><b>Units</b>: Pixel coordinates on the image sensor</p>
4361      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4362      *
4363      * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
4364      * @see CaptureRequest#SENSOR_PIXEL_MODE
4365      */
4366     @PublicKey
4367     @NonNull
4368     public static final Key<android.graphics.Rect> SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION =
4369             new Key<android.graphics.Rect>("android.sensor.info.preCorrectionActiveArraySizeMaximumResolution", android.graphics.Rect.class);
4370 
4371     /**
4372      * <p>Dimensions of the group of pixels which are under the same color filter.
4373      * This specifies the width and height (pair of integers) of the group of pixels which fall
4374      * under the same color filter for ULTRA_HIGH_RESOLUTION sensors.</p>
4375      * <p>Sensors can have pixels grouped together under the same color filter in order
4376      * to improve various aspects of imaging such as noise reduction, low light
4377      * performance etc. These groups can be of various sizes such as 2X2 (quad bayer),
4378      * 3X3 (nona-bayer). This key specifies the length and width of the pixels grouped under
4379      * the same color filter.
4380      * In case the device has the
4381      * {@link CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR }
4382      * capability :</p>
4383      * <ul>
4384      * <li>This key will not be present if REMOSAIC_REPROCESSING is not supported, since RAW
4385      *   images will have a regular bayer pattern.</li>
4386      * </ul>
4387      * <p>In case the device does not have the
4388      * {@link CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR }
4389      * capability :</p>
4390      * <ul>
4391      * <li>This key will be present if
4392      *   {@link CameraCharacteristics#getAvailableCaptureRequestKeys }
4393      *   lists {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode}, since RAW
4394      *   images may not necessarily have a regular bayer pattern when
4395      *   {@link CaptureRequest#SENSOR_PIXEL_MODE {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode}} is set to
4396      *   {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</li>
4397      * </ul>
4398      * <p><b>Units</b>: Pixels</p>
4399      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4400      *
4401      * @see CaptureRequest#SENSOR_PIXEL_MODE
4402      */
4403     @PublicKey
4404     @NonNull
4405     public static final Key<android.util.Size> SENSOR_INFO_BINNING_FACTOR =
4406             new Key<android.util.Size>("android.sensor.info.binningFactor", android.util.Size.class);
4407 
4408     /**
4409      * <p>The standard reference illuminant used as the scene light source when
4410      * calculating the {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM1 android.sensor.colorTransform1},
4411      * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1 android.sensor.calibrationTransform1}, and
4412      * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX1 android.sensor.forwardMatrix1} matrices.</p>
4413      * <p>The values in this key correspond to the values defined for the
4414      * EXIF LightSource tag. These illuminants are standard light sources
4415      * that are often used calibrating camera devices.</p>
4416      * <p>If this key is present, then {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM1 android.sensor.colorTransform1},
4417      * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1 android.sensor.calibrationTransform1}, and
4418      * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX1 android.sensor.forwardMatrix1} will also be present.</p>
4419      * <p>Some devices may choose to provide a second set of calibration
4420      * information for improved quality, including
4421      * {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2} and its corresponding matrices.</p>
4422      * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
4423      * the camera device has RAW capability.</p>
4424      * <p><b>Possible values:</b></p>
4425      * <ul>
4426      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT DAYLIGHT}</li>
4427      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT FLUORESCENT}</li>
4428      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN TUNGSTEN}</li>
4429      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FLASH FLASH}</li>
4430      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER FINE_WEATHER}</li>
4431      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER CLOUDY_WEATHER}</li>
4432      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_SHADE SHADE}</li>
4433      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT DAYLIGHT_FLUORESCENT}</li>
4434      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT DAY_WHITE_FLUORESCENT}</li>
4435      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT COOL_WHITE_FLUORESCENT}</li>
4436      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT WHITE_FLUORESCENT}</li>
4437      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A STANDARD_A}</li>
4438      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B STANDARD_B}</li>
4439      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C STANDARD_C}</li>
4440      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D55 D55}</li>
4441      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D65 D65}</li>
4442      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D75 D75}</li>
4443      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D50 D50}</li>
4444      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN ISO_STUDIO_TUNGSTEN}</li>
4445      * </ul>
4446      *
4447      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4448      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
4449      *
4450      * @see CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1
4451      * @see CameraCharacteristics#SENSOR_COLOR_TRANSFORM1
4452      * @see CameraCharacteristics#SENSOR_FORWARD_MATRIX1
4453      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
4454      * @see #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT
4455      * @see #SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT
4456      * @see #SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN
4457      * @see #SENSOR_REFERENCE_ILLUMINANT1_FLASH
4458      * @see #SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER
4459      * @see #SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER
4460      * @see #SENSOR_REFERENCE_ILLUMINANT1_SHADE
4461      * @see #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT
4462      * @see #SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT
4463      * @see #SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT
4464      * @see #SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT
4465      * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A
4466      * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B
4467      * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C
4468      * @see #SENSOR_REFERENCE_ILLUMINANT1_D55
4469      * @see #SENSOR_REFERENCE_ILLUMINANT1_D65
4470      * @see #SENSOR_REFERENCE_ILLUMINANT1_D75
4471      * @see #SENSOR_REFERENCE_ILLUMINANT1_D50
4472      * @see #SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN
4473      */
4474     @PublicKey
4475     @NonNull
4476     public static final Key<Integer> SENSOR_REFERENCE_ILLUMINANT1 =
4477             new Key<Integer>("android.sensor.referenceIlluminant1", int.class);
4478 
4479     /**
4480      * <p>The standard reference illuminant used as the scene light source when
4481      * calculating the {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM2 android.sensor.colorTransform2},
4482      * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2 android.sensor.calibrationTransform2}, and
4483      * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX2 android.sensor.forwardMatrix2} matrices.</p>
4484      * <p>See {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1} for more details.</p>
4485      * <p>If this key is present, then {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM2 android.sensor.colorTransform2},
4486      * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2 android.sensor.calibrationTransform2}, and
4487      * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX2 android.sensor.forwardMatrix2} will also be present.</p>
4488      * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
4489      * the camera device has RAW capability.</p>
4490      * <p><b>Range of valid values:</b><br>
4491      * Any value listed in {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}</p>
4492      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4493      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
4494      *
4495      * @see CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2
4496      * @see CameraCharacteristics#SENSOR_COLOR_TRANSFORM2
4497      * @see CameraCharacteristics#SENSOR_FORWARD_MATRIX2
4498      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
4499      */
4500     @PublicKey
4501     @NonNull
4502     public static final Key<Byte> SENSOR_REFERENCE_ILLUMINANT2 =
4503             new Key<Byte>("android.sensor.referenceIlluminant2", byte.class);
4504 
4505     /**
4506      * <p>A per-device calibration transform matrix that maps from the
4507      * reference sensor colorspace to the actual device sensor colorspace.</p>
4508      * <p>This matrix is used to correct for per-device variations in the
4509      * sensor colorspace, and is used for processing raw buffer data.</p>
4510      * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
4511      * contains a per-device calibration transform that maps colors
4512      * from reference sensor color space (i.e. the "golden module"
4513      * colorspace) into this camera device's native sensor color
4514      * space under the first reference illuminant
4515      * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}).</p>
4516      * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
4517      * the camera device has RAW capability.</p>
4518      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4519      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
4520      *
4521      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
4522      */
4523     @PublicKey
4524     @NonNull
4525     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_CALIBRATION_TRANSFORM1 =
4526             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.calibrationTransform1", android.hardware.camera2.params.ColorSpaceTransform.class);
4527 
4528     /**
4529      * <p>A per-device calibration transform matrix that maps from the
4530      * reference sensor colorspace to the actual device sensor colorspace
4531      * (this is the colorspace of the raw buffer data).</p>
4532      * <p>This matrix is used to correct for per-device variations in the
4533      * sensor colorspace, and is used for processing raw buffer data.</p>
4534      * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
4535      * contains a per-device calibration transform that maps colors
4536      * from reference sensor color space (i.e. the "golden module"
4537      * colorspace) into this camera device's native sensor color
4538      * space under the second reference illuminant
4539      * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2}).</p>
4540      * <p>This matrix will only be present if the second reference
4541      * illuminant is present.</p>
4542      * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
4543      * the camera device has RAW capability.</p>
4544      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4545      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
4546      *
4547      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
4548      */
4549     @PublicKey
4550     @NonNull
4551     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_CALIBRATION_TRANSFORM2 =
4552             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.calibrationTransform2", android.hardware.camera2.params.ColorSpaceTransform.class);
4553 
4554     /**
4555      * <p>A matrix that transforms color values from CIE XYZ color space to
4556      * reference sensor color space.</p>
4557      * <p>This matrix is used to convert from the standard CIE XYZ color
4558      * space to the reference sensor colorspace, and is used when processing
4559      * raw buffer data.</p>
4560      * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
4561      * contains a color transform matrix that maps colors from the CIE
4562      * XYZ color space to the reference sensor color space (i.e. the
4563      * "golden module" colorspace) under the first reference illuminant
4564      * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}).</p>
4565      * <p>The white points chosen in both the reference sensor color space
4566      * and the CIE XYZ colorspace when calculating this transform will
4567      * match the standard white point for the first reference illuminant
4568      * (i.e. no chromatic adaptation will be applied by this transform).</p>
4569      * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
4570      * the camera device has RAW capability.</p>
4571      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4572      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
4573      *
4574      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
4575      */
4576     @PublicKey
4577     @NonNull
4578     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_COLOR_TRANSFORM1 =
4579             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.colorTransform1", android.hardware.camera2.params.ColorSpaceTransform.class);
4580 
4581     /**
4582      * <p>A matrix that transforms color values from CIE XYZ color space to
4583      * reference sensor color space.</p>
4584      * <p>This matrix is used to convert from the standard CIE XYZ color
4585      * space to the reference sensor colorspace, and is used when processing
4586      * raw buffer data.</p>
4587      * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
4588      * contains a color transform matrix that maps colors from the CIE
4589      * XYZ color space to the reference sensor color space (i.e. the
4590      * "golden module" colorspace) under the second reference illuminant
4591      * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2}).</p>
4592      * <p>The white points chosen in both the reference sensor color space
4593      * and the CIE XYZ colorspace when calculating this transform will
4594      * match the standard white point for the second reference illuminant
4595      * (i.e. no chromatic adaptation will be applied by this transform).</p>
4596      * <p>This matrix will only be present if the second reference
4597      * illuminant is present.</p>
4598      * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
4599      * the camera device has RAW capability.</p>
4600      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4601      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
4602      *
4603      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
4604      */
4605     @PublicKey
4606     @NonNull
4607     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_COLOR_TRANSFORM2 =
4608             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.colorTransform2", android.hardware.camera2.params.ColorSpaceTransform.class);
4609 
4610     /**
4611      * <p>A matrix that transforms white balanced camera colors from the reference
4612      * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.</p>
4613      * <p>This matrix is used to convert to the standard CIE XYZ colorspace, and
4614      * is used when processing raw buffer data.</p>
4615      * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and contains
4616      * a color transform matrix that maps white balanced colors from the
4617      * reference sensor color space to the CIE XYZ color space with a D50 white
4618      * point.</p>
4619      * <p>Under the first reference illuminant ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1})
4620      * this matrix is chosen so that the standard white point for this reference
4621      * illuminant in the reference sensor colorspace is mapped to D50 in the
4622      * CIE XYZ colorspace.</p>
4623      * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
4624      * the camera device has RAW capability.</p>
4625      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4626      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
4627      *
4628      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
4629      */
4630     @PublicKey
4631     @NonNull
4632     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_FORWARD_MATRIX1 =
4633             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.forwardMatrix1", android.hardware.camera2.params.ColorSpaceTransform.class);
4634 
4635     /**
4636      * <p>A matrix that transforms white balanced camera colors from the reference
4637      * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.</p>
4638      * <p>This matrix is used to convert to the standard CIE XYZ colorspace, and
4639      * is used when processing raw buffer data.</p>
4640      * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and contains
4641      * a color transform matrix that maps white balanced colors from the
4642      * reference sensor color space to the CIE XYZ color space with a D50 white
4643      * point.</p>
4644      * <p>Under the second reference illuminant ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2})
4645      * this matrix is chosen so that the standard white point for this reference
4646      * illuminant in the reference sensor colorspace is mapped to D50 in the
4647      * CIE XYZ colorspace.</p>
4648      * <p>This matrix will only be present if the second reference
4649      * illuminant is present.</p>
4650      * <p>Starting from Android Q, this key will not be present for a MONOCHROME camera, even if
4651      * the camera device has RAW capability.</p>
4652      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4653      * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p>
4654      *
4655      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
4656      */
4657     @PublicKey
4658     @NonNull
4659     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_FORWARD_MATRIX2 =
4660             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.forwardMatrix2", android.hardware.camera2.params.ColorSpaceTransform.class);
4661 
4662     /**
4663      * <p>A fixed black level offset for each of the color filter arrangement
4664      * (CFA) mosaic channels.</p>
4665      * <p>This key specifies the zero light value for each of the CFA mosaic
4666      * channels in the camera sensor.  The maximal value output by the
4667      * sensor is represented by the value in {@link CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL android.sensor.info.whiteLevel}.</p>
4668      * <p>The values are given in the same order as channels listed for the CFA
4669      * layout key (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}), i.e. the
4670      * nth value given corresponds to the black level offset for the nth
4671      * color channel listed in the CFA.</p>
4672      * <p>The black level values of captured images may vary for different
4673      * capture settings (e.g., {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}). This key
4674      * represents a coarse approximation for such case. It is recommended to
4675      * use {@link CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL android.sensor.dynamicBlackLevel} or use pixels from
4676      * {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} directly for captures when
4677      * supported by the camera device, which provides more accurate black
4678      * level values. For raw capture in particular, it is recommended to use
4679      * pixels from {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} to calculate black
4680      * level values for each frame.</p>
4681      * <p>For a MONOCHROME camera device, all of the 2x2 channels must have the same values.</p>
4682      * <p><b>Range of valid values:</b><br>
4683      * &gt;= 0 for each.</p>
4684      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4685      *
4686      * @see CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL
4687      * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
4688      * @see CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL
4689      * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS
4690      * @see CaptureRequest#SENSOR_SENSITIVITY
4691      */
4692     @PublicKey
4693     @NonNull
4694     public static final Key<android.hardware.camera2.params.BlackLevelPattern> SENSOR_BLACK_LEVEL_PATTERN =
4695             new Key<android.hardware.camera2.params.BlackLevelPattern>("android.sensor.blackLevelPattern", android.hardware.camera2.params.BlackLevelPattern.class);
4696 
4697     /**
4698      * <p>Maximum sensitivity that is implemented
4699      * purely through analog gain.</p>
4700      * <p>For {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} values less than or
4701      * equal to this, all applied gain must be analog. For
4702      * values above this, the gain applied can be a mix of analog and
4703      * digital.</p>
4704      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4705      * <p><b>Full capability</b> -
4706      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4707      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
4708      *
4709      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
4710      * @see CaptureRequest#SENSOR_SENSITIVITY
4711      */
4712     @PublicKey
4713     @NonNull
4714     public static final Key<Integer> SENSOR_MAX_ANALOG_SENSITIVITY =
4715             new Key<Integer>("android.sensor.maxAnalogSensitivity", int.class);
4716 
4717     /**
4718      * <p>Clockwise angle through which the output image needs to be rotated to be
4719      * upright on the device screen in its native orientation.</p>
4720      * <p>Also defines the direction of rolling shutter readout, which is from top to bottom in
4721      * the sensor's coordinate system.</p>
4722      * <p>Starting with Android API level 32, camera clients that query the orientation via
4723      * {@link android.hardware.camera2.CameraCharacteristics#get } on foldable devices which
4724      * include logical cameras can receive a value that can dynamically change depending on the
4725      * device/fold state.
4726      * Clients are advised to not cache or store the orientation value of such logical sensors.
4727      * In case repeated queries to CameraCharacteristics are not preferred, then clients can
4728      * also access the entire mapping from device state to sensor orientation in
4729      * {@link android.hardware.camera2.params.DeviceStateSensorOrientationMap }.
4730      * Do note that a dynamically changing sensor orientation value in camera characteristics
4731      * will not be the best way to establish the orientation per frame. Clients that want to
4732      * know the sensor orientation of a particular captured frame should query the
4733      * {@link CaptureResult#LOGICAL_MULTI_CAMERA_ACTIVE_PHYSICAL_ID android.logicalMultiCamera.activePhysicalId} from the corresponding capture result and
4734      * check the respective physical camera orientation.</p>
4735      * <p><b>Units</b>: Degrees of clockwise rotation; always a multiple of
4736      * 90</p>
4737      * <p><b>Range of valid values:</b><br>
4738      * 0, 90, 180, 270</p>
4739      * <p>This key is available on all devices.</p>
4740      *
4741      * @see CaptureResult#LOGICAL_MULTI_CAMERA_ACTIVE_PHYSICAL_ID
4742      */
4743     @PublicKey
4744     @NonNull
4745     public static final Key<Integer> SENSOR_ORIENTATION =
4746             new Key<Integer>("android.sensor.orientation", int.class);
4747 
4748     /**
4749      * <p>List of sensor test pattern modes for {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode}
4750      * supported by this camera device.</p>
4751      * <p>Defaults to OFF, and always includes OFF if defined.</p>
4752      * <p><b>Range of valid values:</b><br>
4753      * Any value listed in {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode}</p>
4754      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4755      *
4756      * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
4757      */
4758     @PublicKey
4759     @NonNull
4760     public static final Key<int[]> SENSOR_AVAILABLE_TEST_PATTERN_MODES =
4761             new Key<int[]>("android.sensor.availableTestPatternModes", int[].class);
4762 
4763     /**
4764      * <p>List of disjoint rectangles indicating the sensor
4765      * optically shielded black pixel regions.</p>
4766      * <p>In most camera sensors, the active array is surrounded by some
4767      * optically shielded pixel areas. By blocking light, these pixels
4768      * provides a reliable black reference for black level compensation
4769      * in active array region.</p>
4770      * <p>This key provides a list of disjoint rectangles specifying the
4771      * regions of optically shielded (with metal shield) black pixel
4772      * regions if the camera device is capable of reading out these black
4773      * pixels in the output raw images. In comparison to the fixed black
4774      * level values reported by {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern}, this key
4775      * may provide a more accurate way for the application to calculate
4776      * black level of each captured raw images.</p>
4777      * <p>When this key is reported, the {@link CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL android.sensor.dynamicBlackLevel} and
4778      * {@link CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL android.sensor.dynamicWhiteLevel} will also be reported.</p>
4779      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4780      *
4781      * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
4782      * @see CaptureResult#SENSOR_DYNAMIC_BLACK_LEVEL
4783      * @see CaptureResult#SENSOR_DYNAMIC_WHITE_LEVEL
4784      */
4785     @PublicKey
4786     @NonNull
4787     public static final Key<android.graphics.Rect[]> SENSOR_OPTICAL_BLACK_REGIONS =
4788             new Key<android.graphics.Rect[]>("android.sensor.opticalBlackRegions", android.graphics.Rect[].class);
4789 
4790     /**
4791      * <p>Whether or not the camera device supports readout timestamp and
4792      * {@code onReadoutStarted} callback.</p>
4793      * <p>If this tag is {@code HARDWARE}, the camera device calls
4794      * {@link CameraCaptureSession.CaptureCallback#onReadoutStarted } in addition to the
4795      * {@link CameraCaptureSession.CaptureCallback#onCaptureStarted } callback for each capture.
4796      * The timestamp passed into the callback is the start of camera image readout rather than
4797      * the start of the exposure. The timestamp source of
4798      * {@link CameraCaptureSession.CaptureCallback#onReadoutStarted } is the same as that of
4799      * {@link CameraCaptureSession.CaptureCallback#onCaptureStarted }.</p>
4800      * <p>In addition, the application can switch an output surface's timestamp from start of
4801      * exposure to start of readout by calling
4802      * {@link android.hardware.camera2.params.OutputConfiguration#setReadoutTimestampEnabled }.</p>
4803      * <p>The readout timestamp is beneficial for video recording, because the encoder favors
4804      * uniform timestamps, and the readout timestamps better reflect the cadence camera sensors
4805      * output data.</p>
4806      * <p>Note that the camera device produces the start-of-exposure and start-of-readout callbacks
4807      * together. As a result, the {@link CameraCaptureSession.CaptureCallback#onReadoutStarted }
4808      * is called right after {@link CameraCaptureSession.CaptureCallback#onCaptureStarted }. The
4809      * difference in start-of-readout and start-of-exposure is the sensor exposure time, plus
4810      * certain constant offset. The offset is usually due to camera sensor level crop, and it is
4811      * generally constant over time for the same set of output resolutions and capture settings.</p>
4812      * <p><b>Possible values:</b></p>
4813      * <ul>
4814      *   <li>{@link #SENSOR_READOUT_TIMESTAMP_NOT_SUPPORTED NOT_SUPPORTED}</li>
4815      *   <li>{@link #SENSOR_READOUT_TIMESTAMP_HARDWARE HARDWARE}</li>
4816      * </ul>
4817      *
4818      * <p>This key is available on all devices.</p>
4819      * @see #SENSOR_READOUT_TIMESTAMP_NOT_SUPPORTED
4820      * @see #SENSOR_READOUT_TIMESTAMP_HARDWARE
4821      */
4822     @PublicKey
4823     @NonNull
4824     public static final Key<Integer> SENSOR_READOUT_TIMESTAMP =
4825             new Key<Integer>("android.sensor.readoutTimestamp", int.class);
4826 
4827     /**
4828      * <p>List of lens shading modes for {@link CaptureRequest#SHADING_MODE android.shading.mode} that are supported by this camera device.</p>
4829      * <p>This list contains lens shading modes that can be set for the camera device.
4830      * Camera devices that support the MANUAL_POST_PROCESSING capability will always
4831      * list OFF and FAST mode. This includes all FULL level devices.
4832      * LEGACY devices will always only support FAST mode.</p>
4833      * <p><b>Range of valid values:</b><br>
4834      * Any value listed in {@link CaptureRequest#SHADING_MODE android.shading.mode}</p>
4835      * <p>This key is available on all devices.</p>
4836      *
4837      * @see CaptureRequest#SHADING_MODE
4838      */
4839     @PublicKey
4840     @NonNull
4841     public static final Key<int[]> SHADING_AVAILABLE_MODES =
4842             new Key<int[]>("android.shading.availableModes", int[].class);
4843 
4844     /**
4845      * <p>List of face detection modes for {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} that are
4846      * supported by this camera device.</p>
4847      * <p>OFF is always supported.</p>
4848      * <p><b>Range of valid values:</b><br>
4849      * Any value listed in {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode}</p>
4850      * <p>This key is available on all devices.</p>
4851      *
4852      * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
4853      */
4854     @PublicKey
4855     @NonNull
4856     public static final Key<int[]> STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES =
4857             new Key<int[]>("android.statistics.info.availableFaceDetectModes", int[].class);
4858 
4859     /**
4860      * <p>The maximum number of simultaneously detectable
4861      * faces.</p>
4862      * <p><b>Range of valid values:</b><br>
4863      * 0 for cameras without available face detection; otherwise:
4864      * <code>&gt;=4</code> for LIMITED or FULL hwlevel devices or
4865      * <code>&gt;0</code> for LEGACY devices.</p>
4866      * <p>This key is available on all devices.</p>
4867      */
4868     @PublicKey
4869     @NonNull
4870     public static final Key<Integer> STATISTICS_INFO_MAX_FACE_COUNT =
4871             new Key<Integer>("android.statistics.info.maxFaceCount", int.class);
4872 
4873     /**
4874      * <p>List of hot pixel map output modes for {@link CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE android.statistics.hotPixelMapMode} that are
4875      * supported by this camera device.</p>
4876      * <p>If no hotpixel map output is available for this camera device, this will contain only
4877      * <code>false</code>.</p>
4878      * <p>ON is always supported on devices with the RAW capability.</p>
4879      * <p><b>Range of valid values:</b><br>
4880      * Any value listed in {@link CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE android.statistics.hotPixelMapMode}</p>
4881      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4882      *
4883      * @see CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE
4884      */
4885     @PublicKey
4886     @NonNull
4887     public static final Key<boolean[]> STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES =
4888             new Key<boolean[]>("android.statistics.info.availableHotPixelMapModes", boolean[].class);
4889 
4890     /**
4891      * <p>List of lens shading map output modes for {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} that
4892      * are supported by this camera device.</p>
4893      * <p>If no lens shading map output is available for this camera device, this key will
4894      * contain only OFF.</p>
4895      * <p>ON is always supported on devices with the RAW capability.
4896      * LEGACY mode devices will always only support OFF.</p>
4897      * <p><b>Range of valid values:</b><br>
4898      * Any value listed in {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode}</p>
4899      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4900      *
4901      * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
4902      */
4903     @PublicKey
4904     @NonNull
4905     public static final Key<int[]> STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES =
4906             new Key<int[]>("android.statistics.info.availableLensShadingMapModes", int[].class);
4907 
4908     /**
4909      * <p>List of OIS data output modes for {@link CaptureRequest#STATISTICS_OIS_DATA_MODE android.statistics.oisDataMode} that
4910      * are supported by this camera device.</p>
4911      * <p>If no OIS data output is available for this camera device, this key will
4912      * contain only OFF.</p>
4913      * <p><b>Range of valid values:</b><br>
4914      * Any value listed in {@link CaptureRequest#STATISTICS_OIS_DATA_MODE android.statistics.oisDataMode}</p>
4915      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4916      *
4917      * @see CaptureRequest#STATISTICS_OIS_DATA_MODE
4918      */
4919     @PublicKey
4920     @NonNull
4921     public static final Key<int[]> STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES =
4922             new Key<int[]>("android.statistics.info.availableOisDataModes", int[].class);
4923 
4924     /**
4925      * <p>Maximum number of supported points in the
4926      * tonemap curve that can be used for {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.</p>
4927      * <p>If the actual number of points provided by the application (in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}*) is
4928      * less than this maximum, the camera device will resample the curve to its internal
4929      * representation, using linear interpolation.</p>
4930      * <p>The output curves in the result metadata may have a different number
4931      * of points than the input curves, and will represent the actual
4932      * hardware curves used as closely as possible when linearly interpolated.</p>
4933      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4934      * <p><b>Full capability</b> -
4935      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4936      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
4937      *
4938      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
4939      * @see CaptureRequest#TONEMAP_CURVE
4940      */
4941     @PublicKey
4942     @NonNull
4943     public static final Key<Integer> TONEMAP_MAX_CURVE_POINTS =
4944             new Key<Integer>("android.tonemap.maxCurvePoints", int.class);
4945 
4946     /**
4947      * <p>List of tonemapping modes for {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} that are supported by this camera
4948      * device.</p>
4949      * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always contain
4950      * at least one of below mode combinations:</p>
4951      * <ul>
4952      * <li>CONTRAST_CURVE, FAST and HIGH_QUALITY</li>
4953      * <li>GAMMA_VALUE, PRESET_CURVE, FAST and HIGH_QUALITY</li>
4954      * </ul>
4955      * <p>This includes all FULL level devices.</p>
4956      * <p><b>Range of valid values:</b><br>
4957      * Any value listed in {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}</p>
4958      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4959      * <p><b>Full capability</b> -
4960      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4961      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
4962      *
4963      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
4964      * @see CaptureRequest#TONEMAP_MODE
4965      */
4966     @PublicKey
4967     @NonNull
4968     public static final Key<int[]> TONEMAP_AVAILABLE_TONE_MAP_MODES =
4969             new Key<int[]>("android.tonemap.availableToneMapModes", int[].class);
4970 
4971     /**
4972      * <p>A list of camera LEDs that are available on this system.</p>
4973      * <p><b>Possible values:</b></p>
4974      * <ul>
4975      *   <li>{@link #LED_AVAILABLE_LEDS_TRANSMIT TRANSMIT}</li>
4976      * </ul>
4977      *
4978      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
4979      * @see #LED_AVAILABLE_LEDS_TRANSMIT
4980      * @hide
4981      */
4982     public static final Key<int[]> LED_AVAILABLE_LEDS =
4983             new Key<int[]>("android.led.availableLeds", int[].class);
4984 
4985     /**
4986      * <p>Generally classifies the overall set of the camera device functionality.</p>
4987      * <p>The supported hardware level is a high-level description of the camera device's
4988      * capabilities, summarizing several capabilities into one field.  Each level adds additional
4989      * features to the previous one, and is always a strict superset of the previous level.
4990      * The ordering is <code>LEGACY &lt; LIMITED &lt; FULL &lt; LEVEL_3</code>.</p>
4991      * <p>Starting from <code>LEVEL_3</code>, the level enumerations are guaranteed to be in increasing
4992      * numerical value as well. To check if a given device is at least at a given hardware level,
4993      * the following code snippet can be used:</p>
4994      * <pre><code>// Returns true if the device supports the required hardware level, or better.
4995      * boolean isHardwareLevelSupported(CameraCharacteristics c, int requiredLevel) {
4996      *     final int[] sortedHwLevels = {
4997      *         CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY,
4998      *         CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL,
4999      *         CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED,
5000      *         CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL,
5001      *         CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_3
5002      *     };
5003      *     int deviceLevel = c.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL);
5004      *     if (requiredLevel == deviceLevel) {
5005      *         return true;
5006      *     }
5007      *
5008      *     for (int sortedlevel : sortedHwLevels) {
5009      *         if (sortedlevel == requiredLevel) {
5010      *             return true;
5011      *         } else if (sortedlevel == deviceLevel) {
5012      *             return false;
5013      *         }
5014      *     }
5015      *     return false; // Should never reach here
5016      * }
5017      * </code></pre>
5018      * <p>At a high level, the levels are:</p>
5019      * <ul>
5020      * <li><code>LEGACY</code> devices operate in a backwards-compatibility mode for older
5021      *   Android devices, and have very limited capabilities.</li>
5022      * <li><code>LIMITED</code> devices represent the
5023      *   baseline feature set, and may also include additional capabilities that are
5024      *   subsets of <code>FULL</code>.</li>
5025      * <li><code>FULL</code> devices additionally support per-frame manual control of sensor, flash, lens and
5026      *   post-processing settings, and image capture at a high rate.</li>
5027      * <li><code>LEVEL_3</code> devices additionally support YUV reprocessing and RAW image capture, along
5028      *   with additional output stream configurations.</li>
5029      * <li><code>EXTERNAL</code> devices are similar to <code>LIMITED</code> devices with exceptions like some sensor or
5030      *   lens information not reported or less stable framerates.</li>
5031      * </ul>
5032      * <p>See the individual level enums for full descriptions of the supported capabilities.  The
5033      * {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} entry describes the device's capabilities at a
5034      * finer-grain level, if needed. In addition, many controls have their available settings or
5035      * ranges defined in individual entries from {@link android.hardware.camera2.CameraCharacteristics }.</p>
5036      * <p>Some features are not part of any particular hardware level or capability and must be
5037      * queried separately. These include:</p>
5038      * <ul>
5039      * <li>Calibrated timestamps ({@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME)</li>
5040      * <li>Precision lens control ({@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} <code>==</code> CALIBRATED)</li>
5041      * <li>Face detection ({@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes})</li>
5042      * <li>Optical or electrical image stabilization
5043      *   ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization},
5044      *    {@link CameraCharacteristics#CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES android.control.availableVideoStabilizationModes})</li>
5045      * </ul>
5046      * <p><b>Possible values:</b></p>
5047      * <ul>
5048      *   <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED}</li>
5049      *   <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL}</li>
5050      *   <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY LEGACY}</li>
5051      *   <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_3 3}</li>
5052      *   <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL EXTERNAL}</li>
5053      * </ul>
5054      *
5055      * <p>This key is available on all devices.</p>
5056      *
5057      * @see CameraCharacteristics#CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES
5058      * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
5059      * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
5060      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
5061      * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
5062      * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
5063      * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED
5064      * @see #INFO_SUPPORTED_HARDWARE_LEVEL_FULL
5065      * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY
5066      * @see #INFO_SUPPORTED_HARDWARE_LEVEL_3
5067      * @see #INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL
5068      */
5069     @PublicKey
5070     @NonNull
5071     public static final Key<Integer> INFO_SUPPORTED_HARDWARE_LEVEL =
5072             new Key<Integer>("android.info.supportedHardwareLevel", int.class);
5073 
5074     /**
5075      * <p>A short string for manufacturer version information about the camera device, such as
5076      * ISP hardware, sensors, etc.</p>
5077      * <p>This can be used in {@link android.media.ExifInterface#TAG_IMAGE_DESCRIPTION TAG_IMAGE_DESCRIPTION}
5078      * in jpeg EXIF. This key may be absent if no version information is available on the
5079      * device.</p>
5080      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5081      */
5082     @PublicKey
5083     @NonNull
5084     public static final Key<String> INFO_VERSION =
5085             new Key<String>("android.info.version", String.class);
5086 
5087     /**
5088      * <p>This lists the mapping between a device folding state and
5089      * specific camera sensor orientation for logical cameras on a foldable device.</p>
5090      * <p>Logical cameras on foldable devices can support sensors with different orientation
5091      * values. The orientation value may need to change depending on the specific folding
5092      * state. Information about the mapping between the device folding state and the
5093      * sensor orientation can be obtained in
5094      * {@link android.hardware.camera2.params.DeviceStateSensorOrientationMap }.
5095      * Device state orientation maps are optional and maybe present on devices that support
5096      * {@link CaptureRequest#SCALER_ROTATE_AND_CROP android.scaler.rotateAndCrop}.</p>
5097      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5098      * <p><b>Limited capability</b> -
5099      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
5100      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
5101      *
5102      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
5103      * @see CaptureRequest#SCALER_ROTATE_AND_CROP
5104      */
5105     @PublicKey
5106     @NonNull
5107     @SyntheticKey
5108     public static final Key<android.hardware.camera2.params.DeviceStateSensorOrientationMap> INFO_DEVICE_STATE_SENSOR_ORIENTATION_MAP =
5109             new Key<android.hardware.camera2.params.DeviceStateSensorOrientationMap>("android.info.deviceStateSensorOrientationMap", android.hardware.camera2.params.DeviceStateSensorOrientationMap.class);
5110 
5111     /**
5112      * <p>HAL must populate the array with
5113      * (hardware::camera::provider::V2_5::DeviceState, sensorOrientation) pairs for each
5114      * supported device state bitwise combination.</p>
5115      * <p><b>Units</b>: (device fold state, sensor orientation) x n</p>
5116      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5117      * <p><b>Limited capability</b> -
5118      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
5119      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
5120      *
5121      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
5122      * @hide
5123      */
5124     public static final Key<long[]> INFO_DEVICE_STATE_ORIENTATIONS =
5125             new Key<long[]>("android.info.deviceStateOrientations", long[].class);
5126 
5127     /**
5128      * <p>The version of the session configuration query
5129      * {@link android.hardware.camera2.CameraDevice.CameraDeviceSetup#isSessionConfigurationSupported }
5130      * and {@link android.hardware.camera2.CameraDevice.CameraDeviceSetup#getSessionCharacteristics }
5131      * APIs.</p>
5132      * <p>The possible values in this key correspond to the values defined in
5133      * android.os.Build.VERSION_CODES. Each version defines a set of feature combinations the
5134      * camera device must reliably report whether they are supported via
5135      * {@link android.hardware.camera2.CameraDevice.CameraDeviceSetup#isSessionConfigurationSupported }.
5136      * It also defines the set of session specific keys in CameraCharacteristics when returned from
5137      * {@link android.hardware.camera2.CameraDevice.CameraDeviceSetup#getSessionCharacteristics }.
5138      * The version is always less or equal to android.os.Build.VERSION.SDK_INT.</p>
5139      * <p>If set to UPSIDE_DOWN_CAKE, this camera device doesn't support the
5140      * {@link android.hardware.camera2.CameraDevice.CameraDeviceSetup } API.
5141      * Trying to create a CameraDeviceSetup instance throws an UnsupportedOperationException.</p>
5142      * <p>From VANILLA_ICE_CREAM onwards, the camera compliance tests verify a set of
5143      * commonly used SessionConfigurations to ensure that the outputs of
5144      * {@link android.hardware.camera2.CameraDevice.CameraDeviceSetup#isSessionConfigurationSupported }
5145      * and {@link android.hardware.camera2.CameraDevice.CameraDeviceSetup#getSessionCharacteristics }
5146      * are accurate. The application is encouraged to use these SessionConfigurations when turning on
5147      * multiple features at the same time.</p>
5148      * <p>When set to VANILLA_ICE_CREAM, the combinations of the following configurations are verified
5149      * by the compliance tests:</p>
5150      * <ul>
5151      * <li>
5152      * <p>A set of commonly used stream combinations:</p>
5153      * <table>
5154      * <thead>
5155      * <tr>
5156      * <th style="text-align: center;">Target 1</th>
5157      * <th style="text-align: center;">Size</th>
5158      * <th style="text-align: center;">Target 2</th>
5159      * <th style="text-align: center;">Size</th>
5160      * </tr>
5161      * </thead>
5162      * <tbody>
5163      * <tr>
5164      * <td style="text-align: center;">PRIV</td>
5165      * <td style="text-align: center;">S1080P</td>
5166      * <td style="text-align: center;"></td>
5167      * <td style="text-align: center;"></td>
5168      * </tr>
5169      * <tr>
5170      * <td style="text-align: center;">PRIV</td>
5171      * <td style="text-align: center;">S720P</td>
5172      * <td style="text-align: center;"></td>
5173      * <td style="text-align: center;"></td>
5174      * </tr>
5175      * <tr>
5176      * <td style="text-align: center;">PRIV</td>
5177      * <td style="text-align: center;">S1080P</td>
5178      * <td style="text-align: center;">JPEG/JPEG_R</td>
5179      * <td style="text-align: center;">MAXIMUM_16_9</td>
5180      * </tr>
5181      * <tr>
5182      * <td style="text-align: center;">PRIV</td>
5183      * <td style="text-align: center;">S1080P</td>
5184      * <td style="text-align: center;">JPEG/JPEG_R</td>
5185      * <td style="text-align: center;">UHD</td>
5186      * </tr>
5187      * <tr>
5188      * <td style="text-align: center;">PRIV</td>
5189      * <td style="text-align: center;">S1080P</td>
5190      * <td style="text-align: center;">JPEG/JPEG_R</td>
5191      * <td style="text-align: center;">S1440P</td>
5192      * </tr>
5193      * <tr>
5194      * <td style="text-align: center;">PRIV</td>
5195      * <td style="text-align: center;">S1080P</td>
5196      * <td style="text-align: center;">JPEG/JPEG_R</td>
5197      * <td style="text-align: center;">S1080P</td>
5198      * </tr>
5199      * <tr>
5200      * <td style="text-align: center;">PRIV</td>
5201      * <td style="text-align: center;">S720P</td>
5202      * <td style="text-align: center;">JPEG/JPEG_R</td>
5203      * <td style="text-align: center;">MAXIMUM_16_9</td>
5204      * </tr>
5205      * <tr>
5206      * <td style="text-align: center;">PRIV</td>
5207      * <td style="text-align: center;">S720P</td>
5208      * <td style="text-align: center;">JPEG/JPEG_R</td>
5209      * <td style="text-align: center;">UHD</td>
5210      * </tr>
5211      * <tr>
5212      * <td style="text-align: center;">PRIV</td>
5213      * <td style="text-align: center;">S720P</td>
5214      * <td style="text-align: center;">JPEG/JPEG_R</td>
5215      * <td style="text-align: center;">S1080P</td>
5216      * </tr>
5217      * <tr>
5218      * <td style="text-align: center;">PRIV</td>
5219      * <td style="text-align: center;">XVGA</td>
5220      * <td style="text-align: center;">JPEG/JPEG_R</td>
5221      * <td style="text-align: center;">MAXIMUM_4_3</td>
5222      * </tr>
5223      * <tr>
5224      * <td style="text-align: center;">PRIV</td>
5225      * <td style="text-align: center;">S1080P_4_3</td>
5226      * <td style="text-align: center;">JPEG/JPEG_R</td>
5227      * <td style="text-align: center;">MAXIMUM_4_3</td>
5228      * </tr>
5229      * </tbody>
5230      * </table>
5231      * <ul>
5232      * <li>{@code MAXIMUM_4_3} refers to the camera device's maximum output resolution with
5233      *   4:3 aspect ratio for that format from {@code StreamConfigurationMap#getOutputSizes}.</li>
5234      * <li>{@code MAXIMUM_16_9} is the maximum output resolution with 16:9 aspect ratio.</li>
5235      * <li>{@code S1440P} refers to {@code 2560x1440 (16:9)}.</li>
5236      * <li>{@code S1080P} refers to {@code 1920x1080 (16:9)}.</li>
5237      * <li>{@code S720P} refers to {@code 1280x720 (16:9)}.</li>
5238      * <li>{@code UHD} refers to {@code 3840x2160 (16:9)}.</li>
5239      * <li>{@code XVGA} refers to {@code 1024x768 (4:3)}.</li>
5240      * <li>{@code S1080P_43} refers to {@code 1440x1080 (4:3)}.</li>
5241      * </ul>
5242      * </li>
5243      * <li>
5244      * <p>VIDEO_STABILIZATION_MODE: {OFF, PREVIEW}</p>
5245      * </li>
5246      * <li>
5247      * <p>AE_TARGET_FPS_RANGE: { {*, 30}, {*, 60} }</p>
5248      * </li>
5249      * <li>
5250      * <p>DYNAMIC_RANGE_PROFILE: {STANDARD, HLG10}</p>
5251      * </li>
5252      * </ul>
5253      * <p>When set to BAKLAVA, the additional stream combinations below are verified
5254      * by the compliance tests:</p>
5255      * <table>
5256      * <thead>
5257      * <tr>
5258      * <th style="text-align: center;">Target 1</th>
5259      * <th style="text-align: center;">Size</th>
5260      * <th style="text-align: center;">Target 2</th>
5261      * <th style="text-align: center;">Size</th>
5262      * <th style="text-align: center;">Target 3</th>
5263      * <th style="text-align: center;">Size</th>
5264      * </tr>
5265      * </thead>
5266      * <tbody>
5267      * <tr>
5268      * <td style="text-align: center;">PRIV Preview</td>
5269      * <td style="text-align: center;">S1080P</td>
5270      * <td style="text-align: center;">PRIV Video</td>
5271      * <td style="text-align: center;">S1080P</td>
5272      * <td style="text-align: center;"></td>
5273      * <td style="text-align: center;"></td>
5274      * </tr>
5275      * <tr>
5276      * <td style="text-align: center;">PRIV Preview</td>
5277      * <td style="text-align: center;">S1080P</td>
5278      * <td style="text-align: center;">PRIV Video</td>
5279      * <td style="text-align: center;">S1440P</td>
5280      * <td style="text-align: center;"></td>
5281      * <td style="text-align: center;"></td>
5282      * </tr>
5283      * <tr>
5284      * <td style="text-align: center;">PRIV Preview</td>
5285      * <td style="text-align: center;">S1080P</td>
5286      * <td style="text-align: center;">PRIV Video</td>
5287      * <td style="text-align: center;">UHD</td>
5288      * <td style="text-align: center;"></td>
5289      * <td style="text-align: center;"></td>
5290      * </tr>
5291      * <tr>
5292      * <td style="text-align: center;">PRIV Preview</td>
5293      * <td style="text-align: center;">S1080P</td>
5294      * <td style="text-align: center;">YUV Analysis</td>
5295      * <td style="text-align: center;">S1080P</td>
5296      * <td style="text-align: center;">PRIV Video</td>
5297      * <td style="text-align: center;">1080P</td>
5298      * </tr>
5299      * </tbody>
5300      * </table>
5301      * <ul>
5302      * <li>VIDEO_STABILIZATION_MODE: {OFF, ON} for the newly added stream combinations given the
5303      * presence of dedicated video stream</li>
5304      * </ul>
5305      * <p>All of the above configurations can be set up with a SessionConfiguration. The list of
5306      * OutputConfiguration contains the stream configurations and DYNAMIC_RANGE_PROFILE, and
5307      * the AE_TARGET_FPS_RANGE and VIDEO_STABILIZATION_MODE are set as session parameters.</p>
5308      * <p>This key is available on all devices.</p>
5309      */
5310     @PublicKey
5311     @NonNull
5312     public static final Key<Integer> INFO_SESSION_CONFIGURATION_QUERY_VERSION =
5313             new Key<Integer>("android.info.sessionConfigurationQueryVersion", int.class);
5314 
5315     /**
5316      * <p>Id of the device that owns this camera.</p>
5317      * <p>In case of a virtual camera, this would be the id of the virtual device
5318      * owning the camera. For any other camera, this key would not be present.
5319      * Callers should assume {@link android.content.Context#DEVICE_ID_DEFAULT }
5320      * in case this key is not present.</p>
5321      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5322      * @hide
5323      */
5324     public static final Key<Integer> INFO_DEVICE_ID =
5325             new Key<Integer>("android.info.deviceId", int.class);
5326 
5327     /**
5328      * <p>The maximum number of frames that can occur after a request
5329      * (different than the previous) has been submitted, and before the
5330      * result's state becomes synchronized.</p>
5331      * <p>This defines the maximum distance (in number of metadata results),
5332      * between the frame number of the request that has new controls to apply
5333      * and the frame number of the result that has all the controls applied.</p>
5334      * <p>In other words this acts as an upper boundary for how many frames
5335      * must occur before the camera device knows for a fact that the new
5336      * submitted camera settings have been applied in outgoing frames.</p>
5337      * <p><b>Units</b>: Frame counts</p>
5338      * <p><b>Possible values:</b></p>
5339      * <ul>
5340      *   <li>{@link #SYNC_MAX_LATENCY_PER_FRAME_CONTROL PER_FRAME_CONTROL}</li>
5341      *   <li>{@link #SYNC_MAX_LATENCY_UNKNOWN UNKNOWN}</li>
5342      * </ul>
5343      *
5344      * <p><b>Available values for this device:</b><br>
5345      * A positive value, PER_FRAME_CONTROL, or UNKNOWN.</p>
5346      * <p>This key is available on all devices.</p>
5347      * @see #SYNC_MAX_LATENCY_PER_FRAME_CONTROL
5348      * @see #SYNC_MAX_LATENCY_UNKNOWN
5349      */
5350     @PublicKey
5351     @NonNull
5352     public static final Key<Integer> SYNC_MAX_LATENCY =
5353             new Key<Integer>("android.sync.maxLatency", int.class);
5354 
5355     /**
5356      * <p>The maximal camera capture pipeline stall (in unit of frame count) introduced by a
5357      * reprocess capture request.</p>
5358      * <p>The key describes the maximal interference that one reprocess (input) request
5359      * can introduce to the camera simultaneous streaming of regular (output) capture
5360      * requests, including repeating requests.</p>
5361      * <p>When a reprocessing capture request is submitted while a camera output repeating request
5362      * (e.g. preview) is being served by the camera device, it may preempt the camera capture
5363      * pipeline for at least one frame duration so that the camera device is unable to process
5364      * the following capture request in time for the next sensor start of exposure boundary.
5365      * When this happens, the application may observe a capture time gap (longer than one frame
5366      * duration) between adjacent capture output frames, which usually exhibits as preview
5367      * glitch if the repeating request output targets include a preview surface. This key gives
5368      * the worst-case number of frame stall introduced by one reprocess request with any kind of
5369      * formats/sizes combination.</p>
5370      * <p>If this key reports 0, it means a reprocess request doesn't introduce any glitch to the
5371      * ongoing camera repeating request outputs, as if this reprocess request is never issued.</p>
5372      * <p>This key is supported if the camera device supports PRIVATE or YUV reprocessing (
5373      * i.e. {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains PRIVATE_REPROCESSING or
5374      * YUV_REPROCESSING).</p>
5375      * <p><b>Units</b>: Number of frames.</p>
5376      * <p><b>Range of valid values:</b><br>
5377      * &lt;= 4</p>
5378      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5379      * <p><b>Limited capability</b> -
5380      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
5381      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
5382      *
5383      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
5384      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
5385      */
5386     @PublicKey
5387     @NonNull
5388     public static final Key<Integer> REPROCESS_MAX_CAPTURE_STALL =
5389             new Key<Integer>("android.reprocess.maxCaptureStall", int.class);
5390 
5391     /**
5392      * <p>The available depth dataspace stream
5393      * configurations that this camera device supports
5394      * (i.e. format, width, height, output/input stream).</p>
5395      * <p>These are output stream configurations for use with
5396      * dataSpace HAL_DATASPACE_DEPTH. The configurations are
5397      * listed as <code>(format, width, height, input?)</code> tuples.</p>
5398      * <p>Only devices that support depth output for at least
5399      * the HAL_PIXEL_FORMAT_Y16 dense depth map may include
5400      * this entry.</p>
5401      * <p>A device that also supports the HAL_PIXEL_FORMAT_BLOB
5402      * sparse depth point cloud must report a single entry for
5403      * the format in this list as <code>(HAL_PIXEL_FORMAT_BLOB,
5404      * android.depth.maxDepthSamples, 1, OUTPUT)</code> in addition to
5405      * the entries for HAL_PIXEL_FORMAT_Y16.</p>
5406      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5407      * <p><b>Limited capability</b> -
5408      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
5409      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
5410      *
5411      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
5412      * @hide
5413      */
5414     public static final Key<android.hardware.camera2.params.StreamConfiguration[]> DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS =
5415             new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.depth.availableDepthStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
5416 
5417     /**
5418      * <p>This lists the minimum frame duration for each
5419      * format/size combination for depth output formats.</p>
5420      * <p>This should correspond to the frame duration when only that
5421      * stream is active, with all processing (typically in android.*.mode)
5422      * set to either OFF or FAST.</p>
5423      * <p>When multiple streams are used in a request, the minimum frame
5424      * duration will be max(individual stream min durations).</p>
5425      * <p>The minimum frame duration of a stream (of a particular format, size)
5426      * is the same regardless of whether the stream is input or output.</p>
5427      * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
5428      * android.scaler.availableStallDurations for more details about
5429      * calculating the max frame rate.</p>
5430      * <p><b>Units</b>: (format, width, height, ns) x n</p>
5431      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5432      * <p><b>Limited capability</b> -
5433      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
5434      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
5435      *
5436      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
5437      * @see CaptureRequest#SENSOR_FRAME_DURATION
5438      * @hide
5439      */
5440     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS =
5441             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDepthMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
5442 
5443     /**
5444      * <p>This lists the maximum stall duration for each
5445      * output format/size combination for depth streams.</p>
5446      * <p>A stall duration is how much extra time would get added
5447      * to the normal minimum frame duration for a repeating request
5448      * that has streams with non-zero stall.</p>
5449      * <p>This functions similarly to
5450      * android.scaler.availableStallDurations for depth
5451      * streams.</p>
5452      * <p>All depth output stream formats may have a nonzero stall
5453      * duration.</p>
5454      * <p><b>Units</b>: (format, width, height, ns) x n</p>
5455      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5456      * <p><b>Limited capability</b> -
5457      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
5458      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
5459      *
5460      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
5461      * @hide
5462      */
5463     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS =
5464             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDepthStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
5465 
5466     /**
5467      * <p>Indicates whether a capture request may target both a
5468      * DEPTH16 / DEPTH_POINT_CLOUD output, and normal color outputs (such as
5469      * YUV_420_888, JPEG, or RAW) simultaneously.</p>
5470      * <p>If TRUE, including both depth and color outputs in a single
5471      * capture request is not supported. An application must interleave color
5472      * and depth requests.  If FALSE, a single request can target both types
5473      * of output.</p>
5474      * <p>Typically, this restriction exists on camera devices that
5475      * need to emit a specific pattern or wavelength of light to
5476      * measure depth values, which causes the color image to be
5477      * corrupted during depth measurement.</p>
5478      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5479      * <p><b>Limited capability</b> -
5480      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
5481      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
5482      *
5483      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
5484      */
5485     @PublicKey
5486     @NonNull
5487     public static final Key<Boolean> DEPTH_DEPTH_IS_EXCLUSIVE =
5488             new Key<Boolean>("android.depth.depthIsExclusive", boolean.class);
5489 
5490     /**
5491      * <p>Recommended depth stream configurations for common client use cases.</p>
5492      * <p>Optional subset of the android.depth.availableDepthStreamConfigurations that
5493      * contains similar tuples listed as
5494      * (i.e. width, height, format, output/input stream, usecase bit field).
5495      * Camera devices will be able to suggest particular depth stream configurations which are
5496      * power and performance efficient for specific use cases. For more information about
5497      * retrieving the suggestions see
5498      * {@link android.hardware.camera2.CameraCharacteristics#getRecommendedStreamConfigurationMap }.</p>
5499      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5500      * @hide
5501      */
5502     public static final Key<android.hardware.camera2.params.RecommendedStreamConfiguration[]> DEPTH_AVAILABLE_RECOMMENDED_DEPTH_STREAM_CONFIGURATIONS =
5503             new Key<android.hardware.camera2.params.RecommendedStreamConfiguration[]>("android.depth.availableRecommendedDepthStreamConfigurations", android.hardware.camera2.params.RecommendedStreamConfiguration[].class);
5504 
5505     /**
5506      * <p>The available dynamic depth dataspace stream
5507      * configurations that this camera device supports
5508      * (i.e. format, width, height, output/input stream).</p>
5509      * <p>These are output stream configurations for use with
5510      * dataSpace DYNAMIC_DEPTH. The configurations are
5511      * listed as <code>(format, width, height, input?)</code> tuples.</p>
5512      * <p>Only devices that support depth output for at least
5513      * the HAL_PIXEL_FORMAT_Y16 dense depth map along with
5514      * HAL_PIXEL_FORMAT_BLOB with the same size or size with
5515      * the same aspect ratio can have dynamic depth dataspace
5516      * stream configuration. {@link CameraCharacteristics#DEPTH_DEPTH_IS_EXCLUSIVE android.depth.depthIsExclusive} also
5517      * needs to be set to FALSE.</p>
5518      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5519      *
5520      * @see CameraCharacteristics#DEPTH_DEPTH_IS_EXCLUSIVE
5521      * @hide
5522      */
5523     public static final Key<android.hardware.camera2.params.StreamConfiguration[]> DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS =
5524             new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.depth.availableDynamicDepthStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
5525 
5526     /**
5527      * <p>This lists the minimum frame duration for each
5528      * format/size combination for dynamic depth output streams.</p>
5529      * <p>This should correspond to the frame duration when only that
5530      * stream is active, with all processing (typically in android.*.mode)
5531      * set to either OFF or FAST.</p>
5532      * <p>When multiple streams are used in a request, the minimum frame
5533      * duration will be max(individual stream min durations).</p>
5534      * <p>The minimum frame duration of a stream (of a particular format, size)
5535      * is the same regardless of whether the stream is input or output.</p>
5536      * <p><b>Units</b>: (format, width, height, ns) x n</p>
5537      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5538      * @hide
5539      */
5540     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DYNAMIC_DEPTH_MIN_FRAME_DURATIONS =
5541             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDynamicDepthMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
5542 
5543     /**
5544      * <p>This lists the maximum stall duration for each
5545      * output format/size combination for dynamic depth streams.</p>
5546      * <p>A stall duration is how much extra time would get added
5547      * to the normal minimum frame duration for a repeating request
5548      * that has streams with non-zero stall.</p>
5549      * <p>All dynamic depth output streams may have a nonzero stall
5550      * duration.</p>
5551      * <p><b>Units</b>: (format, width, height, ns) x n</p>
5552      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5553      * @hide
5554      */
5555     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DYNAMIC_DEPTH_STALL_DURATIONS =
5556             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDynamicDepthStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
5557 
5558     /**
5559      * <p>The available depth dataspace stream
5560      * configurations that this camera device supports
5561      * (i.e. format, width, height, output/input stream) when a CaptureRequest is submitted with
5562      * {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} set to
5563      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
5564      * <p>Analogous to android.depth.availableDepthStreamConfigurations, for configurations which
5565      * are applicable when {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
5566      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
5567      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5568      *
5569      * @see CaptureRequest#SENSOR_PIXEL_MODE
5570      * @hide
5571      */
5572     public static final Key<android.hardware.camera2.params.StreamConfiguration[]> DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION =
5573             new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.depth.availableDepthStreamConfigurationsMaximumResolution", android.hardware.camera2.params.StreamConfiguration[].class);
5574 
5575     /**
5576      * <p>This lists the minimum frame duration for each
5577      * format/size combination for depth output formats when a CaptureRequest is submitted with
5578      * {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} set to
5579      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
5580      * <p>Analogous to android.depth.availableDepthMinFrameDurations, for configurations which
5581      * are applicable when {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
5582      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
5583      * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
5584      * android.scaler.availableStallDurationsMaximumResolution for more details about
5585      * calculating the max frame rate.</p>
5586      * <p><b>Units</b>: (format, width, height, ns) x n</p>
5587      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5588      *
5589      * @see CaptureRequest#SENSOR_FRAME_DURATION
5590      * @see CaptureRequest#SENSOR_PIXEL_MODE
5591      * @hide
5592      */
5593     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION =
5594             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDepthMinFrameDurationsMaximumResolution", android.hardware.camera2.params.StreamConfigurationDuration[].class);
5595 
5596     /**
5597      * <p>This lists the maximum stall duration for each
5598      * output format/size combination for depth streams for CaptureRequests where
5599      * {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
5600      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
5601      * <p>Analogous to android.depth.availableDepthStallDurations, for configurations which
5602      * are applicable when {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
5603      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
5604      * <p><b>Units</b>: (format, width, height, ns) x n</p>
5605      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5606      *
5607      * @see CaptureRequest#SENSOR_PIXEL_MODE
5608      * @hide
5609      */
5610     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS_MAXIMUM_RESOLUTION =
5611             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDepthStallDurationsMaximumResolution", android.hardware.camera2.params.StreamConfigurationDuration[].class);
5612 
5613     /**
5614      * <p>The available dynamic depth dataspace stream
5615      * configurations that this camera device supports (i.e. format, width, height,
5616      * output/input stream) for CaptureRequests where {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
5617      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
5618      * <p>Analogous to android.depth.availableDynamicDepthStreamConfigurations, for configurations
5619      * which are applicable when {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
5620      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
5621      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5622      *
5623      * @see CaptureRequest#SENSOR_PIXEL_MODE
5624      * @hide
5625      */
5626     public static final Key<android.hardware.camera2.params.StreamConfiguration[]> DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION =
5627             new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.depth.availableDynamicDepthStreamConfigurationsMaximumResolution", android.hardware.camera2.params.StreamConfiguration[].class);
5628 
5629     /**
5630      * <p>This lists the minimum frame duration for each
5631      * format/size combination for dynamic depth output streams  for CaptureRequests where
5632      * {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
5633      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
5634      * <p>Analogous to android.depth.availableDynamicDepthMinFrameDurations, for configurations
5635      * which are applicable when {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
5636      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
5637      * <p><b>Units</b>: (format, width, height, ns) x n</p>
5638      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5639      *
5640      * @see CaptureRequest#SENSOR_PIXEL_MODE
5641      * @hide
5642      */
5643     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DYNAMIC_DEPTH_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION =
5644             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDynamicDepthMinFrameDurationsMaximumResolution", android.hardware.camera2.params.StreamConfigurationDuration[].class);
5645 
5646     /**
5647      * <p>This lists the maximum stall duration for each
5648      * output format/size combination for dynamic depth streams for CaptureRequests where
5649      * {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
5650      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
5651      * <p>Analogous to android.depth.availableDynamicDepthStallDurations, for configurations
5652      * which are applicable when {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
5653      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
5654      * <p><b>Units</b>: (format, width, height, ns) x n</p>
5655      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5656      *
5657      * @see CaptureRequest#SENSOR_PIXEL_MODE
5658      * @hide
5659      */
5660     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DYNAMIC_DEPTH_STALL_DURATIONS_MAXIMUM_RESOLUTION =
5661             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDynamicDepthStallDurationsMaximumResolution", android.hardware.camera2.params.StreamConfigurationDuration[].class);
5662 
5663     /**
5664      * <p>String containing the ids of the underlying physical cameras.</p>
5665      * <p>For a logical camera, this is concatenation of all underlying physical camera IDs.
5666      * The null terminator for physical camera ID must be preserved so that the whole string
5667      * can be tokenized using '\0' to generate list of physical camera IDs.</p>
5668      * <p>For example, if the physical camera IDs of the logical camera are "2" and "3", the
5669      * value of this tag will be ['2', '\0', '3', '\0'].</p>
5670      * <p>The number of physical camera IDs must be no less than 2.</p>
5671      * <p><b>Units</b>: UTF-8 null-terminated string</p>
5672      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5673      * <p><b>Limited capability</b> -
5674      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
5675      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
5676      *
5677      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
5678      * @hide
5679      */
5680     public static final Key<byte[]> LOGICAL_MULTI_CAMERA_PHYSICAL_IDS =
5681             new Key<byte[]>("android.logicalMultiCamera.physicalIds", byte[].class);
5682 
5683     /**
5684      * <p>The accuracy of frame timestamp synchronization between physical cameras</p>
5685      * <p>The accuracy of the frame timestamp synchronization determines the physical cameras'
5686      * ability to start exposure at the same time. If the sensorSyncType is CALIBRATED, the
5687      * physical camera sensors usually run in leader/follower mode where one sensor generates a
5688      * timing signal for the other, so that their shutter time is synchronized. For APPROXIMATE
5689      * sensorSyncType, the camera sensors usually run in leader/leader mode, where both sensors
5690      * use their own timing generator, and there could be offset between their start of exposure.</p>
5691      * <p>In both cases, all images generated for a particular capture request still carry the same
5692      * timestamps, so that they can be used to look up the matching frame number and
5693      * onCaptureStarted callback.</p>
5694      * <p>This tag is only applicable if the logical camera device supports concurrent physical
5695      * streams from different physical cameras.</p>
5696      * <p><b>Possible values:</b></p>
5697      * <ul>
5698      *   <li>{@link #LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_APPROXIMATE APPROXIMATE}</li>
5699      *   <li>{@link #LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_CALIBRATED CALIBRATED}</li>
5700      * </ul>
5701      *
5702      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5703      * <p><b>Limited capability</b> -
5704      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
5705      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
5706      *
5707      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
5708      * @see #LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_APPROXIMATE
5709      * @see #LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_CALIBRATED
5710      */
5711     @PublicKey
5712     @NonNull
5713     public static final Key<Integer> LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE =
5714             new Key<Integer>("android.logicalMultiCamera.sensorSyncType", int.class);
5715 
5716     /**
5717      * <p>List of distortion correction modes for {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} that are
5718      * supported by this camera device.</p>
5719      * <p>No device is required to support this API; such devices will always list only 'OFF'.
5720      * All devices that support this API will list both FAST and HIGH_QUALITY.</p>
5721      * <p><b>Range of valid values:</b><br>
5722      * Any value listed in {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode}</p>
5723      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5724      *
5725      * @see CaptureRequest#DISTORTION_CORRECTION_MODE
5726      */
5727     @PublicKey
5728     @NonNull
5729     public static final Key<int[]> DISTORTION_CORRECTION_AVAILABLE_MODES =
5730             new Key<int[]>("android.distortionCorrection.availableModes", int[].class);
5731 
5732     /**
5733      * <p>The available HEIC (ISO/IEC 23008-12) stream
5734      * configurations that this camera device supports
5735      * (i.e. format, width, height, output/input stream).</p>
5736      * <p>The configurations are listed as <code>(format, width, height, input?)</code> tuples.</p>
5737      * <p>If the camera device supports HEIC image format, it will support identical set of stream
5738      * combinations involving HEIC image format, compared to the combinations involving JPEG
5739      * image format as required by the device's hardware level and capabilities.</p>
5740      * <p>All the static, control, and dynamic metadata tags related to JPEG apply to HEIC formats.
5741      * Configuring JPEG and HEIC streams at the same time is not supported.</p>
5742      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5743      * <p><b>Limited capability</b> -
5744      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
5745      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
5746      *
5747      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
5748      * @hide
5749      */
5750     public static final Key<android.hardware.camera2.params.StreamConfiguration[]> HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS =
5751             new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.heic.availableHeicStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
5752 
5753     /**
5754      * <p>This lists the minimum frame duration for each
5755      * format/size combination for HEIC output formats.</p>
5756      * <p>This should correspond to the frame duration when only that
5757      * stream is active, with all processing (typically in android.*.mode)
5758      * set to either OFF or FAST.</p>
5759      * <p>When multiple streams are used in a request, the minimum frame
5760      * duration will be max(individual stream min durations).</p>
5761      * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
5762      * android.scaler.availableStallDurations for more details about
5763      * calculating the max frame rate.</p>
5764      * <p><b>Units</b>: (format, width, height, ns) x n</p>
5765      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5766      * <p><b>Limited capability</b> -
5767      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
5768      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
5769      *
5770      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
5771      * @see CaptureRequest#SENSOR_FRAME_DURATION
5772      * @hide
5773      */
5774     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> HEIC_AVAILABLE_HEIC_MIN_FRAME_DURATIONS =
5775             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.heic.availableHeicMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
5776 
5777     /**
5778      * <p>This lists the maximum stall duration for each
5779      * output format/size combination for HEIC streams.</p>
5780      * <p>A stall duration is how much extra time would get added
5781      * to the normal minimum frame duration for a repeating request
5782      * that has streams with non-zero stall.</p>
5783      * <p>This functions similarly to
5784      * android.scaler.availableStallDurations for HEIC
5785      * streams.</p>
5786      * <p>All HEIC output stream formats may have a nonzero stall
5787      * duration.</p>
5788      * <p><b>Units</b>: (format, width, height, ns) x n</p>
5789      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5790      * <p><b>Limited capability</b> -
5791      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
5792      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
5793      *
5794      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
5795      * @hide
5796      */
5797     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> HEIC_AVAILABLE_HEIC_STALL_DURATIONS =
5798             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.heic.availableHeicStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
5799 
5800     /**
5801      * <p>The available HEIC (ISO/IEC 23008-12) stream
5802      * configurations that this camera device supports
5803      * (i.e. format, width, height, output/input stream).</p>
5804      * <p>Refer to android.heic.availableHeicStreamConfigurations for details.</p>
5805      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5806      * @hide
5807      */
5808     public static final Key<android.hardware.camera2.params.StreamConfiguration[]> HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION =
5809             new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.heic.availableHeicStreamConfigurationsMaximumResolution", android.hardware.camera2.params.StreamConfiguration[].class);
5810 
5811     /**
5812      * <p>This lists the minimum frame duration for each
5813      * format/size combination for HEIC output formats for CaptureRequests where
5814      * {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
5815      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
5816      * <p>Refer to android.heic.availableHeicMinFrameDurations for details.</p>
5817      * <p><b>Units</b>: (format, width, height, ns) x n</p>
5818      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5819      *
5820      * @see CaptureRequest#SENSOR_PIXEL_MODE
5821      * @hide
5822      */
5823     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> HEIC_AVAILABLE_HEIC_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION =
5824             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.heic.availableHeicMinFrameDurationsMaximumResolution", android.hardware.camera2.params.StreamConfigurationDuration[].class);
5825 
5826     /**
5827      * <p>This lists the maximum stall duration for each
5828      * output format/size combination for HEIC streams for CaptureRequests where
5829      * {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
5830      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
5831      * <p>Refer to android.heic.availableHeicStallDurations for details.</p>
5832      * <p><b>Units</b>: (format, width, height, ns) x n</p>
5833      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5834      *
5835      * @see CaptureRequest#SENSOR_PIXEL_MODE
5836      * @hide
5837      */
5838     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> HEIC_AVAILABLE_HEIC_STALL_DURATIONS_MAXIMUM_RESOLUTION =
5839             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.heic.availableHeicStallDurationsMaximumResolution", android.hardware.camera2.params.StreamConfigurationDuration[].class);
5840 
5841     /**
5842      * <p>The available HEIC (ISO/IEC 23008-12/24) UltraHDR stream
5843      * configurations that this camera device supports
5844      * (i.e. format, width, height, output/input stream).</p>
5845      * <p>The configurations are listed as <code>(format, width, height, input?)</code> tuples.</p>
5846      * <p>All the static, control, and dynamic metadata tags related to JPEG apply to HEIC formats.
5847      * Configuring JPEG and HEIC streams at the same time is not supported.</p>
5848      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5849      * <p><b>Limited capability</b> -
5850      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
5851      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
5852      *
5853      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
5854      * @hide
5855      */
5856     @FlaggedApi(Flags.FLAG_CAMERA_HEIF_GAINMAP)
5857     public static final Key<android.hardware.camera2.params.StreamConfiguration[]> HEIC_AVAILABLE_HEIC_ULTRA_HDR_STREAM_CONFIGURATIONS =
5858             new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.heic.availableHeicUltraHdrStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
5859 
5860     /**
5861      * <p>This lists the minimum frame duration for each
5862      * format/size combination for HEIC UltraHDR output formats.</p>
5863      * <p>This should correspond to the frame duration when only that
5864      * stream is active, with all processing (typically in android.*.mode)
5865      * set to either OFF or FAST.</p>
5866      * <p>When multiple streams are used in a request, the minimum frame
5867      * duration will be max(individual stream min durations).</p>
5868      * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
5869      * android.scaler.availableStallDurations for more details about
5870      * calculating the max frame rate.</p>
5871      * <p><b>Units</b>: (format, width, height, ns) x n</p>
5872      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5873      * <p><b>Limited capability</b> -
5874      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
5875      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
5876      *
5877      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
5878      * @see CaptureRequest#SENSOR_FRAME_DURATION
5879      * @hide
5880      */
5881     @FlaggedApi(Flags.FLAG_CAMERA_HEIF_GAINMAP)
5882     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> HEIC_AVAILABLE_HEIC_ULTRA_HDR_MIN_FRAME_DURATIONS =
5883             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.heic.availableHeicUltraHdrMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
5884 
5885     /**
5886      * <p>This lists the maximum stall duration for each
5887      * output format/size combination for HEIC UltraHDR streams.</p>
5888      * <p>A stall duration is how much extra time would get added
5889      * to the normal minimum frame duration for a repeating request
5890      * that has streams with non-zero stall.</p>
5891      * <p>This functions similarly to
5892      * android.scaler.availableStallDurations for HEIC UltraHDR
5893      * streams.</p>
5894      * <p>All HEIC output stream formats may have a nonzero stall
5895      * duration.</p>
5896      * <p><b>Units</b>: (format, width, height, ns) x n</p>
5897      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5898      * <p><b>Limited capability</b> -
5899      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
5900      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
5901      *
5902      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
5903      * @hide
5904      */
5905     @FlaggedApi(Flags.FLAG_CAMERA_HEIF_GAINMAP)
5906     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> HEIC_AVAILABLE_HEIC_ULTRA_HDR_STALL_DURATIONS =
5907             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.heic.availableHeicUltraHdrStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
5908 
5909     /**
5910      * <p>The available HEIC (ISO/IEC 23008-12/24) UltraHDR stream
5911      * configurations that this camera device supports
5912      * (i.e. format, width, height, output/input stream) for CaptureRequests where
5913      * {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
5914      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
5915      * <p>Refer to android.heic.availableHeicStreamConfigurations for details.</p>
5916      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5917      *
5918      * @see CaptureRequest#SENSOR_PIXEL_MODE
5919      * @hide
5920      */
5921     @FlaggedApi(Flags.FLAG_CAMERA_HEIF_GAINMAP)
5922     public static final Key<android.hardware.camera2.params.StreamConfiguration[]> HEIC_AVAILABLE_HEIC_ULTRA_HDR_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION =
5923             new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.heic.availableHeicUltraHdrStreamConfigurationsMaximumResolution", android.hardware.camera2.params.StreamConfiguration[].class);
5924 
5925     /**
5926      * <p>This lists the minimum frame duration for each
5927      * format/size combination for HEIC UltraHDR output formats for CaptureRequests where
5928      * {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
5929      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
5930      * <p>Refer to android.heic.availableHeicMinFrameDurations for details.</p>
5931      * <p><b>Units</b>: (format, width, height, ns) x n</p>
5932      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5933      *
5934      * @see CaptureRequest#SENSOR_PIXEL_MODE
5935      * @hide
5936      */
5937     @FlaggedApi(Flags.FLAG_CAMERA_HEIF_GAINMAP)
5938     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> HEIC_AVAILABLE_HEIC_ULTRA_HDR_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION =
5939             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.heic.availableHeicUltraHdrMinFrameDurationsMaximumResolution", android.hardware.camera2.params.StreamConfigurationDuration[].class);
5940 
5941     /**
5942      * <p>This lists the maximum stall duration for each
5943      * output format/size combination for HEIC UltraHDR streams for CaptureRequests where
5944      * {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
5945      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
5946      * <p>Refer to android.heic.availableHeicStallDurations for details.</p>
5947      * <p><b>Units</b>: (format, width, height, ns) x n</p>
5948      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5949      *
5950      * @see CaptureRequest#SENSOR_PIXEL_MODE
5951      * @hide
5952      */
5953     @FlaggedApi(Flags.FLAG_CAMERA_HEIF_GAINMAP)
5954     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> HEIC_AVAILABLE_HEIC_ULTRA_HDR_STALL_DURATIONS_MAXIMUM_RESOLUTION =
5955             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.heic.availableHeicUltraHdrStallDurationsMaximumResolution", android.hardware.camera2.params.StreamConfigurationDuration[].class);
5956 
5957     /**
5958      * <p>The direction of the camera faces relative to the vehicle body frame and the
5959      * passenger seats.</p>
5960      * <p>This enum defines the lens facing characteristic of the cameras on the automotive
5961      * devices with locations {@link CameraCharacteristics#AUTOMOTIVE_LOCATION android.automotive.location} defines.  If the system has
5962      * FEATURE_AUTOMOTIVE, the camera will have this entry in its static metadata.</p>
5963      * <p>When {@link CameraCharacteristics#AUTOMOTIVE_LOCATION android.automotive.location} is INTERIOR, this has one or more INTERIOR_*
5964      * values or a single EXTERIOR_* value.  When this has more than one INTERIOR_*,
5965      * the first value must be the one for the seat closest to the optical axis. If this
5966      * contains INTERIOR_OTHER, all other values will be ineffective.</p>
5967      * <p>When {@link CameraCharacteristics#AUTOMOTIVE_LOCATION android.automotive.location} is EXTERIOR_* or EXTRA, this has a single
5968      * EXTERIOR_* value.</p>
5969      * <p>If a camera has INTERIOR_OTHER or EXTERIOR_OTHER, or more than one camera is at the
5970      * same location and facing the same direction, their static metadata will list the
5971      * following entries, so that applications can determine their lenses' exact facing
5972      * directions:</p>
5973      * <ul>
5974      * <li>{@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference}</li>
5975      * <li>{@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation}</li>
5976      * <li>{@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}</li>
5977      * </ul>
5978      * <p><b>Possible values:</b></p>
5979      * <ul>
5980      *   <li>{@link #AUTOMOTIVE_LENS_FACING_EXTERIOR_OTHER EXTERIOR_OTHER}</li>
5981      *   <li>{@link #AUTOMOTIVE_LENS_FACING_EXTERIOR_FRONT EXTERIOR_FRONT}</li>
5982      *   <li>{@link #AUTOMOTIVE_LENS_FACING_EXTERIOR_REAR EXTERIOR_REAR}</li>
5983      *   <li>{@link #AUTOMOTIVE_LENS_FACING_EXTERIOR_LEFT EXTERIOR_LEFT}</li>
5984      *   <li>{@link #AUTOMOTIVE_LENS_FACING_EXTERIOR_RIGHT EXTERIOR_RIGHT}</li>
5985      *   <li>{@link #AUTOMOTIVE_LENS_FACING_INTERIOR_OTHER INTERIOR_OTHER}</li>
5986      *   <li>{@link #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_LEFT INTERIOR_SEAT_ROW_1_LEFT}</li>
5987      *   <li>{@link #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_CENTER INTERIOR_SEAT_ROW_1_CENTER}</li>
5988      *   <li>{@link #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_RIGHT INTERIOR_SEAT_ROW_1_RIGHT}</li>
5989      *   <li>{@link #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_LEFT INTERIOR_SEAT_ROW_2_LEFT}</li>
5990      *   <li>{@link #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_CENTER INTERIOR_SEAT_ROW_2_CENTER}</li>
5991      *   <li>{@link #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_RIGHT INTERIOR_SEAT_ROW_2_RIGHT}</li>
5992      *   <li>{@link #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_LEFT INTERIOR_SEAT_ROW_3_LEFT}</li>
5993      *   <li>{@link #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_CENTER INTERIOR_SEAT_ROW_3_CENTER}</li>
5994      *   <li>{@link #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_RIGHT INTERIOR_SEAT_ROW_3_RIGHT}</li>
5995      * </ul>
5996      *
5997      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
5998      *
5999      * @see CameraCharacteristics#AUTOMOTIVE_LOCATION
6000      * @see CameraCharacteristics#LENS_POSE_REFERENCE
6001      * @see CameraCharacteristics#LENS_POSE_ROTATION
6002      * @see CameraCharacteristics#LENS_POSE_TRANSLATION
6003      * @see #AUTOMOTIVE_LENS_FACING_EXTERIOR_OTHER
6004      * @see #AUTOMOTIVE_LENS_FACING_EXTERIOR_FRONT
6005      * @see #AUTOMOTIVE_LENS_FACING_EXTERIOR_REAR
6006      * @see #AUTOMOTIVE_LENS_FACING_EXTERIOR_LEFT
6007      * @see #AUTOMOTIVE_LENS_FACING_EXTERIOR_RIGHT
6008      * @see #AUTOMOTIVE_LENS_FACING_INTERIOR_OTHER
6009      * @see #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_LEFT
6010      * @see #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_CENTER
6011      * @see #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_RIGHT
6012      * @see #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_LEFT
6013      * @see #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_CENTER
6014      * @see #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_RIGHT
6015      * @see #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_LEFT
6016      * @see #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_CENTER
6017      * @see #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_RIGHT
6018      */
6019     @PublicKey
6020     @NonNull
6021     public static final Key<int[]> AUTOMOTIVE_LENS_FACING =
6022             new Key<int[]>("android.automotive.lens.facing", int[].class);
6023 
6024     /**
6025      * <p>Location of the cameras on the automotive devices.</p>
6026      * <p>This enum defines the locations of the cameras relative to the vehicle body frame on
6027      * <a href="https://source.android.com/devices/sensors/sensor-types#auto_axes">the automotive sensor coordinate system</a>.
6028      * If the system has FEATURE_AUTOMOTIVE, the camera will have this entry in its static
6029      * metadata.</p>
6030      * <ul>
6031      * <li>INTERIOR is the inside of the vehicle body frame (or the passenger cabin).</li>
6032      * <li>EXTERIOR is the outside of the vehicle body frame.</li>
6033      * <li>EXTRA is the extra vehicle such as a trailer.</li>
6034      * </ul>
6035      * <p>Each side of the vehicle body frame on this coordinate system is defined as below:</p>
6036      * <ul>
6037      * <li>FRONT is where the Y-axis increases toward.</li>
6038      * <li>REAR is where the Y-axis decreases toward.</li>
6039      * <li>LEFT is where the X-axis decreases toward.</li>
6040      * <li>RIGHT is where the X-axis increases toward.</li>
6041      * </ul>
6042      * <p>If the camera has either EXTERIOR_OTHER or EXTRA_OTHER, its static metadata will list
6043      * the following entries, so that applications can determine the camera's exact location:</p>
6044      * <ul>
6045      * <li>{@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference}</li>
6046      * <li>{@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation}</li>
6047      * <li>{@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}</li>
6048      * </ul>
6049      * <p><b>Possible values:</b></p>
6050      * <ul>
6051      *   <li>{@link #AUTOMOTIVE_LOCATION_INTERIOR INTERIOR}</li>
6052      *   <li>{@link #AUTOMOTIVE_LOCATION_EXTERIOR_OTHER EXTERIOR_OTHER}</li>
6053      *   <li>{@link #AUTOMOTIVE_LOCATION_EXTERIOR_FRONT EXTERIOR_FRONT}</li>
6054      *   <li>{@link #AUTOMOTIVE_LOCATION_EXTERIOR_REAR EXTERIOR_REAR}</li>
6055      *   <li>{@link #AUTOMOTIVE_LOCATION_EXTERIOR_LEFT EXTERIOR_LEFT}</li>
6056      *   <li>{@link #AUTOMOTIVE_LOCATION_EXTERIOR_RIGHT EXTERIOR_RIGHT}</li>
6057      *   <li>{@link #AUTOMOTIVE_LOCATION_EXTRA_OTHER EXTRA_OTHER}</li>
6058      *   <li>{@link #AUTOMOTIVE_LOCATION_EXTRA_FRONT EXTRA_FRONT}</li>
6059      *   <li>{@link #AUTOMOTIVE_LOCATION_EXTRA_REAR EXTRA_REAR}</li>
6060      *   <li>{@link #AUTOMOTIVE_LOCATION_EXTRA_LEFT EXTRA_LEFT}</li>
6061      *   <li>{@link #AUTOMOTIVE_LOCATION_EXTRA_RIGHT EXTRA_RIGHT}</li>
6062      * </ul>
6063      *
6064      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
6065      *
6066      * @see CameraCharacteristics#LENS_POSE_REFERENCE
6067      * @see CameraCharacteristics#LENS_POSE_ROTATION
6068      * @see CameraCharacteristics#LENS_POSE_TRANSLATION
6069      * @see #AUTOMOTIVE_LOCATION_INTERIOR
6070      * @see #AUTOMOTIVE_LOCATION_EXTERIOR_OTHER
6071      * @see #AUTOMOTIVE_LOCATION_EXTERIOR_FRONT
6072      * @see #AUTOMOTIVE_LOCATION_EXTERIOR_REAR
6073      * @see #AUTOMOTIVE_LOCATION_EXTERIOR_LEFT
6074      * @see #AUTOMOTIVE_LOCATION_EXTERIOR_RIGHT
6075      * @see #AUTOMOTIVE_LOCATION_EXTRA_OTHER
6076      * @see #AUTOMOTIVE_LOCATION_EXTRA_FRONT
6077      * @see #AUTOMOTIVE_LOCATION_EXTRA_REAR
6078      * @see #AUTOMOTIVE_LOCATION_EXTRA_LEFT
6079      * @see #AUTOMOTIVE_LOCATION_EXTRA_RIGHT
6080      */
6081     @PublicKey
6082     @NonNull
6083     public static final Key<Integer> AUTOMOTIVE_LOCATION =
6084             new Key<Integer>("android.automotive.location", int.class);
6085 
6086     /**
6087      * <p>The available Jpeg/R stream
6088      * configurations that this camera device supports
6089      * (i.e. format, width, height, output/input stream).</p>
6090      * <p>The configurations are listed as <code>(format, width, height, input?)</code> tuples.</p>
6091      * <p>If the camera device supports Jpeg/R, it will support the same stream combinations with
6092      * Jpeg/R as it does with P010. The stream combinations with Jpeg/R (or P010) supported
6093      * by the device is determined by the device's hardware level and capabilities.</p>
6094      * <p>All the static, control, and dynamic metadata tags related to JPEG apply to Jpeg/R formats.
6095      * Configuring JPEG and Jpeg/R streams at the same time is not supported.</p>
6096      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
6097      * <p><b>Limited capability</b> -
6098      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
6099      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
6100      *
6101      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
6102      * @hide
6103      */
6104     public static final Key<android.hardware.camera2.params.StreamConfiguration[]> JPEGR_AVAILABLE_JPEG_R_STREAM_CONFIGURATIONS =
6105             new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.jpegr.availableJpegRStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
6106 
6107     /**
6108      * <p>This lists the minimum frame duration for each
6109      * format/size combination for Jpeg/R output formats.</p>
6110      * <p>This should correspond to the frame duration when only that
6111      * stream is active, with all processing (typically in android.*.mode)
6112      * set to either OFF or FAST.</p>
6113      * <p>When multiple streams are used in a request, the minimum frame
6114      * duration will be max(individual stream min durations).</p>
6115      * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
6116      * android.scaler.availableStallDurations for more details about
6117      * calculating the max frame rate.</p>
6118      * <p><b>Units</b>: (format, width, height, ns) x n</p>
6119      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
6120      * <p><b>Limited capability</b> -
6121      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
6122      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
6123      *
6124      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
6125      * @see CaptureRequest#SENSOR_FRAME_DURATION
6126      * @hide
6127      */
6128     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> JPEGR_AVAILABLE_JPEG_R_MIN_FRAME_DURATIONS =
6129             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.jpegr.availableJpegRMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
6130 
6131     /**
6132      * <p>This lists the maximum stall duration for each
6133      * output format/size combination for Jpeg/R streams.</p>
6134      * <p>A stall duration is how much extra time would get added
6135      * to the normal minimum frame duration for a repeating request
6136      * that has streams with non-zero stall.</p>
6137      * <p>This functions similarly to
6138      * android.scaler.availableStallDurations for Jpeg/R
6139      * streams.</p>
6140      * <p>All Jpeg/R output stream formats may have a nonzero stall
6141      * duration.</p>
6142      * <p><b>Units</b>: (format, width, height, ns) x n</p>
6143      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
6144      * <p><b>Limited capability</b> -
6145      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
6146      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
6147      *
6148      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
6149      * @hide
6150      */
6151     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> JPEGR_AVAILABLE_JPEG_R_STALL_DURATIONS =
6152             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.jpegr.availableJpegRStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
6153 
6154     /**
6155      * <p>The available Jpeg/R stream
6156      * configurations that this camera device supports
6157      * (i.e. format, width, height, output/input stream).</p>
6158      * <p>Refer to android.jpegr.availableJpegRStreamConfigurations for details.</p>
6159      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
6160      * @hide
6161      */
6162     public static final Key<android.hardware.camera2.params.StreamConfiguration[]> JPEGR_AVAILABLE_JPEG_R_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION =
6163             new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.jpegr.availableJpegRStreamConfigurationsMaximumResolution", android.hardware.camera2.params.StreamConfiguration[].class);
6164 
6165     /**
6166      * <p>This lists the minimum frame duration for each
6167      * format/size combination for Jpeg/R output formats for CaptureRequests where
6168      * {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
6169      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
6170      * <p>Refer to android.jpegr.availableJpegRMinFrameDurations for details.</p>
6171      * <p><b>Units</b>: (format, width, height, ns) x n</p>
6172      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
6173      *
6174      * @see CaptureRequest#SENSOR_PIXEL_MODE
6175      * @hide
6176      */
6177     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> JPEGR_AVAILABLE_JPEG_R_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION =
6178             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.jpegr.availableJpegRMinFrameDurationsMaximumResolution", android.hardware.camera2.params.StreamConfigurationDuration[].class);
6179 
6180     /**
6181      * <p>This lists the maximum stall duration for each
6182      * output format/size combination for Jpeg/R streams for CaptureRequests where
6183      * {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
6184      * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
6185      * <p>Refer to android.jpegr.availableJpegRStallDurations for details.</p>
6186      * <p><b>Units</b>: (format, width, height, ns) x n</p>
6187      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
6188      *
6189      * @see CaptureRequest#SENSOR_PIXEL_MODE
6190      * @hide
6191      */
6192     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> JPEGR_AVAILABLE_JPEG_R_STALL_DURATIONS_MAXIMUM_RESOLUTION =
6193             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.jpegr.availableJpegRStallDurationsMaximumResolution", android.hardware.camera2.params.StreamConfigurationDuration[].class);
6194 
6195     /**
6196      * <p>Color space used for shared session configuration for all the output targets
6197      * when camera is opened in shared mode. This should be one of the values specified in
6198      * availableColorSpaceProfilesMap.</p>
6199      * <p><b>Possible values:</b></p>
6200      * <ul>
6201      *   <li>{@link #SHARED_SESSION_COLOR_SPACE_UNSPECIFIED UNSPECIFIED}</li>
6202      *   <li>{@link #SHARED_SESSION_COLOR_SPACE_SRGB SRGB}</li>
6203      *   <li>{@link #SHARED_SESSION_COLOR_SPACE_DISPLAY_P3 DISPLAY_P3}</li>
6204      *   <li>{@link #SHARED_SESSION_COLOR_SPACE_BT2020_HLG BT2020_HLG}</li>
6205      * </ul>
6206      *
6207      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
6208      * @see #SHARED_SESSION_COLOR_SPACE_UNSPECIFIED
6209      * @see #SHARED_SESSION_COLOR_SPACE_SRGB
6210      * @see #SHARED_SESSION_COLOR_SPACE_DISPLAY_P3
6211      * @see #SHARED_SESSION_COLOR_SPACE_BT2020_HLG
6212      * @hide
6213      */
6214     @FlaggedApi(Flags.FLAG_CAMERA_MULTI_CLIENT)
6215     public static final Key<Integer> SHARED_SESSION_COLOR_SPACE =
6216             new Key<Integer>("android.sharedSession.colorSpace", int.class);
6217 
6218     /**
6219      * <p>List of shared output configurations that this camera device supports when
6220      * camera is opened in shared mode. Array contains following entries for each supported
6221      * shared configuration:
6222      * 1) surface type
6223      * 2) width
6224      * 3) height
6225      * 4) format
6226      * 5) mirrorMode
6227      * 6) useReadoutTimestamp
6228      * 7) timestampBase
6229      * 8) dataspace
6230      * 9) usage
6231      * 10) streamUsecase
6232      * 11) physical camera id len
6233      * 12) physical camera id as UTF-8 null terminated string.</p>
6234      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
6235      * @hide
6236      */
6237     @FlaggedApi(Flags.FLAG_CAMERA_MULTI_CLIENT)
6238     public static final Key<long[]> SHARED_SESSION_OUTPUT_CONFIGURATIONS =
6239             new Key<long[]>("android.sharedSession.outputConfigurations", long[].class);
6240 
6241     /**
6242      * <p>The available stream configurations that this camera device supports for
6243      * shared capture session when camera is opened in shared mode. Android camera framework
6244      * will generate this tag if the camera device can be opened in shared mode.</p>
6245      * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
6246      * @hide
6247      */
6248     @SystemApi
6249     @NonNull
6250     @SyntheticKey
6251     @FlaggedApi(Flags.FLAG_CAMERA_MULTI_CLIENT)
6252     public static final Key<android.hardware.camera2.params.SharedSessionConfiguration> SHARED_SESSION_CONFIGURATION =
6253             new Key<android.hardware.camera2.params.SharedSessionConfiguration>("android.sharedSession.configuration", android.hardware.camera2.params.SharedSessionConfiguration.class);
6254 
6255 
6256     /**
6257      * Mapping from INFO_SESSION_CONFIGURATION_QUERY_VERSION to session characteristics key.
6258      */
6259     private static final Map<Integer, Key<?>[]> AVAILABLE_SESSION_CHARACTERISTICS_KEYS_MAP =
6260             Map.ofEntries(
6261                 Map.entry(
6262                     35,
6263                     new Key<?>[] {
6264                         CONTROL_ZOOM_RATIO_RANGE,
6265                         SCALER_AVAILABLE_MAX_DIGITAL_ZOOM,
6266                     }
6267                 )
6268             );
6269 
6270     /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
6271      * End generated code
6272      *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
6273 }
6274