AudioSystem: no error log for virtual source conversion to stream
When converting audio attributes to stream type, do not log an
error if no product strategy support USAGE_VIRTUAL_SOURCE.
Bug: 146558301
Test: check logs after using AudioPolicy for injection
Change-Id: I8313b9d27583934e7a64edbfe49d52bad587f372
diff --git a/media/libaudioclient/AudioSystem.cpp b/media/libaudioclient/AudioSystem.cpp
index cb9c7ba..480930b 100644
--- a/media/libaudioclient/AudioSystem.cpp
+++ b/media/libaudioclient/AudioSystem.cpp
@@ -1491,7 +1491,14 @@
}
}
}
- ALOGE("invalid attributes %s when converting to stream", toString(attr).c_str());
+ switch (attr.usage) {
+ case AUDIO_USAGE_VIRTUAL_SOURCE:
+ // virtual source is not expected to have an associated product strategy
+ break;
+ default:
+ ALOGE("invalid attributes %s when converting to stream", toString(attr).c_str());
+ break;
+ }
return AUDIO_STREAM_MUSIC;
}