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

Commit e2ce9366 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Camera: Check for invalid camera during API version calls"

parents 76cfc06b 28ad2eae
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -1878,14 +1878,7 @@ Status CameraService::supportsCameraApi(const String16& cameraId, int apiVersion
            return STATUS_ERROR(ERROR_ILLEGAL_ARGUMENT, msg.string());
    }

    int facing = -1;
    int deviceVersion = getDeviceVersion(id, /*out*/ &facing);
    if (facing == -1) {
        String8 msg = String8::format("Unable to get facing for camera device %s",
                id.string());
        ALOGE("%s: %s", __FUNCTION__, msg.string());
        return STATUS_ERROR(ERROR_INVALID_OPERATION, msg.string());
    }
    int deviceVersion = getDeviceVersion(id);
    switch(deviceVersion) {
        case CAMERA_DEVICE_API_VERSION_1_0:
        case CAMERA_DEVICE_API_VERSION_3_0: