Search in sources :

Example 1 with CameraErrorCollector

use of com.android.mediaframeworktest.helpers.CameraErrorCollector in project platform_frameworks_base by android.

the class Camera2SurfaceViewTestCase method setUp.

@Override
protected void setUp() throws Exception {
    /**
         * Set up the camera preview required environments, including activity,
         * CameraManager, HandlerThread, Camera IDs, and CameraStateCallback.
         */
    super.setUp();
    mContext = getActivity();
    /**
         * Workaround for mockito and JB-MR2 incompatibility
         *
         * Avoid java.lang.IllegalArgumentException: dexcache == null
         * https://code.google.com/p/dexmaker/issues/detail?id=2
         */
    System.setProperty("dexmaker.dexcache", mContext.getCacheDir().toString());
    mCameraManager = (CameraManager) mContext.getSystemService(Context.CAMERA_SERVICE);
    assertNotNull("Unable to get CameraManager", mCameraManager);
    mCameraIds = mCameraManager.getCameraIdList();
    assertNotNull("Unable to get camera ids", mCameraIds);
    mHandlerThread = new HandlerThread(TAG);
    mHandlerThread.start();
    mHandler = new Handler(mHandlerThread.getLooper());
    mCameraListener = new BlockingStateCallback();
    mCollector = new CameraErrorCollector();
    mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
    mIterations = getArgumentsAsNumber(ARG_KEY_ITERATIONS, 1).intValue();
    mTestWaitIntervalMs = getArgumentsAsNumber(ARG_KEY_WAIT_INTERVAL_MS, 1000).longValue();
    mWriteToFile = getArgumentsAsBoolean(ARG_KEY_RESULT_TO_FILE, true);
    Log.i(TAG, "Argument: iteration count=" + mIterations);
    Log.i(TAG, "Argument: interval (ms)=" + mTestWaitIntervalMs);
    Log.i(TAG, "Argument: result to file=" + (mWriteToFile ? "true" : "false"));
    mResultPrinter = new CameraTestResultPrinter(getInstrumentation(), mWriteToFile);
}
Also used : HandlerThread(android.os.HandlerThread) BlockingStateCallback(com.android.ex.camera2.blocking.BlockingStateCallback) Handler(android.os.Handler) CameraErrorCollector(com.android.mediaframeworktest.helpers.CameraErrorCollector) CameraTestResultPrinter(com.android.mediaframeworktest.helpers.CameraTestResultPrinter)

Example 2 with CameraErrorCollector

use of com.android.mediaframeworktest.helpers.CameraErrorCollector in project android_frameworks_base by DirtyUnicorns.

the class Camera2SurfaceViewTestCase method setUp.

@Override
protected void setUp() throws Exception {
    /**
         * Set up the camera preview required environments, including activity,
         * CameraManager, HandlerThread, Camera IDs, and CameraStateCallback.
         */
    super.setUp();
    mContext = getActivity();
    /**
         * Workaround for mockito and JB-MR2 incompatibility
         *
         * Avoid java.lang.IllegalArgumentException: dexcache == null
         * https://code.google.com/p/dexmaker/issues/detail?id=2
         */
    System.setProperty("dexmaker.dexcache", mContext.getCacheDir().toString());
    mCameraManager = (CameraManager) mContext.getSystemService(Context.CAMERA_SERVICE);
    assertNotNull("Unable to get CameraManager", mCameraManager);
    mCameraIds = mCameraManager.getCameraIdList();
    assertNotNull("Unable to get camera ids", mCameraIds);
    mHandlerThread = new HandlerThread(TAG);
    mHandlerThread.start();
    mHandler = new Handler(mHandlerThread.getLooper());
    mCameraListener = new BlockingStateCallback();
    mCollector = new CameraErrorCollector();
    mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
    mIterations = getArgumentsAsNumber(ARG_KEY_ITERATIONS, 1).intValue();
    mTestWaitIntervalMs = getArgumentsAsNumber(ARG_KEY_WAIT_INTERVAL_MS, 1000).longValue();
    mWriteToFile = getArgumentsAsBoolean(ARG_KEY_RESULT_TO_FILE, true);
    Log.i(TAG, "Argument: iteration count=" + mIterations);
    Log.i(TAG, "Argument: interval (ms)=" + mTestWaitIntervalMs);
    Log.i(TAG, "Argument: result to file=" + (mWriteToFile ? "true" : "false"));
    mResultPrinter = new CameraTestResultPrinter(getInstrumentation(), mWriteToFile);
}
Also used : HandlerThread(android.os.HandlerThread) BlockingStateCallback(com.android.ex.camera2.blocking.BlockingStateCallback) Handler(android.os.Handler) CameraErrorCollector(com.android.mediaframeworktest.helpers.CameraErrorCollector) CameraTestResultPrinter(com.android.mediaframeworktest.helpers.CameraTestResultPrinter)

