android: camera_device: Do not default External to Front

Now that the camera location is not defaulted anymore in the library but
doesn't get registered if the firmware interface does not provide the
information, do not default it to FRONT if LocationExternal is reported.

To maintain compatibility with CTS requirements, default location to
FRONT only if the camera property is not available.

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Jacopo Mondi 2021-03-10 14:00:50 +01:00
parent 285d365186
commit 5154e14b3e

View file

@ -376,13 +376,15 @@ int CameraDevice::initialize()
facing_ = CAMERA_FACING_BACK;
break;
case properties::CameraLocationExternal:
/*
* \todo Set this to EXTERNAL once we support
* HARDWARE_LEVEL_EXTERNAL
*/
facing_ = CAMERA_FACING_FRONT;
facing_ = CAMERA_FACING_EXTERNAL;
break;
}
} else {
/*
* \todo Retrieve the camera location from configuration file
* if not available from the library.
*/
facing_ = CAMERA_FACING_FRONT;
}
/*