From 4fe368575e19e11aa277e89e10cce139f4773a0e Mon Sep 17 00:00:00 2001 From: chaviw Date: Mon, 15 Apr 2019 16:25:49 -0700 Subject: Fix input window commands There were two fixes here: 1. InputWindowCommands were getting merged from pendingInputWindowCommands. This caused the old commands to continue getting applied. Instead inputWindowCommands gets set to pendingInputWindowCommands. 2. Only set mPendingSyncInputWindows to true if the transaction contains syncInputWindows. This is to prevent setting mPendingSyncInputWindows to false while waiting for a callback from InputDispatcher. Test: WindowInputTests Fixes: 129087315 Change-Id: I8db30820da9580854ba4d02ee419b5766bd7b24a --- services/surfaceflinger/SurfaceFlinger.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'services/surfaceflinger/SurfaceFlinger.cpp') diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 606355549e..6341f7ab1b 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -2881,7 +2881,7 @@ void SurfaceFlinger::updateInputWindowInfo() { } void SurfaceFlinger::commitInputWindowCommands() { - mInputWindowCommands.merge(mPendingInputWindowCommands); + mInputWindowCommands = mPendingInputWindowCommands; mPendingInputWindowCommands.clear(); } @@ -3662,8 +3662,9 @@ void SurfaceFlinger::applyTransactionState(const Vector& states, if (flags & eAnimation) { mAnimTransactionPending = true; } - - mPendingSyncInputWindows = mPendingInputWindowCommands.syncInputWindows; + if (mPendingInputWindowCommands.syncInputWindows) { + mPendingSyncInputWindows = true; + } // applyTransactionState can be called by either the main SF thread or by // another process through setTransactionState. While a given process may wish -- cgit v1.2.3-59-g8ed1b