Fix WindowInfosListenerTest

Fixes a race condition where the WindowInfo vector checked may not
contain the updated window on the first pass.

Bug: 269522974
Test: atest WindowInfosListenerTest
Change-Id: I013955dd1c89858190b519c2980909e2e7e45a24
(cherry picked from commit 4c766ae50ce641672158c19eda4613a5e64baf47)
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index c91ad49..28b7dd6 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -3576,6 +3576,10 @@
         });
     }
 
+    if (transactionFlags & eInputInfoUpdateNeeded) {
+        mUpdateInputInfo = true;
+    }
+
     doCommitTransactions();
 }
 
@@ -7567,8 +7571,9 @@
 }
 
 status_t SurfaceFlinger::addWindowInfosListener(
-        const sp<IWindowInfosListener>& windowInfosListener) const {
+        const sp<IWindowInfosListener>& windowInfosListener) {
     mWindowInfosListenerInvoker->addWindowInfosListener(windowInfosListener);
+    setTransactionFlags(eInputInfoUpdateNeeded);
     return NO_ERROR;
 }