Skip to content

Commit

Permalink
Broaden exception handling around Camera#startPreview().
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
greyson-signal committed Oct 2, 2018
1 parent 444e01d commit 5a62381
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void linkSurface(@NonNull SurfaceTexture surfaceTexture) {
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();
}
Expand Down

0 comments on commit 5a62381

Please sign in to comment.