From 12bd6e4a5c26bd8035bf804d0cc821bd9b8cce9b Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Thu, 15 Mar 2012 09:33:34 -0700 Subject: Only duplicate notifications when no media is playing Map the NOTIFICATION stream type to a new strategy, named STRATEGY_NOTIFICATION_RESPECTFUL, which differs from STRATEGY_NOTIFICATION in that, when media is playing, the notifications will use the same output as the MEDIA strategy. This will results in the notifications not being duplicated on the speaker when a headset is in use for media playback. Change-Id: I032be0e2d383c69b5b6c912d7174753f5572c4b4 --- include/hardware_legacy/AudioPolicyManagerBase.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/hardware_legacy/AudioPolicyManagerBase.h') diff --git a/include/hardware_legacy/AudioPolicyManagerBase.h b/include/hardware_legacy/AudioPolicyManagerBase.h index 1459e7e..d24e2a0 100644 --- a/include/hardware_legacy/AudioPolicyManagerBase.h +++ b/include/hardware_legacy/AudioPolicyManagerBase.h @@ -39,6 +39,9 @@ namespace android_audio_legacy { // Time in milliseconds during which we consider that music is still active after a music // track was stopped - see computeVolume() #define SONIFICATION_HEADSET_MUSIC_DELAY 5000 +// Time in milliseconds after media stopped playing during which we consider that the +// sonification should be as unobtrusive as during the time media was playing. +#define SONIFICATION_RESPECTFUL_AFTER_MUSIC_DELAY 5000 // Time in milliseconds during witch some streams are muted while the audio path // is switched #define MUTE_TIME_MS 2000 @@ -151,6 +154,7 @@ protected: STRATEGY_MEDIA, STRATEGY_PHONE, STRATEGY_SONIFICATION, + STRATEGY_SONIFICATION_RESPECTFUL, STRATEGY_DTMF, STRATEGY_ENFORCED_AUDIBLE, NUM_STRATEGIES @@ -445,6 +449,9 @@ protected: private: static float volIndexToAmpl(audio_devices_t device, const StreamDescriptor& streamDesc, int indexInUi); + // updates device caching and output for streams that can influence the + // routing of notifications + void handleNotificationRoutingForStream(AudioSystem::stream_type stream); }; }; -- cgit v1.1