SF: Force empty sync transactions to apply anyway
Following the change to not flush transactions in the screen shot
path, this enables the use of empty synchronous transactions as a
flush mechanism for previous asynchronous transactions.
Bug: 27098060
Change-Id: I282fdfffb72db148edcbf1ded65b15816fc714a2
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 466da8c..ce63ec2 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2165,6 +2165,13 @@
}
}
+ // If a synchronous transaction is explicitly requested without any changes,
+ // force a transaction anyway. This can be used as a flush mechanism for
+ // previous async transactions.
+ if (transactionFlags == 0 && (flags & eSynchronous)) {
+ transactionFlags = eTransactionNeeded;
+ }
+
if (transactionFlags) {
// this triggers the transaction
setTransactionFlags(transactionFlags);