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
This commit is contained in:
Avichal Rakesh
2023-03-03 15:27:45 -08:00
parent 0fd13e4818
commit 8f4111ca7d
5 changed files with 22 additions and 12 deletions

View File

@@ -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,
}

View File

@@ -40,5 +40,5 @@ enum RequestTemplate {
VIDEO_SNAPSHOT = 4,
ZERO_SHUTTER_LAG = 5,
MANUAL = 6,
VENDOR_TEMPLATE_START = 1073741824,
VENDOR_TEMPLATE_START = 0x40000000,
}

View File

@@ -39,4 +39,5 @@ parcelable StreamConfiguration {
android.hardware.camera.device.CameraMetadata sessionParams;
int streamConfigCounter;
boolean multiResolutionInputImage;
long logId = 0;
}

View File

@@ -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,
}

View File

@@ -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;
}