SurfaceFlinger: Fix duplicate callbacks
Transaction callbacks are emitted early, for empty transactions,
after latch for on commit callbacks and on post composition for
transaction complete callbacks. Pending callbacks are stored
together. If a transaction contains a layer that is presented
and a layer that is not presented, the transaction callback will
get added to the pending list after the transaction is committed
and it will get emitted after buffers are latched and then again
at the end of composition. To fix this we make sure to only emit
on commit callbacks after a buffer is latched.
Test: atest SurfaceFlinger_test
Bug: 202394221
Change-Id: I356fbf221812060c17765c53cc3df24cb3cd139a
5 files changed