Clear TrustedPresentationListener when a new listener is set
If a TrustedPresentationListener is overwritten for a Layer, the last
trusted presentation states need to be cleared.
It also needs to make sure composite is called after setting a
TrustedPresentationListener since the layer may already be in the
presented state and there's nothing new to compose. We need to make sure
the presentation state is computed at least once after setting the
TrustedPresentationListener
Test: TrustedPresentationCallbackTest
Bug: 256993331
Change-Id: I5cd344e9609d96c961fc70093ea705ee48f46817
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 2955daf..59d50bf 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -754,7 +754,7 @@
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