Add headers to audioflinger thread local logs

Add thread headers to local log for playback and record tracks for ease
of debugging.

Test: adb shell dumpsys media.audio_flinger
Flag: EXEMPT logs only
Bug: 372070273
Change-Id: Id32a9155e87b60963c7518967f7ac551c2b38e16
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index 8cb1965..eedf560 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -1058,6 +1058,8 @@
     }
 
     dprintf(fd, "  Local log:\n");
+    const auto logHeader = this->getLocalLogHeader();
+    write(fd, logHeader.data(), logHeader.length());
     mLocalLog.dump(fd, "   " /* prefix */, 40 /* lines */);
 
     // --all does the statistics
@@ -5120,6 +5122,12 @@
     }
 }
 
+std::string PlaybackThread::getLocalLogHeader() const {
+    using namespace std::literals;
+    static constexpr auto indent = "                             "
+                                   "                            "sv;
+    return std::string{indent}.append(IAfTrack::getLogHeader());
+}
 // ----------------------------------------------------------------------------
 
 /* static */
@@ -10216,6 +10224,13 @@
     }
 }
 
+std::string RecordThread::getLocalLogHeader() const {
+    using namespace std::literals;
+    static constexpr auto indent = "                             "
+                                   "                            "sv;
+    return std::string{indent}.append(IAfRecordTrack::getLogHeader());
+}
+
 // ----------------------------------------------------------------------------
 //      Mmap
 // ----------------------------------------------------------------------------
@@ -11096,6 +11111,13 @@
     write(fd, result.c_str(), result.size());
 }
 
+std::string MmapThread::getLocalLogHeader() const {
+    using namespace std::literals;
+    static constexpr auto indent = "                             "
+                                   "                            "sv;
+    return std::string{indent}.append(IAfMmapTrack::getLogHeader());
+}
+
 /* static */
 sp<IAfMmapPlaybackThread> IAfMmapPlaybackThread::create(
         const sp<IAfThreadCallback>& afThreadCallback, audio_io_handle_t id,