Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 94ebe6f1 authored by Vishnu Nair's avatar Vishnu Nair Committed by Android (Google) Code Review
Browse files

Merge "Update Transaction ID after clearing the transaction" into main

parents 1f38ae3e 4225e77c
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -998,6 +998,7 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::merge(Tr

void SurfaceComposerClient::Transaction::clear() {
    mState.clear();
    mState.mId = generateId();
    mListenerCallbacks.clear();
    mMayContainBuffer = false;
    mApplyToken = nullptr;
@@ -1182,10 +1183,13 @@ status_t SurfaceComposerClient::Transaction::apply(bool synchronous, bool oneWay

    sp<ISurfaceComposer> sf(ComposerService::getComposerService());
    TransactionState state = std::move(mState);
    mState = TransactionState();
    mState.mId = generateId();
    status_t binderStatus = sf->setTransactionState(std::move(state), applyToken);

    if (mLogCallPoints) {
        ALOG(LOG_DEBUG, LOG_SURFACE_CONTROL_REGISTRY, "Transaction %" PRIu64 " applied",
             mState.mId);
    }

    // Clear the current states and flags
    clear();

@@ -1193,11 +1197,6 @@ status_t SurfaceComposerClient::Transaction::apply(bool synchronous, bool oneWay
        syncCallback->wait();
    }

    if (mLogCallPoints) {
        ALOG(LOG_DEBUG, LOG_SURFACE_CONTROL_REGISTRY, "Transaction %" PRIu64 " applied",
             mState.mId);
    }

    mStatus = NO_ERROR;
    return binderStatus;
}