summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2015-08-06 09:11:13 -0700
committerEric Laurent <elaurent@google.com>2015-08-06 09:14:37 -0700
commit45aabc3578f2362b82f5a425d44e75d4266b1c8c (patch)
treeda2bc7bbd63b628402972f65122c40fe1a186b07 /services
parent7db7948908b21ca2d878d6882cdf1a23a121182f (diff)
downloadframeworks_av-45aabc3578f2362b82f5a425d44e75d4266b1c8c.zip
frameworks_av-45aabc3578f2362b82f5a425d44e75d4266b1c8c.tar.gz
frameworks_av-45aabc3578f2362b82f5a425d44e75d4266b1c8c.tar.bz2
audio policy: populate attributes for attached capture devices
Populate supported sampling rates, channel masks and formats when enumerating attached build in capture devices. Having this information for build-in mic is important for some applications. Bug: 22729461. Change-Id: I93f03296447a87c10f2615fa1b1c45e9879b4aa7
Diffstat (limited to 'services')
-rw-r--r--services/audiopolicy/managerdefault/AudioPolicyManager.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index 7530dcc..fc27789 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -2854,8 +2854,12 @@ AudioPolicyManager::AudioPolicyManager(AudioPolicyClientInterface *clientInterfa
ssize_t index =
mAvailableInputDevices.indexOf(inProfile->mSupportedDevices[k]);
// give a valid ID to an attached device once confirmed it is reachable
- if (index >= 0 && !mAvailableInputDevices[index]->isAttached()) {
- mAvailableInputDevices[index]->attach(mHwModules[i]);
+ if (index >= 0) {
+ sp<DeviceDescriptor> devDesc = mAvailableInputDevices[index];
+ if (!devDesc->isAttached()) {
+ devDesc->attach(mHwModules[i]);
+ devDesc->importAudioPort(inProfile);
+ }
}
}
mpClientInterface->closeInput(input);