FileDocCategorySizeDatePackage
CameraOpenTest.javaAPI DocAndroid 5.1 API1751Thu Mar 12 22:22:30 GMT 2015com.android.mediaframeworktest.unit

CameraOpenTest

public class CameraOpenTest extends TestCase
adb shell am instrument \
-e class 'com.android.mediaframeworktest.unit.CameraOpenTest' \
-w com.android.mediaframeworktest/.MediaFrameworkUnitTestRunner

Fields Summary
private static String
TAG
private android.hardware.Camera
mCamera
Constructors Summary
Methods Summary
public voidtestOpenLegacy()
Test @hide android.hardware.Camera#openLegacy API that cannot be tested in CTS.


                   
    
       
        int nCameras = Camera.getNumberOfCameras();
        for (int id = 0; id < nCameras; id++) {
            try {
                mCamera.openLegacy(id, Camera.CAMERA_HAL_API_VERSION_1_0);
            } catch (RuntimeException e) {
                Log.i(TAG, "Unable to open camera as HAL1 legacy camera device " + e);
            } finally {
                if (mCamera != null) {
                    mCamera.release();
                }
            }
        }