am 7741a3b7: am fdc04cc2: am 03b3a63f: am 92a92a93: am 678e4328: Merge "Camera2: Fix parallel session and device close() exception" into lmp-dev

* commit '7741a3b77b6918ea91b5e648992bfe72ff4de207':
  Camera2: Fix parallel session and device close() exception
This commit is contained in:
Eino-Ville Talvala
2014-09-29 19:46:47 +00:00
committed by Android Git Automerger

View File

@@ -657,9 +657,9 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
}
// Slow path: #close was called explicitly on this session; unconfigure first
mUnconfigureDrainer.taskStarted();
try {
mUnconfigureDrainer.taskStarted();
mDeviceImpl
.configureOutputsChecked(null); // begin transition to unconfigured
} catch (CameraAccessException e) {
@@ -667,6 +667,11 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
Log.e(TAG, mIdString + "Exception while configuring outputs: ", e);
// TODO: call onError instead of onClosed if this happens
} catch (IllegalStateException e) {
// Camera is already closed, so go straight to the close callback
if (VERBOSE) Log.v(TAG, mIdString +
"Camera was already closed or busy, skipping unconfigure");
mUnconfigureDrainer.taskFinished();
}
mUnconfigureDrainer.beginDrain();