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

Commit 0cc6d8c3 authored by Emilian Peev's avatar Emilian Peev Committed by android-build-merger
Browse files

Merge "Camera: Flush in-flight requests during device detach"

am: c8a6745a

Change-Id: I7417fffd9d274da05e77139a864907d3bebdeee3
parents c8525595 c8a6745a
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1677,9 +1677,12 @@ void CameraDeviceClient::detachDevice() {

    // WORKAROUND: HAL refuses to disconnect while there's streams in flight
    {
        mDevice->clearStreamingRequest();

        int64_t lastFrameNumber;
        status_t code;
        if ((code = mDevice->flush(&lastFrameNumber)) != OK) {
            ALOGE("%s: flush failed with code 0x%x", __FUNCTION__, code);
        }

        if ((code = mDevice->waitUntilDrained()) != OK) {
            ALOGE("%s: waitUntilDrained failed with code 0x%x", __FUNCTION__,
                  code);