Index: webrtc/api/android/java/src/org/webrtc/Camera2Session.java |
diff --git a/webrtc/api/android/java/src/org/webrtc/Camera2Session.java b/webrtc/api/android/java/src/org/webrtc/Camera2Session.java |
index 6ff73c5aedb18d47d1241d8a60a875356260ec5f..ad4ffd69b11a29a6b03b97cfb730eacd70b7a33c 100644 |
--- a/webrtc/api/android/java/src/org/webrtc/Camera2Session.java |
+++ b/webrtc/api/android/java/src/org/webrtc/Camera2Session.java |
@@ -98,7 +98,14 @@ public class Camera2Session implements CameraSession { |
@Override |
public void onDisconnected(CameraDevice camera) { |
checkIsOnCameraThread(); |
- reportError("Camera disconnected."); |
+ final boolean startFailure = (captureSession == null); |
+ state = SessionState.STOPPED; |
+ stopInternal(); |
+ if (startFailure) { |
+ callback.onFailure("Camera disconnected / evicted."); |
+ } else { |
+ events.onCameraDisconnected(Camera2Session.this); |
+ } |
} |
@Override |