If device implementations include at least one camera, they:
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.PreviewCallbackinstance has been registered on a Camera preview surface, unless the application has explicitly enabled the flash by enabling the
FLASH_MODE_ONattributes of a
Camera.Parametersobject. 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_SPfor preview data provided to application callbacks when an application has never called
android.hardware.Camera.PreviewCallbackinstance 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.YV12constant) 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.JPEGformats as outputs through the
android.hardware.camera2devices that advertise
android.hardware.Camera.AutoFocusCallbackinstances (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.Parametersclass. 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.supportedHardwareLevelproperty as described in the Android SDK and report the appropriate framework feature flags.
android.request.availableCapabilitiesproperty and declare the appropriate feature flags; MUST define the feature flag if any of its attached camera devices supports the feature.
Camera.ACTION_NEW_PICTUREintent 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_VIDEOintent whenever a new video is recorded by the camera and the entry of the picture has been added to the media store.
CameraMetadata.REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA, for devices with multiple cameras facing the same direction, consisting of each physical camera facing that direction, as long as the physical camera type is supported by the framework and
CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVELfor the physical cameras is either
If device implementations have a front- or a rear-facing camera, such camera(s):