commit | 37a8cbea2e88a3bdc428075edea7e6d14eb0673f | [log] [tgz] |
---|---|---|
author | Treehugger Robot <treehugger-gerrit@google.com> | Tue Jun 30 16:57:14 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Jun 30 16:57:14 2020 +0000 |
tree | 78cb394b36e0265d54823dff9d826f582951acf6 | |
parent | 00300695bd81163e900c4773e33c97c191fb57ef [diff] | |
parent | 456051d0b9f41986e982b07d4b5462e377534bfe [diff] |
Merge "Fix direct/offload thread output devices into MSD" am: 24c46f1741 am: 5f829dead3 am: 456051d0b9 Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/1340017 Change-Id: I1c11e54398127996461a60f4572adbed0f2add0f
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp index c5c13e9..2661c30 100644 --- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp +++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -5446,6 +5446,12 @@ } } + // Do not retrieve engine device for outputs through MSD + // TODO: support explicit routing requests by resetting MSD patch to engine device. + if (outputDesc->devices() == getMsdAudioOutDevices()) { + return outputDesc->devices(); + } + // Honor explicit routing requests only if no client using default routing is active on this // input: a specific app can not force routing for other apps by setting a preferred device. bool active; // unused
diff --git a/services/audiopolicy/tests/AudioPolicyManagerTestClient.h b/services/audiopolicy/tests/AudioPolicyManagerTestClient.h index e1721ea..bdddf06 100644 --- a/services/audiopolicy/tests/AudioPolicyManagerTestClient.h +++ b/services/audiopolicy/tests/AudioPolicyManagerTestClient.h
@@ -75,6 +75,10 @@ status_t createAudioPatch(const struct audio_patch *patch, audio_patch_handle_t *handle, int /*delayMs*/) override { + auto iter = mActivePatches.find(*handle); + if (iter != mActivePatches.end()) { + mActivePatches.erase(*handle); + } *handle = mNextPatchHandle++; mActivePatches.insert(std::make_pair(*handle, *patch)); return NO_ERROR;