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

Commit 6a3e6717 authored by Marissa Wall's avatar Marissa Wall
Browse files

SF: fix SurfaceFlinger freeze

When BufferQueueLayer errors in onFrameAvailable and
onFrameReplaced, it infinitely loops. This patch adds
a break when we get into the bad state.

Bug: 147476322
Test: verified by vendor that this fixes their bug
      and SurfaceFlinger_test

Change-Id: Ida063470edc7e688d106ec9fbac3c81bc5e00189
parent f1cd150e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -433,6 +433,7 @@ void BufferQueueLayer::onFrameAvailable(const BufferItem& item) {
            status_t result = mQueueItemCondition.waitRelative(mQueueItemLock, ms2ns(500));
            if (result != NO_ERROR) {
                ALOGE("[%s] Timed out waiting on callback", getDebugName());
                break;
            }
        }

@@ -461,6 +462,7 @@ void BufferQueueLayer::onFrameReplaced(const BufferItem& item) {
            status_t result = mQueueItemCondition.waitRelative(mQueueItemLock, ms2ns(500));
            if (result != NO_ERROR) {
                ALOGE("[%s] Timed out waiting on callback", getDebugName());
                break;
            }
        }