blob: 8553d9cf6c78b88259a71f1bab94f5826676582c [file] [log] [blame]
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* ! Do not edit this file directly !
*
* Generated automatically from system/media/camera/docs/CameraCharacteristicsTest.mako.
* This file contains only the auto-generated CameraCharacteristics CTS tests; it does
* not contain any additional manual tests, which would be in a separate file.
*/
package android.hardware.camera2.cts;
import android.content.Context;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.CameraManager;
import android.hardware.camera2.CameraMetadata.Key;
import android.test.AndroidTestCase;
import android.util.Log;
import java.util.List;
/**
* Auto-generated CTS test for CameraCharacteristics fields.
*/
public class CameraCharacteristicsTest extends AndroidTestCase {
private CameraManager mCameraManager;
private static final String TAG = "CameraCharacteristicsTest";
@Override
public void setContext(Context context) {
super.setContext(context);
mCameraManager = (CameraManager)context.getSystemService(Context.CAMERA_SERVICE);
assertNotNull("Can't connect to camera manager", mCameraManager);
}
@Override
protected void setUp() throws Exception {
super.setUp();
}
@Override
protected void tearDown() throws Exception {
super.tearDown();
}
public void testCameraCharacteristicsAndroidControlAeAvailableAntibandingModes() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.control.aeAvailableAntibandingModes",
props.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_ANTIBANDING_MODES));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.control.aeAvailableAntibandingModes", allKeys.contains(
CameraCharacteristics.CONTROL_AE_AVAILABLE_ANTIBANDING_MODES));
}
}
}
public void testCameraCharacteristicsAndroidControlAeAvailableModes() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.control.aeAvailableModes",
props.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_MODES));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.control.aeAvailableModes", allKeys.contains(
CameraCharacteristics.CONTROL_AE_AVAILABLE_MODES));
}
}
}
public void testCameraCharacteristicsAndroidControlAeAvailableTargetFpsRanges() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.control.aeAvailableTargetFpsRanges",
props.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.control.aeAvailableTargetFpsRanges", allKeys.contains(
CameraCharacteristics.CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES));
}
}
}
public void testCameraCharacteristicsAndroidControlAeCompensationRange() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.control.aeCompensationRange",
props.get(CameraCharacteristics.CONTROL_AE_COMPENSATION_RANGE));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.control.aeCompensationRange", allKeys.contains(
CameraCharacteristics.CONTROL_AE_COMPENSATION_RANGE));
}
}
}
public void testCameraCharacteristicsAndroidControlAeCompensationStep() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.control.aeCompensationStep",
props.get(CameraCharacteristics.CONTROL_AE_COMPENSATION_STEP));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.control.aeCompensationStep", allKeys.contains(
CameraCharacteristics.CONTROL_AE_COMPENSATION_STEP));
}
}
}
public void testCameraCharacteristicsAndroidControlAfAvailableModes() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.control.afAvailableModes",
props.get(CameraCharacteristics.CONTROL_AF_AVAILABLE_MODES));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.control.afAvailableModes", allKeys.contains(
CameraCharacteristics.CONTROL_AF_AVAILABLE_MODES));
}
}
}
public void testCameraCharacteristicsAndroidControlAvailableEffects() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.control.availableEffects",
props.get(CameraCharacteristics.CONTROL_AVAILABLE_EFFECTS));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.control.availableEffects", allKeys.contains(
CameraCharacteristics.CONTROL_AVAILABLE_EFFECTS));
}
}
}
public void testCameraCharacteristicsAndroidControlAvailableSceneModes() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.control.availableSceneModes",
props.get(CameraCharacteristics.CONTROL_AVAILABLE_SCENE_MODES));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.control.availableSceneModes", allKeys.contains(
CameraCharacteristics.CONTROL_AVAILABLE_SCENE_MODES));
}
}
}
public void testCameraCharacteristicsAndroidControlAvailableVideoStabilizationModes() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.control.availableVideoStabilizationModes",
props.get(CameraCharacteristics.CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.control.availableVideoStabilizationModes", allKeys.contains(
CameraCharacteristics.CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES));
}
}
}
public void testCameraCharacteristicsAndroidControlAwbAvailableModes() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.control.awbAvailableModes",
props.get(CameraCharacteristics.CONTROL_AWB_AVAILABLE_MODES));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.control.awbAvailableModes", allKeys.contains(
CameraCharacteristics.CONTROL_AWB_AVAILABLE_MODES));
}
}
}
public void testCameraCharacteristicsAndroidControlMaxRegions() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.control.maxRegions",
props.get(CameraCharacteristics.CONTROL_MAX_REGIONS));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.control.maxRegions", allKeys.contains(
CameraCharacteristics.CONTROL_MAX_REGIONS));
}
}
}
public void testCameraCharacteristicsAndroidFlashInfoAvailable() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.flash.info.available",
props.get(CameraCharacteristics.FLASH_INFO_AVAILABLE));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.flash.info.available", allKeys.contains(
CameraCharacteristics.FLASH_INFO_AVAILABLE));
}
}
}
public void testCameraCharacteristicsAndroidJpegAvailableThumbnailSizes() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.jpeg.availableThumbnailSizes",
props.get(CameraCharacteristics.JPEG_AVAILABLE_THUMBNAIL_SIZES));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.jpeg.availableThumbnailSizes", allKeys.contains(
CameraCharacteristics.JPEG_AVAILABLE_THUMBNAIL_SIZES));
}
}
}
public void testCameraCharacteristicsAndroidLensFacing() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.lens.facing",
props.get(CameraCharacteristics.LENS_FACING));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.lens.facing", allKeys.contains(
CameraCharacteristics.LENS_FACING));
}
}
}
public void testCameraCharacteristicsAndroidLensInfoAvailableApertures() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.lens.info.availableApertures",
props.get(CameraCharacteristics.LENS_INFO_AVAILABLE_APERTURES));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.lens.info.availableApertures", allKeys.contains(
CameraCharacteristics.LENS_INFO_AVAILABLE_APERTURES));
}
}
}
public void testCameraCharacteristicsAndroidLensInfoAvailableFilterDensities() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.lens.info.availableFilterDensities",
props.get(CameraCharacteristics.LENS_INFO_AVAILABLE_FILTER_DENSITIES));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.lens.info.availableFilterDensities", allKeys.contains(
CameraCharacteristics.LENS_INFO_AVAILABLE_FILTER_DENSITIES));
}
}
}
public void testCameraCharacteristicsAndroidLensInfoAvailableFocalLengths() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.lens.info.availableFocalLengths",
props.get(CameraCharacteristics.LENS_INFO_AVAILABLE_FOCAL_LENGTHS));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.lens.info.availableFocalLengths", allKeys.contains(
CameraCharacteristics.LENS_INFO_AVAILABLE_FOCAL_LENGTHS));
}
}
}
public void testCameraCharacteristicsAndroidLensInfoAvailableOpticalStabilization() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.lens.info.availableOpticalStabilization",
props.get(CameraCharacteristics.LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.lens.info.availableOpticalStabilization", allKeys.contains(
CameraCharacteristics.LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION));
}
}
}
public void testCameraCharacteristicsAndroidLensInfoHyperfocalDistance() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
Integer hwLevel = props.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL);
assertNotNull("No hardware level reported! android.info.supportedHardwareLevel",
hwLevel);
if (hwLevel == CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL)
{
assertNotNull("Invalid property: android.lens.info.hyperfocalDistance",
props.get(CameraCharacteristics.LENS_INFO_HYPERFOCAL_DISTANCE));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.lens.info.hyperfocalDistance", allKeys.contains(
CameraCharacteristics.LENS_INFO_HYPERFOCAL_DISTANCE));
}
}
}
public void testCameraCharacteristicsAndroidLensInfoMinimumFocusDistance() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.lens.info.minimumFocusDistance",
props.get(CameraCharacteristics.LENS_INFO_MINIMUM_FOCUS_DISTANCE));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.lens.info.minimumFocusDistance", allKeys.contains(
CameraCharacteristics.LENS_INFO_MINIMUM_FOCUS_DISTANCE));
}
}
}
public void testCameraCharacteristicsAndroidLensInfoShadingMapSize() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.lens.info.shadingMapSize",
props.get(CameraCharacteristics.LENS_INFO_SHADING_MAP_SIZE));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.lens.info.shadingMapSize", allKeys.contains(
CameraCharacteristics.LENS_INFO_SHADING_MAP_SIZE));
}
}
}
public void testCameraCharacteristicsAndroidLensInfoFocusDistanceCalibration() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.lens.info.focusDistanceCalibration",
props.get(CameraCharacteristics.LENS_INFO_FOCUS_DISTANCE_CALIBRATION));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.lens.info.focusDistanceCalibration", allKeys.contains(
CameraCharacteristics.LENS_INFO_FOCUS_DISTANCE_CALIBRATION));
}
}
}
public void testCameraCharacteristicsAndroidRequestMaxNumOutputStreams() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.request.maxNumOutputStreams",
props.get(CameraCharacteristics.REQUEST_MAX_NUM_OUTPUT_STREAMS));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.request.maxNumOutputStreams", allKeys.contains(
CameraCharacteristics.REQUEST_MAX_NUM_OUTPUT_STREAMS));
}
}
}
public void testCameraCharacteristicsAndroidRequestMaxNumInputStreams() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.request.maxNumInputStreams",
props.get(CameraCharacteristics.REQUEST_MAX_NUM_INPUT_STREAMS));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.request.maxNumInputStreams", allKeys.contains(
CameraCharacteristics.REQUEST_MAX_NUM_INPUT_STREAMS));
}
}
}
public void testCameraCharacteristicsAndroidRequestPipelineMaxDepth() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.request.pipelineMaxDepth",
props.get(CameraCharacteristics.REQUEST_PIPELINE_MAX_DEPTH));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.request.pipelineMaxDepth", allKeys.contains(
CameraCharacteristics.REQUEST_PIPELINE_MAX_DEPTH));
}
}
}
public void testCameraCharacteristicsAndroidRequestPartialResultCount() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.request.partialResultCount",
props.get(CameraCharacteristics.REQUEST_PARTIAL_RESULT_COUNT));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.request.partialResultCount", allKeys.contains(
CameraCharacteristics.REQUEST_PARTIAL_RESULT_COUNT));
}
}
}
public void testCameraCharacteristicsAndroidRequestAvailableCapabilities() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.request.availableCapabilities",
props.get(CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.request.availableCapabilities", allKeys.contains(
CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES));
}
}
}
public void testCameraCharacteristicsAndroidScalerAvailableFormats() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.scaler.availableFormats",
props.get(CameraCharacteristics.SCALER_AVAILABLE_FORMATS));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.scaler.availableFormats", allKeys.contains(
CameraCharacteristics.SCALER_AVAILABLE_FORMATS));
}
}
}
public void testCameraCharacteristicsAndroidScalerAvailableJpegMinDurations() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.scaler.availableJpegMinDurations",
props.get(CameraCharacteristics.SCALER_AVAILABLE_JPEG_MIN_DURATIONS));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.scaler.availableJpegMinDurations", allKeys.contains(
CameraCharacteristics.SCALER_AVAILABLE_JPEG_MIN_DURATIONS));
}
}
}
public void testCameraCharacteristicsAndroidScalerAvailableJpegSizes() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.scaler.availableJpegSizes",
props.get(CameraCharacteristics.SCALER_AVAILABLE_JPEG_SIZES));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.scaler.availableJpegSizes", allKeys.contains(
CameraCharacteristics.SCALER_AVAILABLE_JPEG_SIZES));
}
}
}
public void testCameraCharacteristicsAndroidScalerAvailableMaxDigitalZoom() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.scaler.availableMaxDigitalZoom",
props.get(CameraCharacteristics.SCALER_AVAILABLE_MAX_DIGITAL_ZOOM));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.scaler.availableMaxDigitalZoom", allKeys.contains(
CameraCharacteristics.SCALER_AVAILABLE_MAX_DIGITAL_ZOOM));
}
}
}
public void testCameraCharacteristicsAndroidScalerAvailableProcessedMinDurations() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.scaler.availableProcessedMinDurations",
props.get(CameraCharacteristics.SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.scaler.availableProcessedMinDurations", allKeys.contains(
CameraCharacteristics.SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS));
}
}
}
public void testCameraCharacteristicsAndroidScalerAvailableProcessedSizes() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.scaler.availableProcessedSizes",
props.get(CameraCharacteristics.SCALER_AVAILABLE_PROCESSED_SIZES));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.scaler.availableProcessedSizes", allKeys.contains(
CameraCharacteristics.SCALER_AVAILABLE_PROCESSED_SIZES));
}
}
}
public void testCameraCharacteristicsAndroidScalerAvailableInputOutputFormatsMap() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.scaler.availableInputOutputFormatsMap",
props.get(CameraCharacteristics.SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.scaler.availableInputOutputFormatsMap", allKeys.contains(
CameraCharacteristics.SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP));
}
}
}
public void testCameraCharacteristicsAndroidScalerAvailableStreamConfigurations() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.scaler.availableStreamConfigurations",
props.get(CameraCharacteristics.SCALER_AVAILABLE_STREAM_CONFIGURATIONS));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.scaler.availableStreamConfigurations", allKeys.contains(
CameraCharacteristics.SCALER_AVAILABLE_STREAM_CONFIGURATIONS));
}
}
}
public void testCameraCharacteristicsAndroidScalerAvailableMinFrameDurations() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.scaler.availableMinFrameDurations",
props.get(CameraCharacteristics.SCALER_AVAILABLE_MIN_FRAME_DURATIONS));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.scaler.availableMinFrameDurations", allKeys.contains(
CameraCharacteristics.SCALER_AVAILABLE_MIN_FRAME_DURATIONS));
}
}
}
public void testCameraCharacteristicsAndroidScalerAvailableStallDurations() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.scaler.availableStallDurations",
props.get(CameraCharacteristics.SCALER_AVAILABLE_STALL_DURATIONS));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.scaler.availableStallDurations", allKeys.contains(
CameraCharacteristics.SCALER_AVAILABLE_STALL_DURATIONS));
}
}
}
public void testCameraCharacteristicsAndroidSensorBaseGainFactor() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
Integer hwLevel = props.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL);
assertNotNull("No hardware level reported! android.info.supportedHardwareLevel",
hwLevel);
if (hwLevel == CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL)
{
assertNotNull("Invalid property: android.sensor.baseGainFactor",
props.get(CameraCharacteristics.SENSOR_BASE_GAIN_FACTOR));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.sensor.baseGainFactor", allKeys.contains(
CameraCharacteristics.SENSOR_BASE_GAIN_FACTOR));
}
}
}
public void testCameraCharacteristicsAndroidSensorBlackLevelPattern() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.sensor.blackLevelPattern",
props.get(CameraCharacteristics.SENSOR_BLACK_LEVEL_PATTERN));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.sensor.blackLevelPattern", allKeys.contains(
CameraCharacteristics.SENSOR_BLACK_LEVEL_PATTERN));
}
}
}
public void testCameraCharacteristicsAndroidSensorMaxAnalogSensitivity() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
Integer hwLevel = props.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL);
assertNotNull("No hardware level reported! android.info.supportedHardwareLevel",
hwLevel);
if (hwLevel == CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL)
{
assertNotNull("Invalid property: android.sensor.maxAnalogSensitivity",
props.get(CameraCharacteristics.SENSOR_MAX_ANALOG_SENSITIVITY));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.sensor.maxAnalogSensitivity", allKeys.contains(
CameraCharacteristics.SENSOR_MAX_ANALOG_SENSITIVITY));
}
}
}
public void testCameraCharacteristicsAndroidSensorOrientation() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.sensor.orientation",
props.get(CameraCharacteristics.SENSOR_ORIENTATION));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.sensor.orientation", allKeys.contains(
CameraCharacteristics.SENSOR_ORIENTATION));
}
}
}
public void testCameraCharacteristicsAndroidSensorAvailableTestPatternModes() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
Integer hwLevel = props.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL);
assertNotNull("No hardware level reported! android.info.supportedHardwareLevel",
hwLevel);
if (hwLevel == CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_FULL)
{
assertNotNull("Invalid property: android.sensor.availableTestPatternModes",
props.get(CameraCharacteristics.SENSOR_AVAILABLE_TEST_PATTERN_MODES));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.sensor.availableTestPatternModes", allKeys.contains(
CameraCharacteristics.SENSOR_AVAILABLE_TEST_PATTERN_MODES));
}
}
}
public void testCameraCharacteristicsAndroidSensorInfoActiveArraySize() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.sensor.info.activeArraySize",
props.get(CameraCharacteristics.SENSOR_INFO_ACTIVE_ARRAY_SIZE));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.sensor.info.activeArraySize", allKeys.contains(
CameraCharacteristics.SENSOR_INFO_ACTIVE_ARRAY_SIZE));
}
}
}
public void testCameraCharacteristicsAndroidSensorInfoSensitivityRange() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.sensor.info.sensitivityRange",
props.get(CameraCharacteristics.SENSOR_INFO_SENSITIVITY_RANGE));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.sensor.info.sensitivityRange", allKeys.contains(
CameraCharacteristics.SENSOR_INFO_SENSITIVITY_RANGE));
}
}
}
public void testCameraCharacteristicsAndroidSensorInfoExposureTimeRange() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.sensor.info.exposureTimeRange",
props.get(CameraCharacteristics.SENSOR_INFO_EXPOSURE_TIME_RANGE));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.sensor.info.exposureTimeRange", allKeys.contains(
CameraCharacteristics.SENSOR_INFO_EXPOSURE_TIME_RANGE));
}
}
}
public void testCameraCharacteristicsAndroidSensorInfoMaxFrameDuration() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.sensor.info.maxFrameDuration",
props.get(CameraCharacteristics.SENSOR_INFO_MAX_FRAME_DURATION));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.sensor.info.maxFrameDuration", allKeys.contains(
CameraCharacteristics.SENSOR_INFO_MAX_FRAME_DURATION));
}
}
}
public void testCameraCharacteristicsAndroidSensorInfoPhysicalSize() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.sensor.info.physicalSize",
props.get(CameraCharacteristics.SENSOR_INFO_PHYSICAL_SIZE));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.sensor.info.physicalSize", allKeys.contains(
CameraCharacteristics.SENSOR_INFO_PHYSICAL_SIZE));
}
}
}
public void testCameraCharacteristicsAndroidStatisticsInfoAvailableFaceDetectModes() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.statistics.info.availableFaceDetectModes",
props.get(CameraCharacteristics.STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.statistics.info.availableFaceDetectModes", allKeys.contains(
CameraCharacteristics.STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES));
}
}
}
public void testCameraCharacteristicsAndroidStatisticsInfoMaxFaceCount() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.statistics.info.maxFaceCount",
props.get(CameraCharacteristics.STATISTICS_INFO_MAX_FACE_COUNT));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.statistics.info.maxFaceCount", allKeys.contains(
CameraCharacteristics.STATISTICS_INFO_MAX_FACE_COUNT));
}
}
}
public void testCameraCharacteristicsAndroidTonemapMaxCurvePoints() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.tonemap.maxCurvePoints",
props.get(CameraCharacteristics.TONEMAP_MAX_CURVE_POINTS));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.tonemap.maxCurvePoints", allKeys.contains(
CameraCharacteristics.TONEMAP_MAX_CURVE_POINTS));
}
}
}
public void testCameraCharacteristicsAndroidInfoSupportedHardwareLevel() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.info.supportedHardwareLevel",
props.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.info.supportedHardwareLevel", allKeys.contains(
CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL));
}
}
}
public void testCameraCharacteristicsAndroidSyncMaxLatency() throws Exception {
String[] ids = mCameraManager.getCameraIdList();
for (int i = 0; i < ids.length; i++) {
CameraCharacteristics props = mCameraManager.getCameraCharacteristics(ids[i]);
assertNotNull(String.format("Can't get camera characteristics from: ID %s", ids[i]),
props);
{
assertNotNull("Invalid property: android.sync.maxLatency",
props.get(CameraCharacteristics.SYNC_MAX_LATENCY));
List<Key<?>> allKeys = props.getKeys();
assertNotNull(String.format("Can't get camera characteristics keys from: ID %s",
ids[i], props));
assertTrue("Key not in keys list: android.sync.maxLatency", allKeys.contains(
CameraCharacteristics.SYNC_MAX_LATENCY));
}
}
}
}