Effects: add new effect volume flag
Add new effect flag to monitor requested volume from
audio framework.
Pass requested volume directly if effect is volume monitor,
and others still follow an original rule by volume controller.
Bug: 123251705
Test: On/off equalizer on spotify/google music.
Switch songs with equalizer
Attach an effect with EFFECT_FLAG_INSERT_ANY,
EFFECT_FLAG_INSERT_FIRST,
EFFECT_FLAG_INSERT_LAST
and check received volume.
Change-Id: I01632bebb32aa6f921c964536039d43859ae3632
Signed-off-by: Jasmine Cha <chajasmine@google.com>
diff --git a/services/audioflinger/Effects.h b/services/audioflinger/Effects.h
index 15a26ea..58ce351 100644
--- a/services/audioflinger/Effects.h
+++ b/services/audioflinger/Effects.h
@@ -134,6 +134,9 @@
bool isVolumeControl() const
{ return (mDescriptor.flags & EFFECT_FLAG_VOLUME_MASK)
== EFFECT_FLAG_VOLUME_CTRL; }
+ bool isVolumeMonitor() const
+ { return (mDescriptor.flags & EFFECT_FLAG_VOLUME_MASK)
+ == EFFECT_FLAG_VOLUME_MONITOR; }
status_t setOffloaded(bool offloaded, audio_io_handle_t io);
bool isOffloaded() const;
void addEffectToHal_l();