Skip to content

Commit

Permalink
JITSI: catch exception in Camera2Enumerator.isSupported()
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
saghul committed Jul 9, 2019
1 parent ad38305 commit 0cd6ce4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sdk/android/api/org/webrtc/Camera2Enumerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,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;
}
Expand Down

0 comments on commit 0cd6ce4

Please sign in to comment.