From ac1e3152ca46db8fec7b7b315bc42cda2d448e76 Mon Sep 17 00:00:00 2001 From: Bharatt Kukreja Date: Tue, 21 Nov 2023 16:37:07 +0000 Subject: [PATCH] Camera: Add getSessionCharacteristics API Add API to fetch characteristics for a given session configuration. Test: Build Bug: 303645857 Change-Id: I07cb6eb3b0d63454899b2df1497ba120aa762142 --- .../hardware/camera/device/ICameraDevice.aidl | 1 + .../hardware/camera/device/ICameraDevice.aidl | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDevice.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDevice.aidl index 903ef608ee..f73483a4b3 100644 --- a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDevice.aidl +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDevice.aidl @@ -45,4 +45,5 @@ interface ICameraDevice { int getTorchStrengthLevel(); android.hardware.camera.device.CameraMetadata constructDefaultRequestSettings(in android.hardware.camera.device.RequestTemplate type); boolean isStreamCombinationWithSettingsSupported(in android.hardware.camera.device.StreamConfiguration streams); + android.hardware.camera.device.CameraMetadata getSessionCharacteristics(in android.hardware.camera.device.StreamConfiguration sessionConfig); } diff --git a/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl b/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl index a2bdd59e9d..3a1d7625d5 100644 --- a/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl +++ b/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl @@ -435,4 +435,34 @@ interface ICameraDevice { * */ boolean isStreamCombinationWithSettingsSupported(in StreamConfiguration streams); + + /** + * getSessionCharacteristics + * + * Gets the session characteristics associated with a particular session + * configuration by the CameraDevice. + * + * For Android 15, the characteristics which need to be set are: + * - ANDROID_CONTROL_ZOOM_RATIO_RANGE + * + * A service specific error will be returned on the following conditions + * INTERNAL_ERROR: + * The camera device cannot be opened due to an internal + * error. + * CAMERA_DISCONNECTED: + * An external camera device has been disconnected, and is no longer + * available. This camera device interface is now stale, and a new + * instance must be acquired if the device is reconnected. All + * subsequent calls on this interface must return + * CAMERA_DISCONNECTED. + * ILLEGAL_ARGUMENT: + * If the given session configuration is not supported. + * + * @param sessionConfig: The session configuration for which the + * characteristics are being fetched. + * + * @return The static metadata for this particular session config, or an + * empty metadata structure if a service specific error is returned. + */ + CameraMetadata getSessionCharacteristics(in StreamConfiguration sessionConfig); }