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

Commit 5be2304a authored by Yin-Chia Yeh's avatar Yin-Chia Yeh Committed by Android (Google) Code Review
Browse files

Merge "Camera: fix HAL1.0 support"

parents bbe860d5 654b4bf3
Loading
Loading
Loading
Loading
+24 −18
Original line number Diff line number Diff line
@@ -1551,7 +1551,9 @@ bool CameraService::evictClientIdByRemote(const wp<IBinder>& remote) {
 * Also check that the device HAL version is still in support
 */
int CameraService::checkCameraCapabilities(int id, camera_info info, int *latestStrangeCameraId) {

    // device_version undefined in CAMERA_MODULE_API_VERSION_1_0,
    // All CAMERA_MODULE_API_VERSION_1_0 devices are backward-compatible
    if (mModule->getModuleApiVersion() >= CAMERA_MODULE_API_VERSION_2_0) {
        // Verify the device version is in the supported range
        switch (info.device_version) {
            case CAMERA_DEVICE_API_VERSION_1_0:
@@ -1567,9 +1569,13 @@ int CameraService::checkCameraCapabilities(int id, camera_info info, int *latest
            default:
                ALOGE("%s: Device %d has HAL version %x, which is not supported",
                        __FUNCTION__, id, info.device_version);
            logServiceError("Unsupported device HAL version", NO_INIT);
                String8 msg = String8::format(
                        "Unsupported device HAL version %x for device %d",
                        info.device_version, id);
                logServiceError(msg.string(), NO_INIT);
                return NO_INIT;
        }
    }

    // Assume all devices pre-v3.3 are backward-compatible
    bool isBackwardCompatible = true;
+3 −0
Original line number Diff line number Diff line
@@ -191,6 +191,9 @@ int CameraModule::getCameraInfo(int cameraId, struct camera_info *info) {
        int ret;
        ATRACE_BEGIN("camera_module->get_camera_info");
        ret = mModule->get_camera_info(cameraId, info);
        // Fill in this so CameraService won't be confused by
        // possibly 0 device_version
        info->device_version = CAMERA_DEVICE_API_VERSION_1_0;
        ATRACE_END();
        return ret;
    }