SurfaceFlinger TimeStats

The proto dump for TimeStats only show one time bucket for each time
delta category, which is not correct. This change will fix the bug.

Bug: b/79262493
Test: Use printproto to check the proto dump result
Change-Id: I21f8ce6eeda220be806a44bc0d5c318507fda2fb
diff --git a/services/surfaceflinger/TimeStats/timestatsproto/TimeStatsHelper.cpp b/services/surfaceflinger/TimeStats/timestatsproto/TimeStatsHelper.cpp
index ec0570d..3e5007c 100644
--- a/services/surfaceflinger/TimeStats/timestatsproto/TimeStatsHelper.cpp
+++ b/services/surfaceflinger/TimeStats/timestatsproto/TimeStatsHelper.cpp
@@ -129,8 +129,8 @@
     for (auto ele : deltas) {
         SFTimeStatsDeltaProto* deltaProto = layerProto.add_deltas();
         deltaProto->set_delta_name(ele.first);
-        SFTimeStatsHistogramBucketProto* histProto = deltaProto->add_histograms();
         for (auto histEle : ele.second.hist) {
+            SFTimeStatsHistogramBucketProto* histProto = deltaProto->add_histograms();
             histProto->set_render_millis(histEle.first);
             histProto->set_frame_count(histEle.second);
         }