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

Commit 0d13fdfd authored by Rucha Katakwar's avatar Rucha Katakwar Committed by Android (Google) Code Review
Browse files

Merge "Camera:Add a check for -EINVAL error code." into tm-dev

parents 37a482c8 922fa9c0
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -2139,10 +2139,14 @@ Status CameraService::turnOnTorchWithStrengthLevel(const String16& cameraId, int
                    id.string());
                errorCode = ERROR_CAMERA_IN_USE;
                break;
            case -EINVAL:
                msg = String8::format("Torch strength level %d is not within the "
                        "valid range.", torchStrength);
                errorCode = ERROR_ILLEGAL_ARGUMENT;
                break;
            default:
                msg = String8::format("Changing torch strength level failed.");
                errorCode = ERROR_INVALID_OPERATION;

        }
        ALOGE("%s: %s", __FUNCTION__, msg.string());
        return STATUS_ERROR(errorCode, msg.string());