Example 3 with CameraErrorCollector

use of com.android.mediaframeworktest.helpers.CameraErrorCollector in project android_frameworks_base by crdroidandroid.

the class Camera2SurfaceViewTestCase method setUp.

@Override
protected void setUp() throws Exception {
    /**
         * Set up the camera preview required environments, including activity,
         * CameraManager, HandlerThread, Camera IDs, and CameraStateCallback.
         */
    super.setUp();
    mContext = getActivity();
    /**
         * Workaround for mockito and JB-MR2 incompatibility
         *
         * Avoid java.lang.IllegalArgumentException: dexcache == null
         * https://code.google.com/p/dexmaker/issues/detail?id=2
         */
    System.setProperty("dexmaker.dexcache", mContext.getCacheDir().toString());
    mCameraManager = (CameraManager) mContext.getSystemService(Context.CAMERA_SERVICE);
    assertNotNull("Unable to get CameraManager", mCameraManager);
    mCameraIds = mCameraManager.getCameraIdList();
    assertNotNull("Unable to get camera ids", mCameraIds);
    mHandlerThread = new HandlerThread(TAG);
    mHandlerThread.start();
    mHandler = new Handler(mHandlerThread.getLooper());
    mCameraListener = new BlockingStateCallback();
    mCollector = new CameraErrorCollector();
    mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
    mIterations = getArgumentsAsNumber(ARG_KEY_ITERATIONS, 1).intValue();
    mTestWaitIntervalMs = getArgumentsAsNumber(ARG_KEY_WAIT_INTERVAL_MS, 1000).longValue();
    mWriteToFile = getArgumentsAsBoolean(ARG_KEY_RESULT_TO_FILE, true);
    Log.i(TAG, "Argument: iteration count=" + mIterations);
    Log.i(TAG, "Argument: interval (ms)=" + mTestWaitIntervalMs);
    Log.i(TAG, "Argument: result to file=" + (mWriteToFile ? "true" : "false"));
    mResultPrinter = new CameraTestResultPrinter(getInstrumentation(), mWriteToFile);
}
Also used : HandlerThread(android.os.HandlerThread) BlockingStateCallback(com.android.ex.camera2.blocking.BlockingStateCallback) Handler(android.os.Handler) CameraErrorCollector(com.android.mediaframeworktest.helpers.CameraErrorCollector) CameraTestResultPrinter(com.android.mediaframeworktest.helpers.CameraTestResultPrinter)

Example 4 with CameraErrorCollector

use of com.android.mediaframeworktest.helpers.CameraErrorCollector in project android_frameworks_base by AOSPA.

the class Camera2SurfaceViewTestCase method setUp.

