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

Commit c346bbf7 authored by Eino-Ville Talvala's avatar Eino-Ville Talvala
Browse files

Camera2: Make sure aborting captures on an idle device works.

Check if device is already idle, and if so, don't actually flush,
just fire the busy/idle callbacks to the session.

Bug: 17306157
Change-Id: I7ba416c6014c7bc1edcad07910aa0aff232af8b0
parent acc0095b
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -721,6 +721,13 @@ public class CameraDeviceImpl extends CameraDevice {
            checkIfCameraClosedOrInError();

            mDeviceHandler.post(mCallOnBusy);

            // If already idle, just do a busy->idle transition immediately, don't actually
            // flush.
            if (mIdle) {
                mDeviceHandler.post(mCallOnIdle);
                return;
            }
            try {
                LongParcelable lastFrameNumberRef = new LongParcelable();
                mRemoteDevice.flush(/*out*/lastFrameNumberRef);