If device implementations include at least one camera, they:
android.hardware.camera.any feature flag.
MediaStore.ACTION_VIDEO_CAPTURE, is responsible for removing the user location in the image metadata before sending it to the receiving application when the receiving application does not have
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.
If device implementations include at least one rear-facing camera, they:
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_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
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.
If device implementations include at least one front-facing camera, they:
android.hardware.Camera.setDisplayOrientation() method. Conversely, the preview MUST be mirrored along the device’s default horizontal axis when the current application does not explicitly request that the Camera display be rotated via a call to the
If device implementations are capable of being rotated by user (such as automatically via an accelerometer or manually via user input):
If device implementations include support for an external camera, they:
If camera-based video encoding is supported:
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.
All features that are common between the deprecated android.hardware.Camera class and the newer android.hardware.camera2 package MUST have equivalent performance and quality in both APIs. For example, with equivalent settings, autofocus speed and accuracy must be identical, and the quality of captured images must be the same. Features that depend on the different semantics of the two APIs are not required to have matching speed or quality, but SHOULD match as closely as possible.
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.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.JPEG formats as outputs through the
android.media.ImageReader API for
android.hardware.camera2 devices that advertise
REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE capability in
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 and the
android.hardware.camera2.CaptureRequest 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
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.
android.hardware.Camera API also accessible via the
CameraMetadata.REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA, consisting of all of the RGB cameras facing that direction as physical sub-devices.
If device implementations provide a proprietary camera API to 3rd-party apps, they:
If device implementations have a front- or a rear-facing camera, such camera(s):