From 26bc908b3dafb5d80f092a22c5c71116526eae06 Mon Sep 17 00:00:00 2001 From: Eino-Ville Talvala Date: Thu, 13 Jun 2013 18:04:28 -0700 Subject: Camera2/3: Make sure to wait for idle after still capture. While this wait should be immediate, it's important to guarantee that preview is stopped when takePicture completes, and that the device knows itself to be idle. Bug: 9413025 Change-Id: I1c151ba920e226107ee048918187364990f444c0 --- services/camera/libcameraservice/camera2/CaptureSequencer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'services') diff --git a/services/camera/libcameraservice/camera2/CaptureSequencer.cpp b/services/camera/libcameraservice/camera2/CaptureSequencer.cpp index 266e516..e5a011c 100644 --- a/services/camera/libcameraservice/camera2/CaptureSequencer.cpp +++ b/services/camera/libcameraservice/camera2/CaptureSequencer.cpp @@ -253,6 +253,12 @@ CaptureSequencer::CaptureState CaptureSequencer::manageDone(sp &c res = INVALID_OPERATION; break; case Parameters::STILL_CAPTURE: + res = client->getCameraDevice()->waitUntilDrained(); + if (res != OK) { + ALOGE("%s: Camera %d: Can't idle after still capture: " + "%s (%d)", __FUNCTION__, client->getCameraId(), + strerror(-res), res); + } l.mParameters.state = Parameters::STOPPED; break; case Parameters::VIDEO_SNAPSHOT: -- cgit v1.1