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

Commit f05e50eb authored by Zhijun He's avatar Zhijun He
Browse files

Camera: only return static metadata for HAL3 device

This effectively disables the camera2 APIs for HAL2.x or lower HAL device.

Bug: 10360518
Change-Id: I0f374ac533468c6181f5672c75088b7144b9c53d
parent 26c1fb23
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -255,6 +255,12 @@ status_t CameraService::getCameraCharacteristics(int cameraId,
        return BAD_VALUE;
    }

    if (getDeviceVersion(cameraId, &facing) <= CAMERA_DEVICE_API_VERSION_2_1) {
        // Disable HAL2.x support for camera2 API for now.
        ALOGW("%s: HAL2.x doesn't support getCameraCharacteristics for now", __FUNCTION__);
        return BAD_VALUE;
    }

    struct camera_info info;
    status_t ret = mModule->get_camera_info(cameraId, &info);
    *cameraInfo = info.static_camera_characteristics;