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
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index ae7e05c..721af95 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -1953,6 +1953,11 @@
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)",