SF: throttle WindowInfosListener calls

This change updates WindowInfosListenerInvoker to delay and drop
messages when there are unacked messages. When WindowInfosListener calls
are acknowledged before the next windowInfosChanged call, there is no
behavior change. If windowInfosChanged is called and there are unacked
messages, then the update is delayed and sent once the messages are
acked via WindowInfosReportedListener. If windowInfosChanged is called
and there is already a delayed update, then the previous delayed update
is overwritten and only the latest update is sent.

WindowInfosListeners are still called immediately when there are focus
requests. This means the number of unacked messages may be greater than
one.

This reverts commit 1234a337651a79d492b6c453eb7f4cf30ec341cf.

Bug: 270894765
Test: presubmits
Test: manual fuzz testing (random sleeps added to input flinger listener)
Change-Id: If43b7ab91e05df863e9e6ac51b0bbd36cabe85d7
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index a538c6d..9c232b1 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -2442,16 +2442,7 @@
         info.inputConfig |= WindowInfo::InputConfig::NOT_TOUCHABLE;
     }
 
-    // For compatibility reasons we let layers which can receive input
-    // receive input before they have actually submitted a buffer. Because
-    // of this we use canReceiveInput instead of isVisible to check the
-    // policy-visibility, ignoring the buffer state. However for layers with
-    // hasInputInfo()==false we can use the real visibility state.
-    // We are just using these layers for occlusion detection in
-    // InputDispatcher, and obviously if they aren't visible they can't occlude
-    // anything.
-    const bool visible = hasInputInfo() ? canReceiveInput() : isVisible();
-    info.setInputConfig(WindowInfo::InputConfig::NOT_VISIBLE, !visible);
+    info.setInputConfig(WindowInfo::InputConfig::NOT_VISIBLE, !isVisibleForInput());
 
     info.alpha = getAlpha();
     fillTouchOcclusionMode(info);