aaudio: reduce error logging, improve security
Reduce log spam and error logging as part of the Green Log effort.
Replace logging of addresses with integer IDs.
Bug: 36785118
Bug: 122073229
Bug: 130569151
Test: Open an AAudio stream at 44100 and look at logcat.
Test: adb shell write_sine_callback -pl -r44100
Test: adb logcat | grep -i aaudio | grep " E "
Test: Should see no "E" logs from AAudio.
Test: Should see no addresses from AAudio.
Change-Id: I1d4e0bc349095f818fad52603d2bb8e7317d3681
Merged-In: I1d4e0bc349095f818fad52603d2bb8e7317d3681
(cherry picked from commit 7ba46558fbd28b555ba751837cc9094a7c785f75)
diff --git a/services/oboeservice/AAudioServiceStreamShared.cpp b/services/oboeservice/AAudioServiceStreamShared.cpp
index 14742dd..2ca847a 100644
--- a/services/oboeservice/AAudioServiceStreamShared.cpp
+++ b/services/oboeservice/AAudioServiceStreamShared.cpp
@@ -111,7 +111,7 @@
capacityInFrames, MAX_FRAMES_PER_BUFFER);
return AAUDIO_ERROR_OUT_OF_RANGE;
}
- ALOGD("calculateBufferCapacity() requested %d frames, actual = %d",
+ ALOGV("calculateBufferCapacity() requested %d frames, actual = %d",
requestedCapacityFrames, capacityInFrames);
return capacityInFrames;
}
@@ -144,7 +144,7 @@
if (getFormat() == AUDIO_FORMAT_DEFAULT) {
setFormat(AUDIO_FORMAT_PCM_FLOAT);
} else if (getFormat() != AUDIO_FORMAT_PCM_FLOAT) {
- ALOGE("%s() audio_format_t mAudioFormat = %d, need FLOAT", __func__, getFormat());
+ ALOGD("%s() audio_format_t mAudioFormat = %d, need FLOAT", __func__, getFormat());
result = AAUDIO_ERROR_INVALID_FORMAT;
goto error;
}
@@ -153,7 +153,7 @@
if (getSampleRate() == AAUDIO_UNSPECIFIED) {
setSampleRate(endpoint->getSampleRate());
} else if (getSampleRate() != endpoint->getSampleRate()) {
- ALOGE("%s() mSampleRate = %d, need %d",
+ ALOGD("%s() mSampleRate = %d, need %d",
__func__, getSampleRate(), endpoint->getSampleRate());
result = AAUDIO_ERROR_INVALID_RATE;
goto error;
@@ -163,7 +163,7 @@
if (getSamplesPerFrame() == AAUDIO_UNSPECIFIED) {
setSamplesPerFrame(endpoint->getSamplesPerFrame());
} else if (getSamplesPerFrame() != endpoint->getSamplesPerFrame()) {
- ALOGE("%s() mSamplesPerFrame = %d, need %d",
+ ALOGD("%s() mSamplesPerFrame = %d, need %d",
__func__, getSamplesPerFrame(), endpoint->getSamplesPerFrame());
result = AAUDIO_ERROR_OUT_OF_RANGE;
goto error;
@@ -190,9 +190,6 @@
}
}
- ALOGD("%s() actual rate = %d, channels = %d, deviceId = %d",
- __func__, getSampleRate(), getSamplesPerFrame(), endpoint->getDeviceId());
-
result = endpoint->registerStream(keep);
if (result != AAUDIO_OK) {
goto error;
@@ -227,7 +224,7 @@
{
std::lock_guard<std::mutex> lock(mAudioDataQueueLock);
if (mAudioDataQueue == nullptr) {
- ALOGE("%s(): mUpMessageQueue null! - stream not open", __func__);
+ ALOGW("%s(): mUpMessageQueue null! - stream not open", __func__);
return AAUDIO_ERROR_NULL;
}
// Gather information on the data queue.
@@ -262,7 +259,7 @@
int64_t position = 0;
sp<AAudioServiceEndpoint> endpoint = mServiceEndpointWeak.promote();
if (endpoint == nullptr) {
- ALOGE("%s() has no endpoint", __func__);
+ ALOGW("%s() has no endpoint", __func__);
return AAUDIO_ERROR_INVALID_STATE;
}