Loading services/audiopolicy/AudioPolicyManager.cpp +94 −76 Original line number Diff line number Diff line Loading @@ -2667,14 +2667,25 @@ AudioPolicyManager::AudioPolicyManager(AudioPolicyClientInterface *clientInterfa continue; } if ((outProfile->mFlags & AUDIO_OUTPUT_FLAG_DIRECT) != 0) { continue; } audio_devices_t profileType = outProfile->mSupportedDevices.types(); if ((profileType & mDefaultOutputDevice->mDeviceType) != AUDIO_DEVICE_NONE) { profileType = mDefaultOutputDevice->mDeviceType; } else { profileType = outProfile->mSupportedDevices[0]->mDeviceType; // chose first device present in mSupportedDevices also part of // outputDeviceTypes for (size_t k = 0; k < outProfile->mSupportedDevices.size(); k++) { profileType = outProfile->mSupportedDevices[k]->mDeviceType; if ((profileType & outputDeviceTypes) != 0) { break; } } } if ((profileType & outputDeviceTypes) == 0) { continue; } if ((profileType & outputDeviceTypes) && ((outProfile->mFlags & AUDIO_OUTPUT_FLAG_DIRECT) == 0)) { sp<AudioOutputDescriptor> outputDesc = new AudioOutputDescriptor(outProfile); outputDesc->mDevice = profileType; Loading Loading @@ -2720,7 +2731,6 @@ AudioPolicyManager::AudioPolicyManager(AudioPolicyClientInterface *clientInterfa true); } } } // open input streams needed to access attached devices to validate // mAvailableInputDevices list for (size_t j = 0; j < mHwModules[i]->mInputProfiles.size(); j++) Loading @@ -2731,9 +2741,18 @@ AudioPolicyManager::AudioPolicyManager(AudioPolicyClientInterface *clientInterfa ALOGW("Input profile contains no device on module %s", mHwModules[i]->mName); continue; } audio_devices_t profileType = inProfile->mSupportedDevices[0]->mDeviceType; // chose first device present in mSupportedDevices also part of // inputDeviceTypes audio_devices_t profileType = AUDIO_DEVICE_NONE; for (size_t k = 0; k < inProfile->mSupportedDevices.size(); k++) { profileType = inProfile->mSupportedDevices[k]->mDeviceType; if (profileType & inputDeviceTypes) { break; } } if ((profileType & inputDeviceTypes) == 0) { continue; } sp<AudioInputDescriptor> inputDesc = new AudioInputDescriptor(inProfile); inputDesc->mInputSource = AUDIO_SOURCE_MIC; Loading Loading @@ -2771,7 +2790,6 @@ AudioPolicyManager::AudioPolicyManager(AudioPolicyClientInterface *clientInterfa } } } } // make sure all attached devices have been allocated a unique ID for (size_t i = 0; i < mAvailableOutputDevices.size();) { if (mAvailableOutputDevices[i]->mId == 0) { Loading Loading
services/audiopolicy/AudioPolicyManager.cpp +94 −76 Original line number Diff line number Diff line Loading @@ -2667,14 +2667,25 @@ AudioPolicyManager::AudioPolicyManager(AudioPolicyClientInterface *clientInterfa continue; } if ((outProfile->mFlags & AUDIO_OUTPUT_FLAG_DIRECT) != 0) { continue; } audio_devices_t profileType = outProfile->mSupportedDevices.types(); if ((profileType & mDefaultOutputDevice->mDeviceType) != AUDIO_DEVICE_NONE) { profileType = mDefaultOutputDevice->mDeviceType; } else { profileType = outProfile->mSupportedDevices[0]->mDeviceType; // chose first device present in mSupportedDevices also part of // outputDeviceTypes for (size_t k = 0; k < outProfile->mSupportedDevices.size(); k++) { profileType = outProfile->mSupportedDevices[k]->mDeviceType; if ((profileType & outputDeviceTypes) != 0) { break; } } } if ((profileType & outputDeviceTypes) == 0) { continue; } if ((profileType & outputDeviceTypes) && ((outProfile->mFlags & AUDIO_OUTPUT_FLAG_DIRECT) == 0)) { sp<AudioOutputDescriptor> outputDesc = new AudioOutputDescriptor(outProfile); outputDesc->mDevice = profileType; Loading Loading @@ -2720,7 +2731,6 @@ AudioPolicyManager::AudioPolicyManager(AudioPolicyClientInterface *clientInterfa true); } } } // open input streams needed to access attached devices to validate // mAvailableInputDevices list for (size_t j = 0; j < mHwModules[i]->mInputProfiles.size(); j++) Loading @@ -2731,9 +2741,18 @@ AudioPolicyManager::AudioPolicyManager(AudioPolicyClientInterface *clientInterfa ALOGW("Input profile contains no device on module %s", mHwModules[i]->mName); continue; } audio_devices_t profileType = inProfile->mSupportedDevices[0]->mDeviceType; // chose first device present in mSupportedDevices also part of // inputDeviceTypes audio_devices_t profileType = AUDIO_DEVICE_NONE; for (size_t k = 0; k < inProfile->mSupportedDevices.size(); k++) { profileType = inProfile->mSupportedDevices[k]->mDeviceType; if (profileType & inputDeviceTypes) { break; } } if ((profileType & inputDeviceTypes) == 0) { continue; } sp<AudioInputDescriptor> inputDesc = new AudioInputDescriptor(inProfile); inputDesc->mInputSource = AUDIO_SOURCE_MIC; Loading Loading @@ -2771,7 +2790,6 @@ AudioPolicyManager::AudioPolicyManager(AudioPolicyClientInterface *clientInterfa } } } } // make sure all attached devices have been allocated a unique ID for (size_t i = 0; i < mAvailableOutputDevices.size();) { if (mAvailableOutputDevices[i]->mId == 0) { Loading