Add dynamic source default effects
Allows runtime modification of what effects should be default
attached to sources of different types. The core functionality
was already in the AudioPolicyEffects system, this allows
the dynamic modification of the lists.
Bug: 78527120
Test: Builds, manually tested an app adding a source effect,
tested both media on the specified source and on a different source.
Also tested by Android Things integration tests.
Change-Id: I4da15787278c79d80043e172f4f81d3b2a139f44
diff --git a/services/audiopolicy/service/AudioPolicyEffects.h b/services/audiopolicy/service/AudioPolicyEffects.h
index 69367b1..6ad01f7 100644
--- a/services/audiopolicy/service/AudioPolicyEffects.h
+++ b/services/audiopolicy/service/AudioPolicyEffects.h
@@ -81,7 +81,15 @@
audio_stream_type_t stream,
audio_session_t audioSession);
- // Add the effect to the list of default effects for streams of type |stream|.
+ // Add the effect to the list of default effects for sources of type |source|.
+ status_t addSourceDefaultEffect(const effect_uuid_t *type,
+ const String16& opPackageName,
+ const effect_uuid_t *uuid,
+ int32_t priority,
+ audio_source_t source,
+ audio_unique_id_t* id);
+
+ // Add the effect to the list of default effects for streams of a given usage.
status_t addStreamDefaultEffect(const effect_uuid_t *type,
const String16& opPackageName,
const effect_uuid_t *uuid,
@@ -89,6 +97,9 @@
audio_usage_t usage,
audio_unique_id_t* id);
+ // Remove the default source effect from wherever it's attached.
+ status_t removeSourceDefaultEffect(audio_unique_id_t id);
+
// Remove the default stream effect from wherever it's attached.
status_t removeStreamDefaultEffect(audio_unique_id_t id);