DO NOT MERGE: SurfaceFlinger: Don't wake for pending transactions.

When we still have pending transactions (e.g. we are waiting on the
other side of a deferred transaction), we need to set the transaction
flags on SurfaceFlinger, so SurfaceFlinger will continue to call
doTransaction and give us a chance to process them. However when
we set the transaction flags, we trigger a wake up! This isn't
desirable, as the frame might have not come in. If the frame did come
in we will get to INVALIDATE, and from INVALIDATE observe the
transaction flags. This means we can set the transaction flags without
scheduling a wakeup and rely on the incoming frame to eventually wake
us up. I also considered triggering the transaction processing from
onFrameAvailable but at that point we are too late in the composition
cycle.

Bug: 157685525
Test: Existing tests pass
Change-Id: Ia54bc9f48a80906fc8f21c46debc72fabadd3e07
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 2d25319..03bbe85 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -3242,6 +3242,10 @@
     return old;
 }
 
+uint32_t SurfaceFlinger::setTransactionFlagsNoWake(uint32_t flags) {
+    return mTransactionFlags.fetch_or(flags);
+}
+
 bool SurfaceFlinger::flushTransactionQueues() {
     // to prevent onHandleDestroyed from being called while the lock is held,
     // we must keep a copy of the transactions (specifically the composer