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

Commit 1300e985 authored by Chavi Weingarten's avatar Chavi Weingarten Committed by Automerger Merge Worker
Browse files

Merge "Clear TrustedPresentationListener when a new listener is set" into...

Merge "Clear TrustedPresentationListener when a new listener is set" into udc-dev am: 3fcbb3bf am: d38a79c7

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/21479888



Change-Id: Id3016d2769e83e76d19ea0133159e81293f8a9d9
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents c1862240 d38a79c7
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -4063,7 +4063,7 @@ void Layer::updateRelativeMetadataSnapshot(const LayerMetadata& relativeLayerMet
    }
}

void Layer::setTrustedPresentationInfo(TrustedPresentationThresholds const& thresholds,
bool Layer::setTrustedPresentationInfo(TrustedPresentationThresholds const& thresholds,
                                       TrustedPresentationListener const& listener) {
    bool hadTrustedPresentationListener = hasTrustedPresentationListener();
    mTrustedPresentationListener = listener;
@@ -4074,6 +4074,16 @@ void Layer::setTrustedPresentationInfo(TrustedPresentationThresholds const& thre
    } else if (hadTrustedPresentationListener && !haveTrustedPresentationListener) {
        mFlinger->mNumTrustedPresentationListeners--;
    }

    // Reset trusted presentation states to ensure we start the time again.
    mEnteredTrustedPresentationStateTime = -1;
    mLastReportedTrustedPresentationState = false;
    mLastComputedTrustedPresentationState = false;

    // If there's a new trusted presentation listener, the code needs to go through the composite
    // path to ensure it recomutes the current state and invokes the TrustedPresentationListener if
    // we're already in the requested state.
    return haveTrustedPresentationListener;
}

void Layer::updateLastLatchTime(nsecs_t latchTime) {
+1 −1
Original line number Diff line number Diff line
@@ -758,7 +758,7 @@ public:
    std::shared_ptr<frametimeline::SurfaceFrame> createSurfaceFrameForBuffer(
            const FrameTimelineInfo& info, nsecs_t queueTime, std::string debugName);

    void setTrustedPresentationInfo(TrustedPresentationThresholds const& thresholds,
    bool setTrustedPresentationInfo(TrustedPresentationThresholds const& thresholds,
                                    TrustedPresentationListener const& listener);

    // Creates a new handle each time, so we only expect
+8 −4
Original line number Diff line number Diff line
@@ -4853,8 +4853,10 @@ uint32_t SurfaceFlinger::setClientStateLocked(const FrameTimelineInfo& frameTime
    }

    if (what & layer_state_t::eTrustedPresentationInfoChanged) {
        layer->setTrustedPresentationInfo(s.trustedPresentationThresholds,
                                          s.trustedPresentationListener);
        if (layer->setTrustedPresentationInfo(s.trustedPresentationThresholds,
                                              s.trustedPresentationListener)) {
            flags |= eTraversalNeeded;
        }
    }

    if (what & layer_state_t::eFlushJankData) {
@@ -4956,8 +4958,10 @@ uint32_t SurfaceFlinger::updateLayerCallbacksAndStats(const FrameTimelineInfo& f
    }

    if (what & layer_state_t::eTrustedPresentationInfoChanged) {
        layer->setTrustedPresentationInfo(s.trustedPresentationThresholds,
                                          s.trustedPresentationListener);
        if (layer->setTrustedPresentationInfo(s.trustedPresentationThresholds,
                                              s.trustedPresentationListener)) {
            flags |= eTraversalNeeded;
        }
    }

    const auto& snapshot = mLayerSnapshotBuilder.getSnapshot(layer->getSequence());