audio effects: Eliminate the cause warning logs about unreleased interface
The cause of frequent "EffectModule 0xxx destructor called with unreleased
interface" messages was due to not releasing the effects when purging
stale effects.
The cause of "Effect handle 0xxx disconnected after thread destruction"
message was due to late binder call for disconnecting already purged
effect handle.
Also improved logging to communicate uuids of the effects causing
these issues.
Bug: 62267926
Test: no aforementioned warnings in the log when opening the Effects
panel in Play Music
Change-Id: I6ec6f60c46dc704226931fb59a641e4cd74c2fd1
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 0df9a39..3a95a3b 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -2603,7 +2603,7 @@
while (ec->mEffects.size()) {
sp<EffectModule> effect = ec->mEffects[0];
effect->unPin();
- t->removeEffect_l(effect);
+ t->removeEffect_l(effect, /*release*/ true);
if (effect->purgeHandles()) {
t->checkSuspendOnEffectEnabled_l(effect, false, effect->sessionId());
}