Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 332b01e0 authored by Eino-Ville Talvala's avatar Eino-Ville Talvala Committed by Android Git Automerger
Browse files

am 92a92a93: am 678e4328: Merge "Camera2: Fix parallel session and device...

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

* commit '92a92a93c09d0e1f405d292560f32b2f3a4dc62d':
  Camera2: Fix parallel session and device close() exception
parents 49b14f08 8883ada9
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -657,9 +657,9 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
                    }
                    }


                    // Slow path: #close was called explicitly on this session; unconfigure first
                    // Slow path: #close was called explicitly on this session; unconfigure first
                    mUnconfigureDrainer.taskStarted();


                    try {
                    try {
                        mUnconfigureDrainer.taskStarted();
                        mDeviceImpl
                        mDeviceImpl
                                .configureOutputsChecked(null); // begin transition to unconfigured
                                .configureOutputsChecked(null); // begin transition to unconfigured
                    } catch (CameraAccessException e) {
                    } catch (CameraAccessException e) {
@@ -667,6 +667,11 @@ public class CameraCaptureSessionImpl extends CameraCaptureSession {
                        Log.e(TAG, mIdString + "Exception while configuring outputs: ", e);
                        Log.e(TAG, mIdString + "Exception while configuring outputs: ", e);


                        // TODO: call onError instead of onClosed if this happens
                        // 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();
                    mUnconfigureDrainer.beginDrain();