AudioFlinger:  Do not show latency for non-PCM record in dumpsys

Test: Check AudioFlinger dumpsys during MSD direct record
Bug: 112388863
Change-Id: Id404c70af0c0e23a1e349522568b20f50573b1e9
(cherry picked from commit 2ceaf3dee96d1696b315afdee9ffc0df662f88d8)
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index cd585f5..babf91d 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -7466,7 +7466,8 @@
         (void)input->stream->dump(fd);
     }
 
-    const double latencyMs = - mTimestamp.getOutputServerLatencyMs(mSampleRate);
+    const double latencyMs = audio_is_linear_pcm(mFormat)
+            ? - mTimestamp.getOutputServerLatencyMs(mSampleRate) : 0.;
     if (latencyMs != 0.) {
         dprintf(fd, "  NormalRecord latency ms: %.2lf\n", latencyMs);
     } else {
diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp
index 8b9485f..8ad06f0 100644
--- a/services/audioflinger/Tracks.cpp
+++ b/services/audioflinger/Tracks.cpp
@@ -1720,7 +1720,7 @@
         thread->mFastTrackAvail = false;
     } else {
         // TODO: only Normal Record has timestamps (Fast Record does not).
-        mServerLatencySupported = true;
+        mServerLatencySupported = audio_is_linear_pcm(mFormat);
     }
 #ifdef TEE_SINK
     mTee.setId(std::string("_") + std::to_string(mThreadIoHandle)