Remove --json option from dumpsys media.audio_flinger
The more recent work that this was supposed to become is reflected in
dumpsys media.log, so this commit removes some code clutter that is not
used anymore.
Other Changes:
- Use std::make_unique for creating unique_ptr objects
Test: build, dumpsys media.audio_flinger
Bug: 68148948
Change-Id: I4841e118c2cdee4ada4c6cdc0fff1ec2e12b38c4
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index b5e7856..d7a4451 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -42,7 +42,6 @@
#include <audio_utils/primitives.h>
#include <audio_utils/format.h>
#include <audio_utils/minifloat.h>
-#include <json/json.h>
#include <system/audio_effects/effect_ns.h>
#include <system/audio_effects/effect_aec.h>
#include <system/audio.h>
@@ -1776,11 +1775,6 @@
mLocalLog.dump(fd, " " /* prefix */, 40 /* lines */);
}
-Json::Value AudioFlinger::PlaybackThread::getJsonDump() const
-{
- return Json::Value(Json::objectValue);
-}
-
void AudioFlinger::PlaybackThread::dumpTracks(int fd, const Vector<String16>& args __unused)
{
String8 result;
@@ -5182,7 +5176,8 @@
// while we are dumping it. It may be inconsistent, but it won't mutate!
// This is a large object so we place it on the heap.
// FIXME 25972958: Need an intelligent copy constructor that does not touch unused pages.
- const std::unique_ptr<FastMixerDumpState> copy(new FastMixerDumpState(mFastMixerDumpState));
+ const std::unique_ptr<FastMixerDumpState> copy =
+ std::make_unique<FastMixerDumpState>(mFastMixerDumpState);
copy->dump(fd);
#ifdef STATE_QUEUE_DUMP
@@ -5206,22 +5201,6 @@
}
}
-Json::Value AudioFlinger::MixerThread::getJsonDump() const
-{
- Json::Value root;
- if (hasFastMixer()) {
- // Make a non-atomic copy of fast mixer dump state so it won't change underneath us
- // while we are dumping it. It may be inconsistent, but it won't mutate!
- // This is a large object so we place it on the heap.
- // FIXME 25972958: Need an intelligent copy constructor that does not touch unused pages.
- const std::unique_ptr<FastMixerDumpState> copy(new FastMixerDumpState(mFastMixerDumpState));
- root["fastmixer_stats"] = copy->getJsonDump();
- } else {
- root["fastmixer_stats"] = "no_fastmixer";
- }
- return root;
-}
-
uint32_t AudioFlinger::MixerThread::idleSleepTimeUs() const
{
return (uint32_t)(((mNormalFrameCount * 1000) / mSampleRate) * 1000) / 2;
@@ -7570,7 +7549,8 @@
// while we are dumping it. It may be inconsistent, but it won't mutate!
// This is a large object so we place it on the heap.
// FIXME 25972958: Need an intelligent copy constructor that does not touch unused pages.
- std::unique_ptr<FastCaptureDumpState> copy(new FastCaptureDumpState(mFastCaptureDumpState));
+ const std::unique_ptr<FastCaptureDumpState> copy =
+ std::make_unique<FastCaptureDumpState>(mFastCaptureDumpState);
copy->dump(fd);
}