Clear all pending transactions on screen wakeup
If an app sets a transaction that modifies layer state, but does not get
committed by an SF composition cycle, we may end up dangling some
callbacks. Temporary fix is to clear and send callbacks on wakeup
Bug: 141111965
Test: build, boot, manual
Change-Id: I781124c3f96174cefd5eb67e597c13f923df4fc1
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 76fd51f..7b4a972 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -3726,6 +3726,8 @@
if (currentMode == HWC_POWER_MODE_OFF) {
// Turn on the display
+ // TODO: @vhau temp fix only! See b/141111965
+ mTransactionCompletedThread.clearAllPending();
getHwComposer().setPowerMode(*displayId, mode);
if (display->isPrimary() && mode != HWC_POWER_MODE_DOZE_SUSPEND) {
setVsyncEnabledInHWC(*displayId, mHWCVsyncPendingState);