Support task ID for fps listener rather than SurfaceControl.
Bug: 174956756
Test: e2e test with dashboard cls
Change-Id: I841af53ac820a91d270a75c5cc0ca258df0a3945
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index ad91183..727386c 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1433,14 +1433,12 @@
return NO_ERROR;
}
-status_t SurfaceFlinger::addFpsListener(const sp<IBinder>& layerHandle,
- const sp<gui::IFpsListener>& listener) {
+status_t SurfaceFlinger::addFpsListener(int32_t taskId, const sp<gui::IFpsListener>& listener) {
if (!listener) {
return BAD_VALUE;
}
- const wp<Layer> layer = fromHandle(layerHandle);
- mFpsReporter->addListener(listener, layer);
+ mFpsReporter->addListener(listener, taskId);
return NO_ERROR;
}
@@ -3006,7 +3004,7 @@
mRegionSamplingThread =
new RegionSamplingThread(*this, *mScheduler,
RegionSamplingThread::EnvironmentTimingTunables());
- mFpsReporter = new FpsReporter(*mFrameTimeline);
+ mFpsReporter = new FpsReporter(*mFrameTimeline, *this);
// Dispatch a mode change request for the primary display on scheduler
// initialization, so that the EventThreads always contain a reference to a
// prior configuration.