Bug 1042689 - Deal with a native stopCapture if the camera is paused. r=jesup

This commit is contained in:
Gian-Carlo Pascutto 2014-08-04 08:29:45 +02:00
parent e6440c8710
commit 2b1a58480d

View File

@ -224,6 +224,12 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback, AppStateL
private synchronized boolean stopCapture() {
Log.d(TAG, "stopCapture");
if (camera == null) {
if (mResumeCapture == true) {
// We already got onPause, but now the native code wants us to stop.
// Do not resume capturing when resuming the app.
mResumeCapture = false;
return true;
}
throw new RuntimeException("Camera is already stopped!");
}
Throwable error = null;