sm8550-common: audio-impl: Verify that hal implements get_audio_port before calling
Change-Id: I3652382433d365407bf006d71f36743aa89a76ee
This commit is contained in:
@@ -404,6 +404,10 @@ template <typename HalPort>
|
||||
Return<void> Device::getAudioPortImpl(const AudioPort& port, getAudioPort_cb _hidl_cb,
|
||||
int (*halGetter)(audio_hw_device_t*, HalPort*),
|
||||
const char* halGetterName) {
|
||||
if (halGetter == nullptr) {
|
||||
_hidl_cb(Result::NOT_SUPPORTED, port);
|
||||
return Void();
|
||||
}
|
||||
HalPort halPort;
|
||||
if (status_t status = HidlUtils::audioPortToHal(port, &halPort); status != NO_ERROR) {
|
||||
_hidl_cb(analyzeStatus("audioPortToHal", status), port);
|
||||
|
Reference in New Issue
Block a user