@@ -829,7 +829,9 @@ SurfaceComposerClient::Transaction::Transaction() {
829829
830830SurfaceComposerClient::Transaction::Transaction (const Transaction& other)
831831 : mId (other.mId ),
832- mFlags (other.mFlags ),
832+ mAnimation (other.mAnimation ),
833+ mEarlyWakeupStart(other.mEarlyWakeupStart ),
834+ mEarlyWakeupEnd(other.mEarlyWakeupEnd ),
833835 mMayContainBuffer(other.mMayContainBuffer ),
834836 mDesiredPresentTime(other.mDesiredPresentTime ),
835837 mIsAutoTimestamp(other.mIsAutoTimestamp ),
@@ -866,7 +868,9 @@ SurfaceComposerClient::Transaction::createFromParcel(const Parcel* parcel) {
866868
867869status_t SurfaceComposerClient::Transaction::readFromParcel (const Parcel* parcel) {
868870 const uint64_t transactionId = parcel->readUint64 ();
869- const uint32_t flags = parcel->readUint32 ();
871+ const bool animation = parcel->readBool ();
872+ const bool earlyWakeupStart = parcel->readBool ();
873+ const bool earlyWakeupEnd = parcel->readBool ();
870874 const int64_t desiredPresentTime = parcel->readInt64 ();
871875 const bool isAutoTimestamp = parcel->readBool ();
872876 const bool logCallPoints = parcel->readBool ();
@@ -961,7 +965,9 @@ status_t SurfaceComposerClient::Transaction::readFromParcel(const Parcel* parcel
961965
962966 // Parsing was successful. Update the object.
963967 mId = transactionId;
964- mFlags = flags;
968+ mAnimation = animation;
969+ mEarlyWakeupStart = earlyWakeupStart;
970+ mEarlyWakeupEnd = earlyWakeupEnd;
965971 mDesiredPresentTime = desiredPresentTime;
966972 mIsAutoTimestamp = isAutoTimestamp;
967973 mFrameTimelineInfo = frameTimelineInfo;
@@ -990,7 +996,9 @@ status_t SurfaceComposerClient::Transaction::writeToParcel(Parcel* parcel) const
990996 const_cast <SurfaceComposerClient::Transaction*>(this )->cacheBuffers ();
991997
992998 parcel->writeUint64 (mId );
993- parcel->writeUint32 (mFlags );
999+ parcel->writeBool (mAnimation );
1000+ parcel->writeBool (mEarlyWakeupStart );
1001+ parcel->writeBool (mEarlyWakeupEnd );
9941002 parcel->writeInt64 (mDesiredPresentTime );
9951003 parcel->writeBool (mIsAutoTimestamp );
9961004 parcel->writeBool (mLogCallPoints );
@@ -1123,7 +1131,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::merge(Tr
11231131 mInputWindowCommands .merge (other.mInputWindowCommands );
11241132
11251133 mMayContainBuffer |= other.mMayContainBuffer ;
1126- mFlags |= other.mFlags ;
1134+ mEarlyWakeupStart = mEarlyWakeupStart || other.mEarlyWakeupStart ;
1135+ mEarlyWakeupEnd = mEarlyWakeupEnd || other.mEarlyWakeupEnd ;
11271136 mApplyToken = other.mApplyToken ;
11281137
11291138 mergeFrameTimelineInfo (mFrameTimelineInfo , other.mFrameTimelineInfo );
@@ -1145,13 +1154,15 @@ void SurfaceComposerClient::Transaction::clear() {
11451154 mInputWindowCommands .clear ();
11461155 mUncacheBuffers .clear ();
11471156 mMayContainBuffer = false ;
1157+ mAnimation = false ;
1158+ mEarlyWakeupStart = false ;
1159+ mEarlyWakeupEnd = false ;
11481160 mDesiredPresentTime = 0 ;
11491161 mIsAutoTimestamp = true ;
11501162 mFrameTimelineInfo = {};
11511163 mApplyToken = nullptr ;
11521164 mMergedTransactionIds .clear ();
11531165 mLogCallPoints = false ;
1154- mFlags = 0 ;
11551166}
11561167
11571168uint64_t SurfaceComposerClient::Transaction::getId () {
@@ -1322,6 +1333,9 @@ status_t SurfaceComposerClient::Transaction::apply(bool synchronous, bool oneWay
13221333
13231334 displayStates = std::move (mDisplayStates );
13241335
1336+ if (mAnimation ) {
1337+ flags |= ISurfaceComposer::eAnimation;
1338+ }
13251339 if (oneWay) {
13261340 if (synchronous) {
13271341 ALOGE (" Transaction attempted to set synchronous and one way at the same time"
@@ -1331,12 +1345,15 @@ status_t SurfaceComposerClient::Transaction::apply(bool synchronous, bool oneWay
13311345 }
13321346 }
13331347
1334- // If both ISurfaceComposer::eEarlyWakeupStart and ISurfaceComposer::eEarlyWakeupEnd are set
1348+ // If both mEarlyWakeupStart and mEarlyWakeupEnd are set
13351349 // it is equivalent for none
1336- uint32_t wakeupFlags = ISurfaceComposer::eEarlyWakeupStart | ISurfaceComposer::eEarlyWakeupEnd;
1337- if ((flags & wakeupFlags) == wakeupFlags) {
1338- flags &= ~(wakeupFlags);
1350+ if (mEarlyWakeupStart && !mEarlyWakeupEnd ) {
1351+ flags |= ISurfaceComposer::eEarlyWakeupStart;
1352+ }
1353+ if (mEarlyWakeupEnd && !mEarlyWakeupStart ) {
1354+ flags |= ISurfaceComposer::eEarlyWakeupEnd;
13391355 }
1356+
13401357 sp<IBinder> applyToken = mApplyToken ? mApplyToken : getDefaultApplyToken ();
13411358
13421359 sp<ISurfaceComposer> sf (ComposerService::getComposerService ());
@@ -1444,15 +1461,15 @@ std::optional<gui::StalledTransactionInfo> SurfaceComposerClient::getStalledTran
14441461}
14451462
14461463void SurfaceComposerClient::Transaction::setAnimationTransaction () {
1447- mFlags |= ISurfaceComposer::eAnimation ;
1464+ mAnimation = true ;
14481465}
14491466
14501467void SurfaceComposerClient::Transaction::setEarlyWakeupStart () {
1451- mFlags |= ISurfaceComposer::eEarlyWakeupStart ;
1468+ mEarlyWakeupStart = true ;
14521469}
14531470
14541471void SurfaceComposerClient::Transaction::setEarlyWakeupEnd () {
1455- mFlags |= ISurfaceComposer::eEarlyWakeupEnd ;
1472+ mEarlyWakeupEnd = true ;
14561473}
14571474
14581475layer_state_t * SurfaceComposerClient::Transaction::getLayerState (const sp<SurfaceControl>& sc) {
0 commit comments