This page details version differences in Camera HALs, APIs, and associated Android Compatibility Test Suite (CTS) tests. It also covers several architectural changes made to harden and secure the camera framework in Android 7.0 and the updates vendors must make to support these changes in their camera implementations.

Terminology

The following terms are used on this page:

Camera API1
The app-level camera framework on Android 4.4 and earlier devices, exposed through the android.hardware.Camera class.
Camera API2
The app-level camera framework on Android 5.0 and later devices, exposed through the android.hardware.camera2 package.
Camera HAL
The camera module layer implemented by SoC vendors. The app-level public frameworks are built on top of the camera HAL.
Camera HAL3.1
Version of the camera device HAL released with Android 4.4.
Camera HAL3.2
Version of the camera device HAL released with Android 5.0.
Camera API1 CTS
Set of camera Compatibility Test Suite (CTS) tests that run on top of Camera API1.
Camera API2 CTS
Additional set of camera CTS tests that run on top of Camera API2.

Camera APIs

Android includes the following camera APIs.

Camera API1

Android 5.0 deprecated Camera API1, which continues to be phased out as new platform development focuses on Camera API2. However, the phase-out period will be lengthy, and Android releases will continue to support Camera API1 apps for some time. Specifically, support continues for:

Camera API2

The Camera API2 framework exposes 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. For details, watch the Google I/O video overview.

Android 5.0 and later includes Camera API2; however, devices running Android 5.0 and later may not support all Camera API2 features. The android.info.supportedHardwareLevel property that apps can query through the Camera API2 interfaces reports one of the following support levels:

Individual capabilities are exposed via the android.request.availableCapabilities property in the Camera API2 interfaces. FULL devices require the MANUAL_SENSOR and MANUAL_POST_PROCESSING capabilities, among others. The RAW capability is optional even for FULL devices. LIMITED devices can advertise any subset of these capabilities, including none of them. However, the BACKWARD_COMPATIBLE capability must always be defined.

The supported hardware level of the device, as well as the specific Camera API2 capabilities it supports, are available as the following feature flags to allow Google Play filtering of Camera API2 camera apps.

CTS requirements

Devices running Android 5.0 and later must pass the Camera API1 CTS, Camera API2 CTS, and CTS Verifier camera tests.

Devices that do not feature a Camera HAL3.2 implementation and are not capable of supporting the full Camera API2 interfaces must still pass the Camera API2 CTS tests. However, the device will be running in Camera API2 LEGACY mode (in which the Camera API2 calls are conceptually mapped to Camera API1 calls) so any Camera API2 CTS tests related to features or capabilities beyond Camera API1 will be automatically skipped.

On legacy devices, Camera API2 CTS tests that are not skipped use the existing public Camera API1 interfaces and capabilities with no new requirements. Bugs that are exposed (and which cause a Camera API2 CTS failure) are bugs already present in the device’s existing Camera HAL, and thus would be found by existing Camera API1 apps. We do not expect many bugs of this nature (however, any such bugs must be fixed to pass the Camera API2 CTS tests).

Camera framework hardening

To harden media and camera framework security, Android 7.0 moves camera service out of mediaserver. Vendors may need to make changes in the camera HAL depending on the API and HAL versions in use. The following sections detail architectural changes in AP1 and AP2 for HAL1 and HAL3, as well as general requirements.

Architectural changes for API1

API1 video recording may assume camera and video encoder live in the same process. When using API1 on:

Architectural changes for API2

For API2 on HAL1 or HAL3, BufferQueue passes buffers so those paths continue to work. The Android 7.0 architecture for API2 on:

Additional requirements

The architectural changes made for hardening media and camera framework security include the following additional device requirements.