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

Commit 9f667585 authored by Yinchu Chen's avatar Yinchu Chen
Browse files

AudioPolicyManager:Fix CTS testGaplessMP3AudioTrackOffload fail

getDirectPlaybackSupport return AUDIO_DIRECT_OFFLOAD_GAPLESS_SUPPORTED,
but getOffloadSupport return AUDIO_OFFLOAD_NOT_SUPPORTED cause test
fail.
solution: not return offload support when offloadPossible is false.

Test: atest AudioTrackOffloadTest#testGaplessMP3AudioTrackOffload
AudioManagerTest#testAdjustUnmuteNotificationInVibrate
AudioManagerTest#testStreamTypeAliasChange
Bug: 304449830

Change-Id: Ia68e70b98469e5c35b74e20e062519a4eb91d592
parent 3dfcb5d7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4328,8 +4328,8 @@ audio_direct_mode_t AudioPolicyManager::getDirectPlaybackSupport(const audio_att
            if (!mAvailableOutputDevices.containsAtLeastOne(curProfile->getSupportedDevices())) {
                continue;
            }
            if ((curProfile->getFlags() & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD)
                        != AUDIO_OUTPUT_FLAG_NONE) {
            if (offloadPossible && ((curProfile->getFlags() & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD)
                        != AUDIO_OUTPUT_FLAG_NONE)) {
                if ((directMode & AUDIO_DIRECT_OFFLOAD_GAPLESS_SUPPORTED)
                        != AUDIO_DIRECT_NOT_SUPPORTED) {
                    // Already reports offload gapless supported. No need to report offload support.