Adds a flush jank data layer state update type.

A transaction can be sent to SurfaceFlinger with a layer state change
of this type to wake up SurfaceFlinger and have it perform the layer
state update logic, without updating anything, but triggering any
side-effects, especially jank data processing.

Bug: 235178314
Bug: 221393601
Bug: 225105422
Test: atest SurfaceFlinger_test
Change-Id: Idf458c96cbe8f54224ebde6f517c08b9a5c48a06
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index a0c3eb0..2f5f93c 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -4843,6 +4843,10 @@
                                           s.trustedPresentationListener);
     }
 
+    if (what & layer_state_t::eFlushJankData) {
+        // Do nothing. Processing the transaction completed listeners currently cause the flush.
+    }
+
     if (layer->setTransactionCompletedListeners(callbackHandles,
                                                 layer->willPresentCurrentTransaction())) {
         flags |= eTraversalNeeded;