From dc40d5cc81e8fe9aa1cd78a38ee8bb9e91ec49a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 9 Jul 2019 11:36:03 +0200 Subject: [PATCH] JITSI: catch exception in Camera2Enumerator.isSupported() Avoids this exception: Fatal Exception: java.lang.RuntimeException: Camera is being used after Camera.release() was called at android.hardware.Camera._enableShutterSound(Camera.java) at android.hardware.Camera.updateAppOpsPlayAudio + 1786(Camera.java:1786) at android.hardware.Camera.initAppOps + 598(Camera.java:598) at android.hardware.Camera.(Camera.java:591) at android.hardware.Camera.getEmptyParameters + 2146(Camera.java:2146) at android.hardware.camera2.legacy.LegacyMetadataMapper.createCharacteristics + 151(LegacyMetadataMapper.java:151) at android.hardware.camera2.CameraManager.getCameraCharacteristics + 347(CameraManager.java:347) at org.webrtc.Camera2Enumerator.isSupported + 116(Camera2Enumerator.java:116) --- sdk/android/api/org/webrtc/Camera2Enumerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/android/api/org/webrtc/Camera2Enumerator.java b/sdk/android/api/org/webrtc/Camera2Enumerator.java index b32b3ad302..28d457b1ca 100644 --- a/sdk/android/api/org/webrtc/Camera2Enumerator.java +++ b/sdk/android/api/org/webrtc/Camera2Enumerator.java @@ -123,7 +123,7 @@ public static boolean isSupported(Context context) { // On Android OS pre 4.4.2, a class will not load because of VerifyError if it contains a // catch statement with an Exception from a newer API, even if the code is never executed. // https://code.google.com/p/android/issues/detail?id=209129 - } catch (/* CameraAccessException */ AndroidException e) { + } catch (Exception e) { Logging.e(TAG, "Camera access exception: " + e); return false; }