diff --git a/src/org/thoughtcrime/securesms/webrtc/PeerConnectionWrapper.java b/src/org/thoughtcrime/securesms/webrtc/PeerConnectionWrapper.java index 7204296667..4b96a1096f 100644 --- a/src/org/thoughtcrime/securesms/webrtc/PeerConnectionWrapper.java +++ b/src/org/thoughtcrime/securesms/webrtc/PeerConnectionWrapper.java @@ -273,11 +273,18 @@ public class PeerConnectionWrapper { } private @Nullable CameraVideoCapturer createVideoCapturer(@NonNull Context context) { - Log.w(TAG, "Camera2 enumerator supported: " + Camera2Enumerator.isSupported(context)); + boolean camera2EnumeratorIsSupported = false; + try { + camera2EnumeratorIsSupported = Camera2Enumerator.isSupported(context); + } catch (final Throwable throwable) { + Log.w(TAG, "Camera2Enumator.isSupport() threw.", throwable); + } + + Log.w(TAG, "Camera2 enumerator supported: " + camera2EnumeratorIsSupported); CameraEnumerator enumerator; - if (Camera2Enumerator.isSupported(context)) enumerator = new Camera2Enumerator(context); - else enumerator = new Camera1Enumerator(true); + if (camera2EnumeratorIsSupported) enumerator = new Camera2Enumerator(context); + else enumerator = new Camera1Enumerator(true); String[] deviceNames = enumerator.getDeviceNames();