summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-07-18 23:15:22 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-07-18 23:15:22 +0000
commite7e59490c070f00bb2f5e0273e4de482dd05c209 (patch)
treea989773f2ace67fac6ca753a8629193a45ee09d8
parent034170031a5d919948d014cbaef7dbd1e7232d2e (diff)
parent74daafd483d50bb2b09ff4523f90542efa34db02 (diff)
downloadav-android11-release.tar.gz
Change-Id: I403e726b04f021e3d4a22accf50614ee7e06846b
-rw-r--r--services/mediametrics/AudioAnalytics.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/services/mediametrics/AudioAnalytics.cpp b/services/mediametrics/AudioAnalytics.cpp
index 29801a4ba6..d78d1e31f6 100644
--- a/services/mediametrics/AudioAnalytics.cpp
+++ b/services/mediametrics/AudioAnalytics.cpp
@@ -43,7 +43,7 @@ namespace android::mediametrics {
#endif
// Maximum length of a device name.
-static constexpr size_t STATSD_DEVICE_NAME_MAX_LENGTH = 32;
+// static constexpr size_t STATSD_DEVICE_NAME_MAX_LENGTH = 32; // unused since we suppress
// Transmit Enums to statsd in integer or strings (this must match the atoms.proto)
static constexpr bool STATSD_USE_INT_FOR_ENUM = false;
@@ -66,6 +66,8 @@ static constexpr const auto LOG_LEVEL = android::base::VERBOSE;
static constexpr int PREVIOUS_STATE_EXPIRE_SEC = 60 * 60; // 1 hour.
+static constexpr const char * SUPPRESSED = "SUPPRESSED";
+
/*
* For logging purposes, we list all of the MediaMetrics atom fields,
* which can then be associated with consecutive arguments to the statsd write.
@@ -448,6 +450,8 @@ void AudioAnalytics::DeviceUse::endAudioIntervalGroup(
std::string outputDeviceNames;
if (outputDevices.find("AUDIO_DEVICE_OUT_BLUETOOTH") != std::string::npos) {
isBluetooth = true;
+ outputDeviceNames = SUPPRESSED;
+#if 0 // TODO(b/161554630) sanitize name
mAudioAnalytics.mAnalyticsState->timeMachine().get(
"audio.device.bt_a2dp", AMEDIAMETRICS_PROP_NAME, &outputDeviceNames);
// Remove | if present
@@ -455,6 +459,7 @@ void AudioAnalytics::DeviceUse::endAudioIntervalGroup(
if (outputDeviceNames.size() > STATSD_DEVICE_NAME_MAX_LENGTH) {
outputDeviceNames.resize(STATSD_DEVICE_NAME_MAX_LENGTH); // truncate
}
+#endif
}
switch (itemType) {
@@ -775,7 +780,7 @@ void AudioAnalytics::DeviceConnection::postBluetoothA2dpDeviceConnectionStateSup
std::lock_guard l(mLock);
mA2dpConnectionRequestNs = atNs;
++mA2dpConnectionRequests;
- mA2dpDeviceName = name;
+ mA2dpDeviceName = SUPPRESSED; // TODO(b/161554630) sanitize name
}
ALOGD("(key=%s) a2dp connection name:%s request atNs:%lld",
key.c_str(), name.c_str(), (long long)atNs);