[SF] Use LayerHierarchy traverse() for FpsReporter

The legacy layer state traverse function which FpsReporter uses
is not working currently as it will not properly get to the root
layer where the taskId resides and thus not getting a matching
taskId with the callbacks from game dashboard.

This patch updates FpsReporter to use LaterHierarchy traverse
function which works as expected to return the correct taskId
in the root layer.

Bug: 316111174
Test: libsurfaceflinger_unittest
Test: libsurfaceflinger_unittest:FpsReporterTest
Change-Id: Icec40488289a563967b282a078515b52322a55db
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index c3bfb58..be0dd55 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -3096,7 +3096,7 @@
     {
         Mutex::Autolock lock(mStateLock);
         if (mFpsReporter) {
-            mFpsReporter->dispatchLayerFps();
+            mFpsReporter->dispatchLayerFps(mLayerHierarchyBuilder.getHierarchy());
         }
 
         if (mTunnelModeEnabledReporter) {
@@ -4240,7 +4240,7 @@
     mRegionSamplingThread =
             sp<RegionSamplingThread>::make(*this,
                                            RegionSamplingThread::EnvironmentTimingTunables());
-    mFpsReporter = sp<FpsReporter>::make(*mFrameTimeline, *this);
+    mFpsReporter = sp<FpsReporter>::make(*mFrameTimeline);
 }
 
 void SurfaceFlinger::doCommitTransactions() {