blast: add desired present time
Add the option to set a desiredPresentTime for a transaction. This
lets the framework know approximately when the transaction should
be presented.
Test: Transaction_test
Bug: 80477568
Change-Id: Ic25617fb93f2c249b3b3c7a8f90f72ec358938f0
diff --git a/libs/gui/ISurfaceComposer.cpp b/libs/gui/ISurfaceComposer.cpp
index 7357ba9..c3a4737 100644
--- a/libs/gui/ISurfaceComposer.cpp
+++ b/libs/gui/ISurfaceComposer.cpp
@@ -66,7 +66,8 @@
virtual void setTransactionState(const Vector<ComposerState>& state,
const Vector<DisplayState>& displays, uint32_t flags,
const sp<IBinder>& applyToken,
- const InputWindowCommands& commands) {
+ const InputWindowCommands& commands,
+ int64_t desiredPresentTime) {
Parcel data, reply;
data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
@@ -83,6 +84,7 @@
data.writeUint32(flags);
data.writeStrongBinder(applyToken);
commands.write(data);
+ data.writeInt64(desiredPresentTime);
remote()->transact(BnSurfaceComposer::SET_TRANSACTION_STATE, data, &reply);
}
@@ -748,7 +750,10 @@
sp<IBinder> applyToken = data.readStrongBinder();
InputWindowCommands inputWindowCommands;
inputWindowCommands.read(data);
- setTransactionState(state, displays, stateFlags, applyToken, inputWindowCommands);
+
+ int64_t desiredPresentTime = data.readInt64();
+ setTransactionState(state, displays, stateFlags, applyToken, inputWindowCommands,
+ desiredPresentTime);
return NO_ERROR;
}
case BOOT_FINISHED: {