Camera HAL Testing Checklist

This document lists all tests available for evaluating the Android camera hardware abstraction layer (HAL). It is intended for OEMs and application processor (AP) vendors so they may ensure proper implementation of the camera HAL with minimum defects. Although this is a voluntary addition to the Android Compatibility Test Suite (CTS), it greatly increases camera test coverage and will certainly identify potential bugs.

By passing these tests, original equipment manufacturers (OEM) validate whether they have properly integrated the latest Android camera hardware abstraction layer (HAL) 3.2 interfaces. When conforming with all items in the checklist, a device implementation may be considered full with respect to the new Android Camera HAL interfaces. This will in turn enable a device to properly support the new android.hardware.camera2 package that camera apps build upon.

Camera HAL 3.2 specification

The Android Camera HAL 3.2 specification is the authoritative source of information on what devices must satisfy; the document here provides a summary of all tests that can be used as a checklist. Camera HAL implementers (e.g. AP vendors) should go through the HAL 3.2 specification line-by-line and ensure their devices conform to it.

The current HAL 3.2 specification is defined in these files within the L generic Android Platform Development Kit (PDK):

Camera test types

Here are the primary types of tests available for the latest Android camera along with references to associated instructions below:

All of these test types are described in detail below. These tests are presented in the chronological order in which OEMs are expected to execute them.

For instance, if a device fails the native tests, it will assuredly fail the subsequent Compatibility Test Suite (CTS) tests. And if a device fails CTS, there is little use in proceeding to the Image Test Suite (ITS). We recommend addressing failures in each test type before proceeding to the next set of tests.

Vendor Test Suite (VTS) tests

The Android Vendor Test Suite (VTS) is a testing suite that works on the HIDL interface level. For more information on using VTS, see Vendor Test Suite.

Compatibility Test Suite (CTS) tests

Camera Android Compatibility Test Suite (CTS) tests focus upon device compatibility. They do not require a specific test environment (the field of view or FOV CTS Verifier test being the lone exception).

The starting path for Camera CTS tests is: platform/cts.

When running Camera CTS for devices that support external cameras (such as USB webcams), you must have a device plugged in when running CTS or the tests will automatically fail. Examples of external cameras include: Logitech HD Pro Webcam C920 and the Microsoft LifeCam HD-3000.

See the CTS introduction and its subpages for general instructions on running CTS.

CTS tests for the android.hardware.Camera API

Find these camera tests under cts/tests/tests/:

  • hardware/src/android/hardware/cts/
  • hardware/src/android/hardware/cts/
  • hardware/src/android/hardware/cts/
  • permission/src/android/permission/cts/

CTS tests for the android.hardware.camera2 API

