use of com.android.ex.camera2.blocking.BlockingStateCallback 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);
}
use of com.android.ex.camera2.blocking.BlockingStateCallback 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);
}
use of com.android.ex.camera2.blocking.BlockingStateCallback 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);
}
use of com.android.ex.camera2.blocking.BlockingStateCallback 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);
}
use of com.android.ex.camera2.blocking.BlockingStateCallback 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);
}
Aggregations