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
Родитель e95941b7a3
Коммит 81f4f63679
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -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;