diff options
Diffstat (limited to 'services/audioflinger/AudioFlinger.cpp')
| -rw-r--r-- | services/audioflinger/AudioFlinger.cpp | 11 | 
1 files changed, 10 insertions, 1 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());  | 
