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

Commit 1f8da412 authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

audiopolicy: Match DIRECT and MMAP_NOIRQ flags exactly in IOProfile

Prevent selection of DIRECT and MMAP_NOIRQ output profiles
if these flags were not requested.

Test: atest audiopolicy_tests
Change-Id: I6940caed519b6237ea3038e646a84e4403a0c1ed
Merged-In: I6940caed519b6237ea3038e646a84e4403a0c1ed
parent bac92887
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -79,7 +79,8 @@ bool IOProfile::isCompatibleProfile(const DeviceVector &devices,
        }
    }

    const uint32_t mustMatchOutputFlags = AUDIO_OUTPUT_FLAG_HW_AV_SYNC;
    const uint32_t mustMatchOutputFlags =
            AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_HW_AV_SYNC|AUDIO_OUTPUT_FLAG_MMAP_NOIRQ;
    if (isPlaybackThread && (((getFlags() ^ flags) & mustMatchOutputFlags)
                    || (getFlags() & flags) != flags)) {
        return false;