Do not log error if HAL does not support VOIP volume.
Some HAL implementations return INVALID_OPERATION when set_volume isn't supported. Currently, this log would get printed every iteration of the audio loop. Since AudioFlinger will fallback to software-based volume control, to prevent log spam, don't log this error.
Test: Manual, logging removed.
Change-Id: I5d06fadbcbec105fbec6289f8c03db1451cc46be
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index 02d058f..0f2717a 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -4575,7 +4575,8 @@
if ((mOutput->flags & AUDIO_OUTPUT_FLAG_VOIP_RX) != 0) {
if (*volume != mLeftVolFloat) {
result = mOutput->stream->setVolume(*volume, *volume);
- ALOGE_IF(result != OK,
+ // HAL can return INVALID_OPERATION if operation is not supported.
+ ALOGE_IF(result != OK && result != INVALID_OPERATION,
"Error when setting output stream volume: %d", result);
if (result == NO_ERROR) {
mLeftVolFloat = *volume;