commit | 5f829dead32af6da25656e77203f4ca59e578ba5 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <treehugger-gerrit@google.com> | Tue Jun 30 16:26:22 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Jun 30 16:26:22 2020 +0000 |
tree | e311cb56bb4b7dce1a0f6a6a7757126b573e81e0 | |
parent | 5508d92ec686db28fc1d7f2e8339dd85b77575f6 [diff] | |
parent | 24c46f174182872a2000724c8c0c89b31697973c [diff] |
Merge "Fix direct/offload thread output devices into MSD" am: 24c46f1741 Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/1340017 Change-Id: I9c3abaee9e70d0acf7dba5518caee8ae52bcde84
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp index 67e085c..d51053b 100644 --- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp +++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -5266,6 +5266,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;