diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2012-03-15 09:33:34 -0700 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2012-04-02 09:31:09 -0700 |
commit | 12bd6e4a5c26bd8035bf804d0cc821bd9b8cce9b (patch) | |
tree | 3073991cdb70440f70dcc2a446f2830f87a0ca5a /include/hardware_legacy/AudioPolicyManagerBase.h | |
parent | 48fa8d5b1c55f7ee0762b5c40176f397cf137875 (diff) | |
download | hardware_libhardware_legacy-12bd6e4a5c26bd8035bf804d0cc821bd9b8cce9b.zip hardware_libhardware_legacy-12bd6e4a5c26bd8035bf804d0cc821bd9b8cce9b.tar.gz hardware_libhardware_legacy-12bd6e4a5c26bd8035bf804d0cc821bd9b8cce9b.tar.bz2 |
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
Diffstat (limited to 'include/hardware_legacy/AudioPolicyManagerBase.h')
-rw-r--r-- | include/hardware_legacy/AudioPolicyManagerBase.h | 7 |
1 files changed, 7 insertions, 0 deletions
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); }; }; |