Stop camera enumeration after finding first camera

The first one returned generally specifies the vendor's recommended
camera. We can also check lens focal length but it's not necessary.

Fixes: 112482387

Test: manual
Change-Id: Iab245f278ce1bf69ea95f7c081d20e837e84fe51
This commit is contained in:
Kevin Chyn
2018-08-13 18:32:47 -07:00
parent 22b4edd79e
commit 6ec727914f

View File

@@ -236,6 +236,7 @@ public class FaceEnrollPreviewFragment extends InstrumentedPreferenceFragment {
CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP); CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
mPreviewSize = chooseOptimalSize(map.getOutputSizes(SurfaceTexture.class), mPreviewSize = chooseOptimalSize(map.getOutputSizes(SurfaceTexture.class),
width, height, MAX_PREVIEW_WIDTH, MAX_PREVIEW_HEIGHT); width, height, MAX_PREVIEW_WIDTH, MAX_PREVIEW_HEIGHT);
break;
} }
} catch (CameraAccessException e) { } catch (CameraAccessException e) {
Log.e(TAG, "Unable to access camera", e); Log.e(TAG, "Unable to access camera", e);