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

Commit a97d59db authored by Shuangxi Xiang's avatar Shuangxi Xiang Committed by Sally Qi
Browse files

Remove the redundant parameters in applyTransactionsLocked



In the major Android version upgrade from 13 to 14, the addCommittedTransactions function in the applyTransactionsLocked function that requires the vsyncId parameter has been moved to the updateLayerSnapshots and updateLayerSnapshotsLegacy functions. The rest of the operations in the applyTransactionsLocked function no longer require the vsyncId parameter, so the declaration and definition information about vsyncId in the applyTransactionsLocked function can be removed here.

Bug: 362415544
Test: builds
Flag: EXEMPT bugfix
Change-Id: Ic4ded171e90bcfb7a0d58df2c272f4c219be3a04
Signed-off-by: default avatar <xiangshuangxi@xiaomi.corp-partner.google.com>
parent 05f45ce7
Loading
Loading
Loading
Loading
+6 −8
Original line number Original line Diff line number Diff line
@@ -2448,7 +2448,7 @@ bool SurfaceFlinger::updateLayerSnapshots(VsyncId vsyncId, nsecs_t frameTimeNs,


    bool newDataLatched = false;
    bool newDataLatched = false;
    SFTRACE_NAME("DisplayCallbackAndStatsUpdates");
    SFTRACE_NAME("DisplayCallbackAndStatsUpdates");
    mustComposite |= applyTransactionsLocked(update.transactions, vsyncId);
    mustComposite |= applyTransactionsLocked(update.transactions);
    traverseLegacyLayers([&](Layer* layer) { layer->commitTransaction(); });
    traverseLegacyLayers([&](Layer* layer) { layer->commitTransaction(); });
    const nsecs_t latchTime = systemTime();
    const nsecs_t latchTime = systemTime();
    bool unused = false;
    bool unused = false;
@@ -4572,20 +4572,18 @@ void SurfaceFlinger::addTransactionReadyFilters() {
}
}


// For tests only
// For tests only
bool SurfaceFlinger::flushTransactionQueues(VsyncId vsyncId) {
bool SurfaceFlinger::flushTransactionQueues() {
    mTransactionHandler.collectTransactions();
    mTransactionHandler.collectTransactions();
    std::vector<TransactionState> transactions = mTransactionHandler.flushTransactions();
    std::vector<TransactionState> transactions = mTransactionHandler.flushTransactions();
    return applyTransactions(transactions, vsyncId);
    return applyTransactions(transactions);
}
}


bool SurfaceFlinger::applyTransactions(std::vector<TransactionState>& transactions,
bool SurfaceFlinger::applyTransactions(std::vector<TransactionState>& transactions) {
                                       VsyncId vsyncId) {
    Mutex::Autolock lock(mStateLock);
    Mutex::Autolock lock(mStateLock);
    return applyTransactionsLocked(transactions, vsyncId);
    return applyTransactionsLocked(transactions);
}
}


bool SurfaceFlinger::applyTransactionsLocked(std::vector<TransactionState>& transactions,
bool SurfaceFlinger::applyTransactionsLocked(std::vector<TransactionState>& transactions) {
                                             VsyncId vsyncId) {
    bool needsTraversal = false;
    bool needsTraversal = false;
    // Now apply all transactions.
    // Now apply all transactions.
    for (auto& transaction : transactions) {
    for (auto& transaction : transactions) {
+3 −3
Original line number Original line Diff line number Diff line
@@ -783,9 +783,9 @@ private:
            REQUIRES(mStateLock, kMainThreadContext);
            REQUIRES(mStateLock, kMainThreadContext);
    // Flush pending transactions that were presented after desiredPresentTime.
    // Flush pending transactions that were presented after desiredPresentTime.
    // For test only
    // For test only
    bool flushTransactionQueues(VsyncId) REQUIRES(kMainThreadContext);
    bool flushTransactionQueues() REQUIRES(kMainThreadContext);


    bool applyTransactions(std::vector<TransactionState>&, VsyncId) REQUIRES(kMainThreadContext);
    bool applyTransactions(std::vector<TransactionState>&) REQUIRES(kMainThreadContext);
    bool applyAndCommitDisplayTransactionStatesLocked(std::vector<TransactionState>& transactions)
    bool applyAndCommitDisplayTransactionStatesLocked(std::vector<TransactionState>& transactions)
            REQUIRES(kMainThreadContext, mStateLock);
            REQUIRES(kMainThreadContext, mStateLock);


@@ -815,7 +815,7 @@ private:


    static LatchUnsignaledConfig getLatchUnsignaledConfig();
    static LatchUnsignaledConfig getLatchUnsignaledConfig();
    bool shouldLatchUnsignaled(const layer_state_t&, size_t numStates, bool firstTransaction) const;
    bool shouldLatchUnsignaled(const layer_state_t&, size_t numStates, bool firstTransaction) const;
    bool applyTransactionsLocked(std::vector<TransactionState>& transactions, VsyncId)
    bool applyTransactionsLocked(std::vector<TransactionState>& transactions)
            REQUIRES(mStateLock, kMainThreadContext);
            REQUIRES(mStateLock, kMainThreadContext);
    uint32_t setDisplayStateLocked(const DisplayState& s) REQUIRES(mStateLock);
    uint32_t setDisplayStateLocked(const DisplayState& s) REQUIRES(mStateLock);
    uint32_t addInputWindowCommands(const InputWindowCommands& inputWindowCommands)
    uint32_t addInputWindowCommands(const InputWindowCommands& inputWindowCommands)
+1 −1
Original line number Original line Diff line number Diff line
@@ -547,7 +547,7 @@ public:
    }
    }


    auto flushTransactionQueues() {
    auto flushTransactionQueues() {
        return FTL_FAKE_GUARD(kMainThreadContext, mFlinger->flushTransactionQueues(kVsyncId));
        return FTL_FAKE_GUARD(kMainThreadContext, mFlinger->flushTransactionQueues());
    }
    }


    auto onTransact(uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) {
    auto onTransact(uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) {