diff options
author | Eric Laurent <elaurent@google.com> | 2015-01-29 02:52:17 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-01-29 02:52:17 +0000 |
commit | 6dafb81dc699672f218915fa2895f8ee012203a9 (patch) | |
tree | ebf4401bd53fd91460b29eda1919179b75191767 /services/audiopolicy | |
parent | 6a0fbc68e203058e3b7d62e95d46f2415bc3ed95 (diff) | |
parent | 8c403b2265fdef64ac4ba903e6261edd22d81909 (diff) | |
download | frameworks_av-6dafb81dc699672f218915fa2895f8ee012203a9.zip frameworks_av-6dafb81dc699672f218915fa2895f8ee012203a9.tar.gz frameworks_av-6dafb81dc699672f218915fa2895f8ee012203a9.tar.bz2 |
am 8c403b22: am c84bc78d: Merge "Audio policy: fix device gain initialization" into lmp-mr1-dev
* commit '8c403b2265fdef64ac4ba903e6261edd22d81909':
Audio policy: fix device gain initialization
Diffstat (limited to 'services/audiopolicy')
-rw-r--r-- | services/audiopolicy/AudioPolicyManager.cpp | 12 | ||||
-rw-r--r-- | services/audiopolicy/AudioPolicyManager.h | 8 |
2 files changed, 15 insertions, 5 deletions
diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp index 0349327..fb74d66 100644 --- a/services/audiopolicy/AudioPolicyManager.cpp +++ b/services/audiopolicy/AudioPolicyManager.cpp @@ -7449,9 +7449,6 @@ AudioPolicyManager::DeviceDescriptor::DeviceDescriptor(const String8& name, audi NULL), mDeviceType(type), mAddress(""), mId(0) { - if (mGains.size() > 0) { - mGains[0]->getDefaultConfig(&mGain); - } } bool AudioPolicyManager::DeviceDescriptor::equals(const sp<DeviceDescriptor>& other) const @@ -7466,6 +7463,15 @@ bool AudioPolicyManager::DeviceDescriptor::equals(const sp<DeviceDescriptor>& ot mChannelMask == other->mChannelMask); } +void AudioPolicyManager::DeviceDescriptor::loadGains(cnode *root) +{ + AudioPort::loadGains(root); + if (mGains.size() > 0) { + mGains[0]->getDefaultConfig(&mGain); + } +} + + void AudioPolicyManager::DeviceVector::refreshTypes() { mDeviceTypes = AUDIO_DEVICE_NONE; diff --git a/services/audiopolicy/AudioPolicyManager.h b/services/audiopolicy/AudioPolicyManager.h index 0fa182b..2bc91e1 100644 --- a/services/audiopolicy/AudioPolicyManager.h +++ b/services/audiopolicy/AudioPolicyManager.h @@ -264,7 +264,7 @@ protected: audio_gain_mode_t loadGainMode(char *name); void loadGain(cnode *root, int index); - void loadGains(cnode *root); + virtual void loadGains(cnode *root); // searches for an exact match status_t checkExactSamplingRate(uint32_t samplingRate) const; @@ -344,10 +344,14 @@ protected: virtual ~DeviceDescriptor() {} bool equals(const sp<DeviceDescriptor>& other) const; + + // AudioPortConfig + virtual sp<AudioPort> getAudioPort() const { return (AudioPort*) this; } virtual void toAudioPortConfig(struct audio_port_config *dstConfig, const struct audio_port_config *srcConfig = NULL) const; - virtual sp<AudioPort> getAudioPort() const { return (AudioPort*) this; } + // AudioPort + virtual void loadGains(cnode *root); virtual void toAudioPort(struct audio_port *port) const; status_t dump(int fd, int spaces, int index) const; |