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

Commit 373401cb authored by Yinchu Chen's avatar Yinchu Chen Committed by Dorin Drimus
Browse files

Do not support direct effect when the non-offload effect is enabled

When the non-offload effect is ON, no other direct tracks can be created, which means
that the API reports the direct profiles are not available/supported by the device.

Bug: b/246759253

Test: CTS - android.media.audio.cts.DirectAudioProfilesForAttributesTest
Merged-In: Ifa83be883c81925a757fd121f51c5d476fb9cdf8
Change-Id: Ifa83be883c81925a757fd121f51c5d476fb9cdf8
parent 05ea0be1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -4097,6 +4097,10 @@ audio_direct_mode_t AudioPolicyManager::getDirectPlaybackSupport(const audio_att

status_t AudioPolicyManager::getDirectProfilesForAttributes(const audio_attributes_t* attr,
                                                AudioProfileVector& audioProfilesVector) {
    if (mEffects.isNonOffloadableEffectEnabled()) {
        return OK;
    }

    AudioDeviceTypeAddrVector devices;
    status_t status = getDevicesForAttributes(*attr, &devices, false /* forVolume */);
    if (status != OK) {