Commit Graph

4 Commits

Author SHA1 Message Date
Tang Lee
4be4471d46 Return ILLEGAL_ARGUMENT for setting null callback
Bug: 299182872
Test: Run VTS with external USB camera
vts-tradefed
> run vts -m VtsAidlHalCameraProvider_TargetTest -t \
    PerInstance/CameraAidlTest#setCallback/0_android_hardware_camera_provider_ICameraProvider_external_0 \
    --logcat-on-failure --logcat-on-failure-size 8192000 \
    --bugreport-on-failure --screenshot-on-failure

Change-Id: I013e3770ddbdcf6475e0927449af6183dcc37a8e
2023-10-02 07:18:16 +00:00
Avichal Rakesh
b8863f6a03 camera: Fix prefix length path for External Camera HAL
The default External Camera HAL accidentally used `sizeof` on a `char *`
to get the length of the string. This "worked" because the string in
question "/dev/" has length of 5, while on a 32-bit system `char *`
has a size of 4. This difference of 1 was handled a few lines later.

However on 64-bit system `sizeof(char *)` returns 8 which breaks the
logic later in code.

As `sizeof` was being used as a proxy for strlen, this CL converts the
uses C++'s std::char_traits::length to determine the string lengths
at compile time.

Bug: 265168485
Test: Manually tested that the calculated length is correct after the
      fix.
Change-Id: I92481a2bcb74fdbbb483ef552168debf07b2d68a
2023-06-08 17:00:35 -07:00
Greg Kaiser
754fcb8c33 Avoid multiple map lookups
We directly use erase(), and its return value, so we only need
to look up 'deviceName' once.

Test: TreeHugger
Bug: 191248460
Change-Id: I7c229e7d1de5f76071f55f965eab447b6c868bcc
2022-01-21 07:00:25 -08:00
Valentin Iftime
23d32a1fc3 Add external lazy camera provider 2.7
Add default implementation for external camera
 provider with lazy HAL support v2.7.

 Test configuration for devices:
 PRODUCT_PACKAGES += android.hardware.camera.provider@2.7-impl
 PRODUCT_PACKAGES += android.hardware.camera.provider@2.7-external-service-lazy
 PRODUCT_PROPERTY_OVERRIDES += ro.camera.enableLazyHal=true

Test: atest CtsCameraTestCases
      atest VtsHalCameraProviderV2_4TargetTest

Bug: 191248460

Change-Id: I57c8130d7c331028eff35dc68e360fdd8d8c32e2
2021-12-27 18:59:47 +01:00