From df0b91683d63f988036e214d2193d00fca31010c Mon Sep 17 00:00:00 2001 From: Corey Tabaka Date: Thu, 3 Aug 2017 17:14:08 -0700 Subject: Fix race condition clearing VSYNC enable on VrFlinger startup. Fix VrFlinger to avoid touching the VSYNC enable setting in HWC during startup by avoiding calling the cleanup code when entering idle state for the first time. Bug: 63626797 Test: Manual testing. Change-Id: I5320bd5c1febb51367e759a8619d35f155789628 --- libs/vr/libvrflinger/hardware_composer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/vr/libvrflinger/hardware_composer.cpp b/libs/vr/libvrflinger/hardware_composer.cpp index d937c889df..def9b7da33 100644 --- a/libs/vr/libvrflinger/hardware_composer.cpp +++ b/libs/vr/libvrflinger/hardware_composer.cpp @@ -821,8 +821,9 @@ void HardwareComposer::PostThread() { std::unique_lock lock(post_thread_mutex_); ALOGI("HardwareComposer::PostThread: Entering quiescent state."); - // Tear down resources. - OnPostThreadPaused(); + // Tear down resources if necessary. + if (was_running) + OnPostThreadPaused(); was_running = false; post_thread_resumed_ = false; -- cgit v1.2.3-59-g8ed1b