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
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 6063555..6341f7a 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2881,7 +2881,7 @@
}
void SurfaceFlinger::commitInputWindowCommands() {
- mInputWindowCommands.merge(mPendingInputWindowCommands);
+ mInputWindowCommands = mPendingInputWindowCommands;
mPendingInputWindowCommands.clear();
}
@@ -3662,8 +3662,9 @@
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