Make stopPreview synchronous.
bug:8517092
Change-Id: I66d218e206dab8ad8c80f61ca480923a6be0b0b6
diff --git a/src/com/android/camera/CameraManager.java b/src/com/android/camera/CameraManager.java
index be82ea6..a26a51c 100644
--- a/src/com/android/camera/CameraManager.java
+++ b/src/com/android/camera/CameraManager.java
@@ -334,8 +334,11 @@
mCameraHandler.sendEmptyMessage(START_PREVIEW_ASYNC);
}
+ // stopPreview() is synchronous because many resources should be released after
+ // the preview is stopped.
public void stopPreview() {
mCameraHandler.sendEmptyMessage(STOP_PREVIEW);
+ waitDone();
}
public void setPreviewCallback(final PreviewCallback cb) {