From a22e0e6d74c550a3ed8bc3861966bbc099205b5d Mon Sep 17 00:00:00 2001 From: Yin-Chia Yeh Date: Thu, 11 Feb 2021 16:45:43 -0800 Subject: [PATCH] Camera: add default secure image size key Test: new CTS tests pass Bug: 153663201 Change-Id: I22c9c37e7d718cad5f858f91c49a46255bf57cb8 --- core/api/current.txt | 1 + .../camera2/CameraCharacteristics.java | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/core/api/current.txt b/core/api/current.txt index 28b7f9b79d490..afb5d699ea91f 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -17619,6 +17619,7 @@ package android.hardware.camera2 { field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key SCALER_AVAILABLE_MAX_DIGITAL_ZOOM; field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key SCALER_AVAILABLE_ROTATE_AND_CROP_MODES; field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key SCALER_CROPPING_TYPE; + field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key SCALER_DEFAULT_SECURE_IMAGE_SIZE; field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key SCALER_MANDATORY_CONCURRENT_STREAM_COMBINATIONS; field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key SCALER_MANDATORY_STREAM_COMBINATIONS; field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key SCALER_STREAM_CONFIGURATION_MAP; diff --git a/core/java/android/hardware/camera2/CameraCharacteristics.java b/core/java/android/hardware/camera2/CameraCharacteristics.java index 0f595b7000132..16ab900dee06c 100644 --- a/core/java/android/hardware/camera2/CameraCharacteristics.java +++ b/core/java/android/hardware/camera2/CameraCharacteristics.java @@ -2907,6 +2907,29 @@ public final class CameraCharacteristics extends CameraMetadata SCALER_AVAILABLE_ROTATE_AND_CROP_MODES = new Key("android.scaler.availableRotateAndCropModes", int[].class); + /** + *

Default YUV/PRIVATE size to use for requesting secure image buffers.

+ *

This entry lists the default size supported in the secure camera mode. This entry is + * optional on devices support the SECURE_IMAGE_DATA capability. This entry will be null + * if the camera device does not list SECURE_IMAGE_DATA capability.

+ *

When the key is present, only a PRIVATE/YUV output of the specified size is guaranteed + * to be supported by the camera HAL in the secure camera mode. Any other format or + * resolutions might not be supported. Use + * {@link CameraDevice#isSessionConfigurationSupported } + * API to query if a secure session configuration is supported if the device supports this + * API.

+ *

If this key returns null on a device with SECURE_IMAGE_DATA capability, the application + * can assume all output sizes listed in the + * {@link android.hardware.camera2.params.StreamConfigurationMap } + * are supported.

+ *

Units: Pixels

+ *

Optional - The value for this key may be {@code null} on some devices.

+ */ + @PublicKey + @NonNull + public static final Key SCALER_DEFAULT_SECURE_IMAGE_SIZE = + new Key("android.scaler.defaultSecureImageSize", android.util.Size.class); + /** *

The area of the image sensor which corresponds to active pixels after any geometric * distortion correction has been applied.