| /* |
| * 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.CameraDevice; |
| import android.hardware.camera2.CameraManager; |
| import android.os.Handler; |
| import android.test.AndroidTestCase; |
| |
| /** |
| * Auto-generated CTS test for CameraCharacteristics fields. |
| */ |
| public class CameraCharacteristicsTest extends AndroidTestCase { |
| private CameraManager mCameraManager; |
| |
| private CameraTestThread mLooperThread; |
| private Handler mHandler; |
| |
| @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(); |
| |
| mLooperThread = new CameraTestThread(); |
| mHandler = mLooperThread.start(); |
| } |
| |
| @Override |
| protected void tearDown() throws Exception { |
| mLooperThread.close(); |
| mHandler = null; |
| |
| super.tearDown(); |
| } |
| |
| public void testCameraCharacteristicsAndroidControlAeAvailableAntibandingModes() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.control.aeAvailableAntibandingModes", |
| props.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_ANTIBANDING_MODES)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidControlAeAvailableTargetFpsRanges() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.control.aeAvailableTargetFpsRanges", |
| props.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidControlAeCompensationRange() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.control.aeCompensationRange", |
| props.get(CameraCharacteristics.CONTROL_AE_COMPENSATION_RANGE)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidControlAeCompensationStep() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.control.aeCompensationStep", |
| props.get(CameraCharacteristics.CONTROL_AE_COMPENSATION_STEP)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidControlAfAvailableModes() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.control.afAvailableModes", |
| props.get(CameraCharacteristics.CONTROL_AF_AVAILABLE_MODES)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidControlAvailableEffects() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.control.availableEffects", |
| props.get(CameraCharacteristics.CONTROL_AVAILABLE_EFFECTS)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidControlAvailableSceneModes() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.control.availableSceneModes", |
| props.get(CameraCharacteristics.CONTROL_AVAILABLE_SCENE_MODES)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidControlAvailableVideoStabilizationModes() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.control.availableVideoStabilizationModes", |
| props.get(CameraCharacteristics.CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidControlAwbAvailableModes() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.control.awbAvailableModes", |
| props.get(CameraCharacteristics.CONTROL_AWB_AVAILABLE_MODES)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidControlMaxRegions() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.control.maxRegions", |
| props.get(CameraCharacteristics.CONTROL_MAX_REGIONS)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidFlashInfoAvailable() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.flash.info.available", |
| props.get(CameraCharacteristics.FLASH_INFO_AVAILABLE)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidJpegAvailableThumbnailSizes() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.jpeg.availableThumbnailSizes", |
| props.get(CameraCharacteristics.JPEG_AVAILABLE_THUMBNAIL_SIZES)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidLensFacing() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.lens.facing", |
| props.get(CameraCharacteristics.LENS_FACING)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidLensInfoAvailableApertures() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.lens.info.availableApertures", |
| props.get(CameraCharacteristics.LENS_INFO_AVAILABLE_APERTURES)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidLensInfoAvailableFilterDensities() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.lens.info.availableFilterDensities", |
| props.get(CameraCharacteristics.LENS_INFO_AVAILABLE_FILTER_DENSITIES)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidLensInfoAvailableFocalLengths() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.lens.info.availableFocalLengths", |
| props.get(CameraCharacteristics.LENS_INFO_AVAILABLE_FOCAL_LENGTHS)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidLensInfoAvailableOpticalStabilization() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.lens.info.availableOpticalStabilization", |
| props.get(CameraCharacteristics.LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidLensInfoHyperfocalDistance() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.lens.info.hyperfocalDistance", |
| props.get(CameraCharacteristics.LENS_INFO_HYPERFOCAL_DISTANCE)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidLensInfoMinimumFocusDistance() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.lens.info.minimumFocusDistance", |
| props.get(CameraCharacteristics.LENS_INFO_MINIMUM_FOCUS_DISTANCE)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidLensInfoShadingMapSize() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.lens.info.shadingMapSize", |
| props.get(CameraCharacteristics.LENS_INFO_SHADING_MAP_SIZE)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidRequestMaxNumOutputStreams() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.request.maxNumOutputStreams", |
| props.get(CameraCharacteristics.REQUEST_MAX_NUM_OUTPUT_STREAMS)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidScalerAvailableFormats() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.scaler.availableFormats", |
| props.get(CameraCharacteristics.SCALER_AVAILABLE_FORMATS)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidScalerAvailableJpegMinDurations() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.scaler.availableJpegMinDurations", |
| props.get(CameraCharacteristics.SCALER_AVAILABLE_JPEG_MIN_DURATIONS)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidScalerAvailableJpegSizes() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.scaler.availableJpegSizes", |
| props.get(CameraCharacteristics.SCALER_AVAILABLE_JPEG_SIZES)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidScalerAvailableMaxDigitalZoom() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.scaler.availableMaxDigitalZoom", |
| props.get(CameraCharacteristics.SCALER_AVAILABLE_MAX_DIGITAL_ZOOM)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidScalerAvailableProcessedMinDurations() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.scaler.availableProcessedMinDurations", |
| props.get(CameraCharacteristics.SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidScalerAvailableProcessedSizes() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.scaler.availableProcessedSizes", |
| props.get(CameraCharacteristics.SCALER_AVAILABLE_PROCESSED_SIZES)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidSensorBaseGainFactor() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.sensor.baseGainFactor", |
| props.get(CameraCharacteristics.SENSOR_BASE_GAIN_FACTOR)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidSensorMaxAnalogSensitivity() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.sensor.maxAnalogSensitivity", |
| props.get(CameraCharacteristics.SENSOR_MAX_ANALOG_SENSITIVITY)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidSensorOrientation() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.sensor.orientation", |
| props.get(CameraCharacteristics.SENSOR_ORIENTATION)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidSensorInfoActiveArraySize() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.sensor.info.activeArraySize", |
| props.get(CameraCharacteristics.SENSOR_INFO_ACTIVE_ARRAY_SIZE)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidSensorInfoSensitivityRange() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.sensor.info.sensitivityRange", |
| props.get(CameraCharacteristics.SENSOR_INFO_SENSITIVITY_RANGE)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidSensorInfoExposureTimeRange() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.sensor.info.exposureTimeRange", |
| props.get(CameraCharacteristics.SENSOR_INFO_EXPOSURE_TIME_RANGE)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidSensorInfoMaxFrameDuration() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.sensor.info.maxFrameDuration", |
| props.get(CameraCharacteristics.SENSOR_INFO_MAX_FRAME_DURATION)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidSensorInfoPhysicalSize() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.sensor.info.physicalSize", |
| props.get(CameraCharacteristics.SENSOR_INFO_PHYSICAL_SIZE)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidStatisticsInfoAvailableFaceDetectModes() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.statistics.info.availableFaceDetectModes", |
| props.get(CameraCharacteristics.STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidStatisticsInfoMaxFaceCount() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.statistics.info.maxFaceCount", |
| props.get(CameraCharacteristics.STATISTICS_INFO_MAX_FACE_COUNT)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidTonemapMaxCurvePoints() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.tonemap.maxCurvePoints", |
| props.get(CameraCharacteristics.TONEMAP_MAX_CURVE_POINTS)); |
| } |
| } |
| |
| public void testCameraCharacteristicsAndroidInfoSupportedHardwareLevel() throws Exception { |
| String[] ids = mCameraManager.getCameraIdList(); |
| for (int i = 0; i < ids.length; i++) { |
| CameraDevice camera = CameraTestUtils.openCamera(mCameraManager, ids[i], mHandler); |
| assertNotNull("Failed to open camera", camera); |
| CameraCharacteristics props; |
| try { |
| props = camera.getProperties(); |
| } |
| finally { |
| camera.close(); |
| } |
| assertNotNull(String.format("Can't get camera properties from: ID %s", ids[i]), |
| props); |
| assertNotNull("Invalid property: android.info.supportedHardwareLevel", |
| props.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL)); |
| } |
| } |
| } |
| |