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

Commit c8a6f25c authored by Dijack Dong's avatar Dijack Dong
Browse files

camera: Return error code ERROR_CAMERA_IN_USE if setTorchMode return busy

Test: cts-on-gsi
    run cts-on-gsi -m CtsCameraTestCases -t android.hardware.camera2.cts.FlashlightTest

Bug: 201496581

Change-Id: Ifa361882e041606d20b6212267cfb2188190ed95
parent 01fd6fef
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1953,6 +1953,11 @@ Status CameraService::setTorchMode(const String16& cameraId, bool enabled,
                    id.string());
                errorCode = ERROR_ILLEGAL_ARGUMENT;
                break;
            case -EBUSY:
                msg = String8::format("Camera \"%s\" is in use",
                    id.string());
                errorCode = ERROR_CAMERA_IN_USE;
                break;
            default:
                msg = String8::format(
                    "Setting torch mode of camera \"%s\" to %d failed: %s (%d)",