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

Commit 6b51d7d1 authored by Emilian Peev's avatar Emilian Peev
Browse files

Camera: Flush in-flight requests during device detach

Improve performance during device detach by flushing all
camera requests.

Bug: 80402005
Test: Camera CTS

Change-Id: I3a6864575b1533c77b5478c2390a908892700f6e
parent 999ad2cf
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);