Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c90ff661 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "audiopolicy_fuzzer : Bug Fix"

parents e1c4aaf3 997d3735
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -127,12 +127,19 @@ static const std::vector<audio_usage_t> kAudioUsages = [] {
    return result;
}();

/**
 * AudioSource - AUDIO_SOURCE_VOICE_COMMUNICATION and AUDIO_SOURCE_HOTWORD
 * are excluded from kAudioSources[] in order to avoid the abort triggered
 * for these two types of AudioSource in Engine::getDeviceForInputSource()
 */
static const std::vector<audio_source_t> kAudioSources = [] {
    std::vector<audio_source_t> result;
    for (const auto enumVal : xsdc_enum_range<xsd::AudioSource>{}) {
        audio_source_t audioSourceHal;
        std::string audioSource = toString(enumVal);
        if (audio_source_from_string(audioSource.c_str(), &audioSourceHal)) {
        if (enumVal != xsd::AudioSource::AUDIO_SOURCE_VOICE_COMMUNICATION &&
            enumVal != xsd::AudioSource::AUDIO_SOURCE_HOTWORD &&
            audio_source_from_string(audioSource.c_str(), &audioSourceHal)) {
          result.push_back(audioSourceHal);
        }
    }