From 5a623810cb94069f4e7ca3edfd68418f26105074 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Tue, 2 Oct 2018 12:47:03 -0700 Subject: [PATCH] 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. --- src/org/thoughtcrime/securesms/camera/Camera1Controller.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/camera/Camera1Controller.java b/src/org/thoughtcrime/securesms/camera/Camera1Controller.java index 54b873375d..e00a530b41 100644 --- a/src/org/thoughtcrime/securesms/camera/Camera1Controller.java +++ b/src/org/thoughtcrime/securesms/camera/Camera1Controller.java @@ -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(); }