Loading services/audiopolicy/common/managerdefinitions/include/AudioIODescriptorInterface.h +15 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,21 @@ sp<DeviceDescriptor> findPreferredDevice( if (activeClients.size() == activeClientsWithRoute.size()) { return devices.getDeviceFromId(activeClientsWithRoute[0]->preferredDeviceId()); } if (activeClientsWithRoute.size() == 0) { return nullptr; } uid_t uniqueUid = activeClients[0]->uid(); for (const auto &client : activeClients) { if (uniqueUid != client->uid()) { return nullptr; } } for (const auto &client : activeClientsWithRoute) { if (uniqueUid != client->uid()) { return nullptr; } } return devices.getDeviceFromId(activeClientsWithRoute[0]->preferredDeviceId()); } } return nullptr; Loading services/audiopolicy/managerdefault/AudioPolicyManager.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -7839,7 +7839,8 @@ sp<DeviceDescriptor> AudioPolicyManager::getNewInputDevice( } // 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. // input or if all active clients are from the same app: a specific app can not force routing // for other apps by setting a preferred device. bool active; device = findPreferredDevice(inputDesc, AUDIO_SOURCE_DEFAULT, active, mAvailableInputDevices); if (device != nullptr) { Loading Loading
services/audiopolicy/common/managerdefinitions/include/AudioIODescriptorInterface.h +15 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,21 @@ sp<DeviceDescriptor> findPreferredDevice( if (activeClients.size() == activeClientsWithRoute.size()) { return devices.getDeviceFromId(activeClientsWithRoute[0]->preferredDeviceId()); } if (activeClientsWithRoute.size() == 0) { return nullptr; } uid_t uniqueUid = activeClients[0]->uid(); for (const auto &client : activeClients) { if (uniqueUid != client->uid()) { return nullptr; } } for (const auto &client : activeClientsWithRoute) { if (uniqueUid != client->uid()) { return nullptr; } } return devices.getDeviceFromId(activeClientsWithRoute[0]->preferredDeviceId()); } } return nullptr; Loading
services/audiopolicy/managerdefault/AudioPolicyManager.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -7839,7 +7839,8 @@ sp<DeviceDescriptor> AudioPolicyManager::getNewInputDevice( } // 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. // input or if all active clients are from the same app: a specific app can not force routing // for other apps by setting a preferred device. bool active; device = findPreferredDevice(inputDesc, AUDIO_SOURCE_DEFAULT, active, mAvailableInputDevices); if (device != nullptr) { Loading