Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f4111ca authored by Avichal Rakesh's avatar Avichal Rakesh
Browse files

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
parent 0fd13e48
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -34,6 +34,6 @@
package android.hardware.camera.device;
package android.hardware.camera.device;
@Backing(type="int") @VintfStability
@Backing(type="int") @VintfStability
enum CameraBlobId {
enum CameraBlobId {
  JPEG = 255,
  JPEG = 0x00FF,
  JPEG_APP_SEGMENTS = 256,
  JPEG_APP_SEGMENTS = 0x100,
}
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -40,5 +40,5 @@ enum RequestTemplate {
  VIDEO_SNAPSHOT = 4,
  VIDEO_SNAPSHOT = 4,
  ZERO_SHUTTER_LAG = 5,
  ZERO_SHUTTER_LAG = 5,
  MANUAL = 6,
  MANUAL = 6,
  VENDOR_TEMPLATE_START = 1073741824,
  VENDOR_TEMPLATE_START = 0x40000000,
}
}
+1 −0
Original line number Original line Diff line number Diff line
@@ -39,4 +39,5 @@ parcelable StreamConfiguration {
  android.hardware.camera.device.CameraMetadata sessionParams;
  android.hardware.camera.device.CameraMetadata sessionParams;
  int streamConfigCounter;
  int streamConfigCounter;
  boolean multiResolutionInputImage;
  boolean multiResolutionInputImage;
  long logId = 0;
}
}
+8 −8
Original line number Original line Diff line number Diff line
@@ -36,12 +36,12 @@ package android.hardware.camera.device;
enum StreamConfigurationMode {
enum StreamConfigurationMode {
  NORMAL_MODE = 0,
  NORMAL_MODE = 0,
  CONSTRAINED_HIGH_SPEED_MODE = 1,
  CONSTRAINED_HIGH_SPEED_MODE = 1,
  VENDOR_MODE_0 = 32768,
  VENDOR_MODE_0 = 0x8000,
  VENDOR_MODE_1 = 32769,
  VENDOR_MODE_1,
  VENDOR_MODE_2 = 32770,
  VENDOR_MODE_2,
  VENDOR_MODE_3 = 32771,
  VENDOR_MODE_3,
  VENDOR_MODE_4 = 32772,
  VENDOR_MODE_4,
  VENDOR_MODE_5 = 32773,
  VENDOR_MODE_5,
  VENDOR_MODE_6 = 32774,
  VENDOR_MODE_6,
  VENDOR_MODE_7 = 32775,
  VENDOR_MODE_7,
}
}
+10 −1
Original line number Original line Diff line number Diff line
@@ -83,4 +83,13 @@ parcelable StreamConfiguration {
     * any one of the supported multi-resolution input stream sizes.
     * any one of the supported multi-resolution input stream sizes.
     */
     */
    boolean multiResolutionInputImage;
    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;
}
}