From 8f4111ca7daa9fe35f0785c4995c3ddde21f4da1 Mon Sep 17 00:00:00 2001 From: Avichal Rakesh Date: Fri, 3 Mar 2023 15:27:45 -0800 Subject: [PATCH] camera: Add logId to StreamConfiguration For data analysis from HAL logs, it is helpful to get some higher level information of the camera usage (such as the client's package name). HALs are denied access to this higher level information at runtime. To help data with data analysis, cameraservice will now pass a session identifier when configuring streams. This identifier can be used to correlate HAL logs with cameraservice logs at the time of log consumption. However this correlation cannot be made at runtime. This identifier is randomly generated and has no functional purpose and can be safely disregarded by HAL implementations that don't want to correlate their logs to cameraservice logs. Bug: 271171714 Test: Manually verified that cameraservice sends correct logId to the HAL. Change-Id: Ib0823a9de8f573233a6e037c178a4398eb26e7ef --- .../hardware/camera/device/CameraBlobId.aidl | 4 ++-- .../hardware/camera/device/RequestTemplate.aidl | 2 +- .../camera/device/StreamConfiguration.aidl | 1 + .../camera/device/StreamConfigurationMode.aidl | 16 ++++++++-------- .../camera/device/StreamConfiguration.aidl | 11 ++++++++++- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraBlobId.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraBlobId.aidl index 632499d55d..24083ad512 100644 --- a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraBlobId.aidl +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/CameraBlobId.aidl @@ -34,6 +34,6 @@ package android.hardware.camera.device; @Backing(type="int") @VintfStability enum CameraBlobId { - JPEG = 255, - JPEG_APP_SEGMENTS = 256, + JPEG = 0x00FF, + JPEG_APP_SEGMENTS = 0x100, } diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/RequestTemplate.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/RequestTemplate.aidl index b70b8997d9..1f87aa338d 100644 --- a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/RequestTemplate.aidl +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/RequestTemplate.aidl @@ -40,5 +40,5 @@ enum RequestTemplate { VIDEO_SNAPSHOT = 4, ZERO_SHUTTER_LAG = 5, MANUAL = 6, - VENDOR_TEMPLATE_START = 1073741824, + VENDOR_TEMPLATE_START = 0x40000000, } diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfiguration.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfiguration.aidl index f3405780be..97fd067b8d 100644 --- a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfiguration.aidl +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfiguration.aidl @@ -39,4 +39,5 @@ parcelable StreamConfiguration { android.hardware.camera.device.CameraMetadata sessionParams; int streamConfigCounter; boolean multiResolutionInputImage; + long logId = 0; } diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfigurationMode.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfigurationMode.aidl index bdef41209d..ef7ec25d07 100644 --- a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfigurationMode.aidl +++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/StreamConfigurationMode.aidl @@ -36,12 +36,12 @@ package android.hardware.camera.device; enum StreamConfigurationMode { NORMAL_MODE = 0, CONSTRAINED_HIGH_SPEED_MODE = 1, - VENDOR_MODE_0 = 32768, - VENDOR_MODE_1 = 32769, - VENDOR_MODE_2 = 32770, - VENDOR_MODE_3 = 32771, - VENDOR_MODE_4 = 32772, - VENDOR_MODE_5 = 32773, - VENDOR_MODE_6 = 32774, - VENDOR_MODE_7 = 32775, + VENDOR_MODE_0 = 0x8000, + VENDOR_MODE_1, + VENDOR_MODE_2, + VENDOR_MODE_3, + VENDOR_MODE_4, + VENDOR_MODE_5, + VENDOR_MODE_6, + VENDOR_MODE_7, } diff --git a/camera/device/aidl/android/hardware/camera/device/StreamConfiguration.aidl b/camera/device/aidl/android/hardware/camera/device/StreamConfiguration.aidl index cacd32c171..197d9af588 100644 --- a/camera/device/aidl/android/hardware/camera/device/StreamConfiguration.aidl +++ b/camera/device/aidl/android/hardware/camera/device/StreamConfiguration.aidl @@ -62,7 +62,7 @@ parcelable StreamConfiguration { */ CameraMetadata sessionParams; - /** + /** * An incrementing counter used for HAL to keep track of the stream * configuration and the paired oneway signalStreamFlush call. When the * counter in signalStreamFlush call is less than the counter here, that @@ -83,4 +83,13 @@ parcelable StreamConfiguration { * any one of the supported multi-resolution input stream sizes. */ boolean multiResolutionInputImage; + + /** + * Logging identifier to join HAL logs to logs collected by cameraservice. This field has no + * functional purpose. + * + * See documentation of 'mLogId' in frameworks/av/camera/include/camera/CameraSessionStats.h + * for specifics of this identifier and how it can be used to join with cameraservice logs. + */ + long logId = 0; }