SurfaceFlinger: Ignore mInputDirty if syncing input-windows.

It's possible we sync input windows but then don't actually have any
changes resulting in input being dirtied. This could lead to extremly
long waits on Binder threads and "Set transaction state timed-out"
errors. To fix this we ignore the cache state if we are processing a
sync command. I thought about just not invoking setInputWindows and
signalling the CV but I thought maybe someone could be relying on
the fencing semantics of syncInputWindows even in cases where
this transaction had no change.

Bug: 151182359
Test: android.media.cts.EncodeVirtualDisplayWithCompositionTest
Change-Id: Ia4e5f21c37db68a1a3bec36051c34df3be5fce52
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 29fe5d9..91b1c73 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2800,7 +2800,7 @@
     // input changes but all input changes will spring from these transactions
     // so the cache is safe but not optimal. It seems like it might be annoyingly
     // costly to cache and comapre the actual InputWindowHandle vector though.
-    if (!mInputDirty) {
+    if (!mInputDirty && !mInputWindowCommands.syncInputWindows) {
         return;
     }