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

Commit bbc046ed authored by Yin-Chia Yeh's avatar Yin-Chia Yeh
Browse files

Camera: support torch control on external camera

Claim torch API support though there is no device
actually has a flash unit. This is to workaround
an issue in camera service where it falls back
to legacy camera HAL1 control if the device does
not report torch API support (and external camera
HAL does not implement HAL1)

Test: CtsVerifier FlashLight test
Bug: 113336515
Change-Id: I945b35fecfed3b2698b1e9bb1d8faad8699258d2
parent 6b4eb0e4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ Return<void> ExternalCameraDevice::getCameraCharacteristics(
}

Return<Status> ExternalCameraDevice::setTorchMode(TorchMode) {
    return Status::METHOD_NOT_SUPPORTED;
    return Status::OPERATION_NOT_SUPPORTED;
}

Return<void> ExternalCameraDevice::open(
+3 −2
Original line number Diff line number Diff line
@@ -105,8 +105,9 @@ Return<void> ExternalCameraProvider::getCameraIdList(getCameraIdList_cb _hidl_cb

Return<void> ExternalCameraProvider::isSetTorchModeSupported(
        isSetTorchModeSupported_cb _hidl_cb) {
    // No torch mode support for USB camera
    _hidl_cb (Status::OK, false);
    // setTorchMode API is supported, though right now no external camera device
    // has a flash unit.
    _hidl_cb (Status::OK, true);
    return Void();
}