Find these camera tests under cts/tests/tests/:

  • hardware/src/android/hardware/camera2/cts/*
  • permission/src/android/permission/cts/

CTS Verifier camera tests

Find these camera tests under: cts/apps/CtsVerifier/src/com/android/cts/verifier/camera/*

Image Test Suite (ITS) tests

The CameraITS tests focus upon image correctness. These Python scripts are manually run on a workstation with the Android device connected over USB. The workstation can run any operating system as long as it has the requisite Python 2.7 environment.

Since ITS is a CTS Verifier subtest, start CTS Verifier and the ITS subtest before running the python scripts so they have processes with which to communicate.

The CameraITS infrastructure and tests are located under: cts/apps/CameraITS

See the latest README file in this top-level folder for instructions on how to set up and run the tests. For setup: make cts

extract root/out/host/linux-x86/cts-verfier/
cd android-cts-verifier
adb install -r CtsVerifier.apk
cd CameraITS

See in the tests subdirectory for a walkthrough of the script's use. Each test resides in a corresponding tests/scene<#> subdirectory. See the README file in each subdirectory for specific test instructions.

To follow the recommended way of setting up and running the Camera Image Test Suite, see Camera ITS-in-a-Box.

To run ITS manually, you will need a simple physical environment with a specific, reusable target such as a white wall, grey card, and desk lamp. The Android device is mounted on a tripod and its camera functions are exercised by the scripts. Most tests are pass or fail but some offer metrics, as well.

These tests are works-in-progress and are not yet comprehensive enough for full automated pass/fail validation of the camera HAL. However, these scripts do test scenarios that are not tested in CTS and are an important component of the overall HAL 3.2 test plan.

ITS tests on scene 0 (plain)

This test requires no specific setup. Pass all of the tests in the tests/scene0 folder, for all cameras (back + front + any others).

ITS tests on scene 1 (grey card)

Pass all of the tests in the tests/scene1 folder, for all cameras (back + front + any others). The tests/scene1/README file describes the scene setup.

ITS tests on scene 2 (camera lab)

Pass all of the tests in the tests/scene2 folder, for all cameras (back + front + any others). The tests/scene2/README file describes the scene setup.

Media Framework tests

Pass all of the camera-related media tests in MediaFrameworkTest. Please note, these tests require the mediaframeworktest.apk be installed on the Android device. You will need to make mediaframeworktest and then use adb to install the resulting .apk. Example commands are included below.

The starting path for Camera-related media framework tests is: platform/frameworks/base

Find the source code for the tests here: frameworks/base/media/tests/MediaFrameworkTest

To set up these tests:

make mediaframeworktest
adb install out/target/product/<name>/data/app/mediaframeworktest.apk

Where the variable represents the directory containing the vendor's product.

Find all of the tests in the following directory or its subdirectories:


Each subdirectory represents a class of tests:

  • functional/
  • integration/
  • performance/
  • power/
  • stress/
  • unit/

Running Media Framework tests

To see all of the available tests::

adb shell pm list instrumentation

This will yield results resembling:

Identify and extract the component (between instrumentation: and ( from each test line. The component is composed of the target package name ( and the test runner name (MediaFrameworkTestRunner).

For instance:

You may then pass each component to adb shell am instrument like so:

adb shell am instrument -w

Where equals the extracted value above. For example:

adb shell am instrument -w

Please note, while the class path is the Java package + class name, the instrumentation package isn't necessarily the same as the Java package. Make sure you use the AndroidManifest.xml package when concatenating the component name, not the Java package in which the test runner class resides.

To run a single class of tests, pass the -e class argument, like so:

adb shell am instrument -e class -w

To run only a single method in a test class, append a pound (#) sign and the method name (in this case, testConnectPro) to the class name, like so:

adb shell am instrument -e class '' -w

Media settings functional tests

Here is an example run of a functional test. This test verifies the basic functionality of different combinations of camera settings. (ie, Flash, exposure, WB, scene, picture size and geoTag)

Run the test command:

adb shell am instrument -w -r  -e delay_msec 15 -e log true -e class

Media integration tests

Here is an example run of an integration test, in this case mediaframeworktest/integration/ and mediaframeworktest/

adb  shell am instrument -e class \ '' -w \ ''

If successful, this results in output resembling:

Test results for CameraStressTestRunner=...........
Time: 3.328

OK (11 tests)


Media performance tests

This preview memory test will open and release the camera preview for 200 times. In each 20 iterations, the snapshot of ps mediaserver will be recorded and it will compare the memory usage different after 200 iterations. Test will fail If the difference is greater than 150kM.

Run the test command:

adb shell am instrument -w -r  -e class

More detailed output can be found in: /sdcard/mediaMemOutput.txt

Media unit tests

The commands to run unit tests are all similar. For example, for, the command would be:

adb shell am instrument -e class '' -w ''

Media stress tests

This test is to stress out the camera image capture and video recording.

Run the test command:

adb shell am instrument -w

All tests should pass.

Manual TestingCam tests

The TestingCam app should be run manually with the following checks performed. The source for TestingCam is here: pdk/apps/TestingCamera/

Infinity focus with camera tilt

Start TestingCam, turn on preview, and ensure that autofocus mode is set to infinity. Using the Take picture button, capture shots of distant subjects (at least 10m away) with the camera pointed horizontally, upwards (close to vertical), and downwards (close to vertical); an example of the upwards shot could be high leaves/branches of a tree from beneath and an example of the downwards shot could be the street as seen from the roof of a building. In all cases, the distant subject should be sharp and in focus. Save and view the shots in the gallery view so that you can zoom in and inspect the sharpness more easily.

Note that for a camera with a VCM actuator to pass this test, it will require either a closed-loop AF control system, or it will need some sort of SW correction based on using accelerometer data to determine camera orientation. Reliable factory calibration of the lens infinity position will also be needed.

Manual TestingCam2 tests

The TestingCam2 app should be run manually, with the following checks performed. The source for TestingCam2 is here: pdk/apps/TestingCamera2/

JPEG capture

Start TestingCam2, and press the JPEG button. The image that appears to the right of the viewfinder image should appear the same as the viewfinder, including having the same orientation.