The CameraX vendor extensions validation tool allows device manufacturers to verify that the CameraX OEM vendor library is implemented correctly. The tool includes automated and manual validation tests.
Automated validation tests: Validates that the vendor library interface is implemented correctly. For example, if
CaptureProcessoris required for image capture, the test validates that
ImageCaptureExtenderImpl#getCaptureStages()returns the required
CaptureStageinstances for capturing the images.
Manual validation tests: Validates the image effects and quality of preview and captured images. For example, the test allows device manufacturers to manually validate whether the face retouch effect is applied correctly or whether the bokeh strength is sufficient.
Build the CameraX vendor extensions validation tool
To build the extensions validation tool, follow these steps:
extensionstestappAPK. This allows for running manual validation tests.
The APK is output to the following path:
androidTestAPK. This APK allows for running automated validation tests.
The APK is output to the following path:
Run automated validation tests
To run the automated validation tests, install the
adb install -r path/to/checkout/out/androidx/camera/integration-tests/camera-testapp-extensions/build/outputs/apk/debug/camera-testapp-extensions-debug.apk
adb install -r path/to/checkout/out/androidx/camera/integration-tests/camera-testapp-extensions/build/outputs/apk/androidTest/debug/camera-testapp-extensions-debug-androidTest.apk
Run all automated tests
After installing the APKs, to run all automated tests to validate the vendor library implementation, run the following command:
adb shell am instrument -w -r androidx.camera.integration.extensions.test/androidx.test.runner.AndroidJUnitRunner
If all tests pass, an
OK result is returned. Otherwise, the final test report
shows failures in the terminal after all tests are complete.
Figure 1. Automated tests
Figure 2. Automated tests result with failures
Run automated tests of a specific class
To run automated tests of a specific class, specify the name and path of the
target class. The following example shows the command to run tests for the
adb shell am instrument -w -r -e class **androidx.camera.integration.extensions.ImageCaptureTest** androidx.camera.integration.extensions.test/androidx.test.runner.AndroidJUnitRunner
Run manual validation tests
The manual validation tests are found in the extensions test app. After installing and launching the extensions test app, switch to the validation tool mode by tapping the menu item at the top right.
After switching to the validation tool mode, the first page lists all cameras
that contain the
capability. If a camera doesn’t support any extension mode, its corresponding
list item is gray.
Figure 3. Validation tool mode
Tap on one of the cameras to see the extension modes for testing. Extension modes not supported by the selected camera are shown in gray.
Figure 4. Extension modes available for a camera
Verify the preview results
To verify the preview results, start a manual test by tapping on an extension mode for the selected camera. An image capturing activity containing the preview is then shown.
Figure 5. Preview image with bokeh enabled
The image capturing activity supports the following functions:
- Zoom in/out
- Flash modes switch button
- EV +/-
- Extension enabled/disabled switch button
Verify that the zoom in/out, tap-to-focus, flash modes, and EV +/- functions work as expected in the preview.
Verify the captured image results
To capture the image, tap the capture button in the image capturing activity. This launches an image validation activity that shows the captured image.
Figure 6. Captured image with bokeh enabled
The image validation activity includes the following functions:
- Pinch in/out to scale the image
- Slide left/right to switch the captured images
- Save image menu item
Verify whether the captured images are correct and match the zoom in/out, tap-to-focus, flash modes, and EV +/- settings that were set when capturing the image.
If the captured results are correct, tap the PASS button in the bottom-right corner. Otherwise, tap the FAIL button in the bottom-left corner.
View test results
After an extension mode is verified as a pass or a fail, the list item for the extension mode shows a different background color and indicator. In the list view of all the cameras, the items are displayed in the following colors:
- White background: The camera supports at least one extension mode and the supported extension modes aren't validated completely.
- Green background: The camera supports at least one extension mode. All supported extension modes are validated with all results passing.
- Red background: The camera supports at least one extension mode. All supported extension modes are validated with at least one extension mode result failing.
Figure 7. Colors indicating test results for cameras and extension modes
Other validation tool functions
After all the tests are complete, the camera list activity provides the following functions:
- Export test results: Exports the test results as a CSV file to the
- Reset: Clears all cached test results.
- Extensions sample app: Switches to the extensions sample app mode.
After completing the testing, you can export the test results. If you find an issue and a new version of the vendor library implementation with the solutions needs to be verified again, reset the previous test results and rerun all the supported extension modes on all cameras to verify that the issues are fixed.