@Override
protected void setUp() throws Exception {
    /**
         * Set up the camera preview required environments, including activity,
         * CameraManager, HandlerThread, Camera IDs, and CameraStateCallback.
         */
    super.setUp();
    mContext = getActivity();
    /**
         * Workaround for mockito and JB-MR2 incompatibility
         *
         * Avoid java.lang.IllegalArgumentException: dexcache == null
         * https://code.google.com/p/dexmaker/issues/detail?id=2
         */
    System.setProperty("dexmaker.dexcache", mContext.getCacheDir().toString());
    mCameraManager = (CameraManager) mContext.getSystemService(Context.CAMERA_SERVICE);
    assertNotNull("Unable to get CameraManager", mCameraManager);
    mCameraIds = mCameraManager.getCameraIdList();
    assertNotNull("Unable to get camera ids", mCameraIds);
    mHandlerThread = new HandlerThread(TAG);
    mHandlerThread.start();
    mHandler = new Handler(mHandlerThread.getLooper());
    mCameraListener = new BlockingStateCallback();
    mCollector = new CameraErrorCollector();
    mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
    mIterations = getArgumentsAsNumber(ARG_KEY_ITERATIONS, 1).intValue();
    mTestWaitIntervalMs = getArgumentsAsNumber(ARG_KEY_WAIT_INTERVAL_MS, 1000).longValue();
    mWriteToFile = getArgumentsAsBoolean(ARG_KEY_RESULT_TO_FILE, true);
    Log.i(TAG, "Argument: iteration count=" + mIterations);
    Log.i(TAG, "Argument: interval (ms)=" + mTestWaitIntervalMs);
    Log.i(TAG, "Argument: result to file=" + (mWriteToFile ? "true" : "false"));
    mResultPrinter = new CameraTestResultPrinter(getInstrumentation(), mWriteToFile);
}
Also used : HandlerThread(android.os.HandlerThread) BlockingStateCallback(com.android.ex.camera2.blocking.BlockingStateCallback) Handler(android.os.Handler) CameraErrorCollector(com.android.mediaframeworktest.helpers.CameraErrorCollector) CameraTestResultPrinter(com.android.mediaframeworktest.helpers.CameraTestResultPrinter)

Example 5 with CameraErrorCollector

use of com.android.mediaframeworktest.helpers.CameraErrorCollector in project android_frameworks_base by ResurrectionRemix.

the class Camera2SurfaceViewTestCase method setUp.

@Override
protected void setUp() throws Exception {
    /**
         * Set up the camera preview required environments, including activity,
         * CameraManager, HandlerThread, Camera IDs, and CameraStateCallback.
         */
    super.setUp();
    mContext = getActivity();
    /**
         * Workaround for mockito and JB-MR2 incompatibility
         *
         * Avoid java.lang.IllegalArgumentException: dexcache == null
         * https://code.google.com/p/dexmaker/issues/detail?id=2
         */
    System.setProperty("dexmaker.dexcache", mContext.getCacheDir().toString());
    mCameraManager = (CameraManager) mContext.getSystemService(Context.CAMERA_SERVICE);
    assertNotNull("Unable to get CameraManager", mCameraManager);
    mCameraIds = mCameraManager.getCameraIdList();
    assertNotNull("Unable to get camera ids", mCameraIds);
    mHandlerThread = new HandlerThread(TAG);
    mHandlerThread.start();
    mHandler = new Handler(mHandlerThread.getLooper());
    mCameraListener = new BlockingStateCallback();
    mCollector = new CameraErrorCollector();
    mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
    mIterations = getArgumentsAsNumber(ARG_KEY_ITERATIONS, 1).intValue();
    mTestWaitIntervalMs = getArgumentsAsNumber(ARG_KEY_WAIT_INTERVAL_MS, 1000).longValue();
    mWriteToFile = getArgumentsAsBoolean(ARG_KEY_RESULT_TO_FILE, true);
    Log.i(TAG, "Argument: iteration count=" + mIterations);
    Log.i(TAG, "Argument: interval (ms)=" + mTestWaitIntervalMs);
    Log.i(TAG, "Argument: result to file=" + (mWriteToFile ? "true" : "false"));
    mResultPrinter = new CameraTestResultPrinter(getInstrumentation(), mWriteToFile);
}
Also used : HandlerThread(android.os.HandlerThread) BlockingStateCallback(com.android.ex.camera2.blocking.BlockingStateCallback) Handler(android.os.Handler) CameraErrorCollector(com.android.mediaframeworktest.helpers.CameraErrorCollector) CameraTestResultPrinter(com.android.mediaframeworktest.helpers.CameraTestResultPrinter)

Aggregations

Handler (android.os.Handler)5 HandlerThread (android.os.HandlerThread)5 BlockingStateCallback (com.android.ex.camera2.blocking.BlockingStateCallback)5 CameraErrorCollector (com.android.mediaframeworktest.helpers.CameraErrorCollector)5 CameraTestResultPrinter (com.android.mediaframeworktest.helpers.CameraTestResultPrinter)5