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 {