diff options
author | Eric Laurent <elaurent@google.com> | 2011-10-19 14:02:10 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-10-19 14:02:10 -0700 |
commit | 545d1e935b8ee12255bbd443a89a4b8ec2aeeb35 (patch) | |
tree | 9d9a67c56a2d9e567cf34e04a4b677cfbd414d1b | |
parent | ca9f7f2d484ba0296db49406e3ef908bc7e119c1 (diff) | |
parent | a85a74a8219c03f2b1d1ef98f3f02e55f89f89a3 (diff) | |
download | frameworks_av-545d1e935b8ee12255bbd443a89a4b8ec2aeeb35.zip frameworks_av-545d1e935b8ee12255bbd443a89a4b8ec2aeeb35.tar.gz frameworks_av-545d1e935b8ee12255bbd443a89a4b8ec2aeeb35.tar.bz2 |
am 3c86134a: Merge "Fix issue 381905: BassBoostTest CTS tests fail..." into ics-mr0
* commit '3c86134a50618605c86eb9f5f120dbf97826e3e1':
Fix issue 381905: BassBoostTest CTS tests fail...
-rw-r--r-- | services/audioflinger/AudioFlinger.cpp | 11 | ||||
-rw-r--r-- | services/audioflinger/AudioFlinger.h | 8 |
2 files changed, 15 insertions, 4 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp index 3e0304f..69560e5 100644 --- a/services/audioflinger/AudioFlinger.cpp +++ b/services/audioflinger/AudioFlinger.cpp @@ -1332,7 +1332,13 @@ void AudioFlinger::ThreadBase::checkSuspendOnEffectEnabled(const sp<EffectModule int sessionId) { Mutex::Autolock _l(mLock); + checkSuspendOnEffectEnabled_l(effect, enabled, sessionId); +} +void AudioFlinger::ThreadBase::checkSuspendOnEffectEnabled_l(const sp<EffectModule>& effect, + bool enabled, + int sessionId) +{ if (mType != RECORD) { // suspend all effects in AUDIO_SESSION_OUTPUT_MIX when enabling any effect on // another session. This gives the priority to well behaved effect control panels @@ -5224,6 +5230,9 @@ void AudioFlinger::purgeStaleEffects_l() { sp<EffectHandle> handle = effect->mHandles[j].promote(); if (handle != 0) { handle->mEffect.clear(); + if (handle->mHasControl && handle->mEnabled) { + t->checkSuspendOnEffectEnabled_l(effect, false, effect->sessionId()); + } } } AudioSystem::unregisterEffect(effect->id()); @@ -6844,7 +6853,7 @@ void AudioFlinger::EffectHandle::disconnect(bool unpiniflast) } mEffect->disconnect(this, unpiniflast); - if (mEnabled) { + if (mHasControl && mEnabled) { sp<ThreadBase> thread = mEffect->thread().promote(); if (thread != 0) { thread->checkSuspendOnEffectEnabled(mEffect, false, mEffect->sessionId()); diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h index ed9d81e..4b794ef 100644 --- a/services/audioflinger/AudioFlinger.h +++ b/services/audioflinger/AudioFlinger.h @@ -492,10 +492,12 @@ private: int sessionId = AUDIO_SESSION_OUTPUT_MIX); // check if some effects must be suspended/restored when an effect is enabled // or disabled - virtual void checkSuspendOnEffectEnabled(const sp<EffectModule>& effect, + void checkSuspendOnEffectEnabled(const sp<EffectModule>& effect, bool enabled, int sessionId = AUDIO_SESSION_OUTPUT_MIX); - + void checkSuspendOnEffectEnabled_l(const sp<EffectModule>& effect, + bool enabled, + int sessionId = AUDIO_SESSION_OUTPUT_MIX); mutable Mutex mLock; protected: @@ -1299,7 +1301,7 @@ private: // suspend all eligible effects void setEffectSuspendedAll_l(bool suspend); // check if effects should be suspend or restored when a given effect is enable or disabled - virtual void checkSuspendOnEffectEnabled(const sp<EffectModule>& effect, + void checkSuspendOnEffectEnabled(const sp<EffectModule>& effect, bool enabled); status_t dump(int fd, const Vector<String16>& args); |