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

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

Merge "SurfaceComposerClient: Expose default apply token"

parents caabd5a9 80da86b8
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -1038,9 +1038,7 @@ status_t SurfaceComposerClient::Transaction::apply(bool synchronous, bool oneWay
        flags |= ISurfaceComposer::eEarlyWakeupEnd;
    }

    sp<IBinder> applyToken = mApplyToken
            ? mApplyToken
            : IInterface::asBinder(TransactionCompletedListener::getIInstance());
    sp<IBinder> applyToken = mApplyToken ? mApplyToken : sApplyToken;

    sf->setTransactionState(mFrameTimelineInfo, composerStates, displayStates, flags, applyToken,
                            mInputWindowCommands, mDesiredPresentTime, mIsAutoTimestamp,
@@ -1055,6 +1053,15 @@ status_t SurfaceComposerClient::Transaction::apply(bool synchronous, bool oneWay
    return NO_ERROR;
}

sp<IBinder> SurfaceComposerClient::Transaction::sApplyToken = new BBinder();

sp<IBinder> SurfaceComposerClient::Transaction::getDefaultApplyToken() {
    return sApplyToken;
}

void SurfaceComposerClient::Transaction::setDefaultApplyToken(sp<IBinder> applyToken) {
    sApplyToken = applyToken;
}
// ---------------------------------------------------------------------------

sp<IBinder> SurfaceComposerClient::createDisplay(const String8& displayName, bool secure) {
+4 −0
Original line number Diff line number Diff line
@@ -390,6 +390,7 @@ public:

    class Transaction : public Parcelable {
    private:
        static sp<IBinder> sApplyToken;
        void releaseBufferIfOverwriting(const layer_state_t& state);
        static void mergeFrameTimelineInfo(FrameTimelineInfo& t, const FrameTimelineInfo& other);
        static void clearFrameTimelineInfo(FrameTimelineInfo& t);
@@ -669,6 +670,9 @@ public:
         * TODO (b/213644870): Remove all permissioned things from Transaction
         */
        void sanitize();

        static sp<IBinder> getDefaultApplyToken();
        static void setDefaultApplyToken(sp<IBinder> applyToken);
    };

    status_t clearLayerFrameStats(const sp<IBinder>& token) const;