DO NOT MERGE: 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
(cherry picked from commit 6a3e6717cee02a93d8f8f108d38d546bd20b87b1)
diff --git a/services/surfaceflinger/BufferQueueLayer.cpp b/services/surfaceflinger/BufferQueueLayer.cpp
index f35a4fd..eb1bf66 100644
--- a/services/surfaceflinger/BufferQueueLayer.cpp
+++ b/services/surfaceflinger/BufferQueueLayer.cpp
@@ -461,6 +461,7 @@
status_t result = mQueueItemCondition.waitRelative(mQueueItemLock, ms2ns(500));
if (result != NO_ERROR) {
ALOGE("[%s] Timed out waiting on callback", mName.string());
+ break;
}
}
@@ -495,6 +496,7 @@
status_t result = mQueueItemCondition.waitRelative(mQueueItemLock, ms2ns(500));
if (result != NO_ERROR) {
ALOGE("[%s] Timed out waiting on callback", mName.string());
+ break;
}
}