Camera: fix camera facing override logic
Test: hack existing HAL to report EXTERNAL and run cts
Bug: 33091893
Change-Id: Idae8742fb4b18b2ef4842ec66284268fc650df22
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index d0df6d1..6124fed 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -467,8 +467,8 @@
// CameraInfo is for android.hardware.Camera which does not
// support external camera facing. The closest approximation would be
// front camera.
- if (cameraInfo->orientation == CAMERA_FACING_EXTERNAL) {
- cameraInfo->orientation = CAMERA_FACING_FRONT;
+ if (cameraInfo->facing == CAMERA_FACING_EXTERNAL) {
+ cameraInfo->facing = CAMERA_FACING_FRONT;
}
}
return rc;
@@ -2532,7 +2532,8 @@
write(fd, result.string(), result.size());
} else {
result.appendFormat(" Facing: %s\n",
- info.facing == CAMERA_FACING_BACK ? "BACK" : "FRONT");
+ info.facing == CAMERA_FACING_BACK ? "BACK" :
+ info.facing == CAMERA_FACING_FRONT ? "FRONT" : "EXTERNAL");
result.appendFormat(" Orientation: %d\n", info.orientation);
int deviceVersion;
if (mModule->getModuleApiVersion() < CAMERA_MODULE_API_VERSION_2_0) {