If device implementations include at least one camera, they:
android.hardware.camera.any
feature flag.A rear-facing camera is a camera located on the side of the device opposite the display; that is, it images scenes on the far side of the device, like a traditional camera.
Device implementations:
If device implementations include at least one rear-facing camera, they:
android.hardware.camera
and android.hardware.camera.any
.If the Camera includes a flash:
android.hardware.Camera.PreviewCallback
instance has been registered on a Camera preview surface, unless the application has explicitly enabled the flash by enabling the FLASH_MODE_AUTO
or FLASH_MODE_ON
attributes of a Camera.Parameters
object. Note that this constraint does not apply to the device’s built-in system camera application, but only to third-party applications using Camera.PreviewCallback
.A front-facing camera is a camera located on the same side of the device as the display; that is, a camera typically used to image the user, such as for video conferencing and similar applications.
Device implementations:
If device implementations include at least one front-facing camera, they:
android.hardware.camera.any
and android.hardware.camera.front
.android.hardware.Camera.setDisplayOrientation()
method. Conversely, the preview MUST be mirrored along the device’s default horizontal axis when the the current application does not explicitly request that the Camera display be rotated via a call to the android.hardware.Camera.setDisplayOrientation()
method.If device implementations are capable of being rotated by user (such as automatically via an accelerometer or manually via user input):
Device implementations:
If device impelmentations include support for an external camera, they:
android.hardware.camera.external
and android.hardware camera.any
.Android includes two API packages to access the camera, the newer android.hardware.camera2 API expose lower-level camera control to the app, including efficient zero-copy burst/streaming flows and per-frame controls of exposure, gain, white balance gains, color conversion, denoising, sharpening, and more.
The older API package, android.hardware.Camera
, is marked as deprecated in Android 5.0 but as it should still be available for apps to use. Android device implementations MUST ensure the continued support of the API as described in this section and in the Android SDK.
Device implementations MUST implement the following behaviors for the camera-related APIs, for all available cameras. Device implementations:
android.hardware.PixelFormat.YCbCr_420_SP
for preview data provided to application callbacks when an application has never called android.hardware.Camera.Parameters.setPreviewFormat(int)
.android.hardware.Camera.PreviewCallback
instance and the system calls the onPreviewFrame()
method and the preview format is YCbCr_420_SP, the data in the byte[] passed into onPreviewFrame()
. That is, NV21 MUST be the default.android.graphics.ImageFormat.YV12
constant) for camera previews for both front- and rear-facing cameras for android.hardware.Camera
. (The hardware video encoder and camera may use any native pixel format, but the device implementation MUST support conversion to YV12.)android.hardware.ImageFormat.YUV_420_888
and android.hardware.ImageFormat.JPEG
formats as outputs through the android.media.ImageReader
API for android.hardware.camera2
.android.hardware.Camera.AutoFocusCallback
instances (even though this has no relevance to a non-autofocus camera.) Note that this does apply to front-facing cameras; for instance, even though most front-facing cameras do not support autofocus, the API callbacks must still be “faked” as described.android.hardware.Camera.Parameters
class. Conversely, device implementations MUST NOT honor or recognize string constants passed to the android.hardware.Camera.setParameters()
method other than those documented as constants on the android.hardware.Camera.Parameters
. That is, device implementations MUST support all standard Camera parameters if the hardware allows, and MUST NOT support custom Camera parameter types. For instance, device implementations that support image capture using high dynamic range (HDR) imaging techniques MUST support camera parameter Camera.SCENE_MODE_HDR
.android.info.supportedHardwareLevel
property as described in the Android SDK and report the appropriate framework feature flags.android.hardware.camera2
via the android.request.availableCapabilities
property and declare the appropriate feature flags; MUST define the feature flag if any of its attached camera devices supports the feature.Camera.ACTION_NEW_PICTURE
intent whenever a new picture is taken by the camera and the entry of the picture has been added to the media store.Camera.ACTION_NEW_VIDEO
intent whenever a new video is recorded by the camera and the entry of the picture has been added to the media store.If device implementations have a front- or a rear-facing camera, such camera(s):