/**
* Why do we need this? This way we have no dependency on getNumCameras
* actually working. On most systems there are only 0, 1, or 2 cameras,
* and this covers that 'usual case'. On other systems there might be 3+
* cameras, but this will at least check the first 2.
*/
this.mGuessedNumCameras = 0;
// Front facing camera
if (CameraBinderTestUtils.isFeatureAvailable(mContext,
PackageManager.FEATURE_CAMERA_FRONT)) {
this.mGuessedNumCameras = getGuessedNumCameras() + 1;
}
// Back facing camera
if (CameraBinderTestUtils.isFeatureAvailable(mContext,
PackageManager.FEATURE_CAMERA)) {
this.mGuessedNumCameras = getGuessedNumCameras() + 1;
}
// Any facing camera
if (getGuessedNumCameras() == 0
&& CameraBinderTestUtils.isFeatureAvailable(mContext,
PackageManager.FEATURE_CAMERA_ANY)) {
this.mGuessedNumCameras = getGuessedNumCameras() + 1;
}
Log.v(CameraBinderTest.TAG, "Guessing there are at least " + getGuessedNumCameras()
+ " cameras");