From c9ca7011501cb8730ce4e6e527cb402adb7a0178 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Fri, 3 Feb 2012 17:22:09 -0800 Subject: [PATCH] attempt to fix an ANR in various apps recent changes in SF introduced a hang where some windows would stop being refreshed. This is an attemp to fix that. Change-Id: I6aa32ac0d6f1c0a6aea8f6195825dc4f4e6f93f9 --- services/surfaceflinger/SurfaceFlinger.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 870235bff..ee37efb03 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -425,12 +425,12 @@ void SurfaceFlinger::onMessageReceived(int32_t what) } break; case MessageQueue::REFRESH: { - if (!mDirtyRegion.isEmpty()) { - // NOTE: it is mandatory to call hw.compositionComplete() - // after handleRefresh() - handleRefresh(); + // NOTE: it is mandatory to call hw.compositionComplete() + // after handleRefresh() + const DisplayHardware& hw(graphicPlane(0).displayHardware()); + handleRefresh(); - const DisplayHardware& hw(graphicPlane(0).displayHardware()); + if (!mDirtyRegion.isEmpty()) { if (CC_UNLIKELY(mHwWorkListDirty)) { // build the h/w work list handleWorkList(); @@ -445,6 +445,8 @@ void SurfaceFlinger::onMessageReceived(int32_t what) // pretend we did the post hw.compositionComplete(); } + } else { + hw.compositionComplete(); } } break; }