Broaden exception handling around Camera#startPreview().

Some devices will randomly throw RuntimeExceptions here due to hardware
issues. We were already doing broader catch statement in CameraView, so
I moved it here as well.
This commit is contained in:
Greyson Parrelli 2018-10-02 12:47:03 -07:00
parent 444e01deae
commit 5a623810cb

View File

@ -78,7 +78,7 @@ public class Camera1Controller {
camera.setPreviewTexture(surfaceTexture);
camera.startPreview();
enforcer.markCompleted(Stage.PREVIEW_STARTED);
} catch (IOException e) {
} catch (Exception e) {
Log.w(TAG, "Failed to start preview.", e);
eventListener.onCameraUnavailable();
}