From bb6c9a05840d924b502ce0f1868fca4881ada1ed Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Thu, 25 Sep 2014 14:11:47 -0700 Subject: audio: fix stream type for accessibility usage Make sure that accessibility prompts are heard when a ringtone is active by forcing stream type to AUDIO_STREAM_RING when phone state is AUDIO_MODE_RINGTONE. Bug: 17558149. Change-Id: Ia3bead8052fca5cbf282c267f7b9b06014fef628 --- media/libmedia/AudioSystem.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'media/libmedia/AudioSystem.cpp') diff --git a/media/libmedia/AudioSystem.cpp b/media/libmedia/AudioSystem.cpp index 1742fbe..dda3657 100644 --- a/media/libmedia/AudioSystem.cpp +++ b/media/libmedia/AudioSystem.cpp @@ -939,6 +939,15 @@ status_t AudioSystem::releaseSoundTriggerSession(audio_session_t session) if (aps == 0) return PERMISSION_DENIED; return aps->releaseSoundTriggerSession(session); } + +audio_mode_t AudioSystem::getPhoneState() +{ + const sp& aps = AudioSystem::get_audio_policy_service(); + if (aps == 0) return AUDIO_MODE_INVALID; + return aps->getPhoneState(); +} + + // --------------------------------------------------------------------------- void AudioSystem::AudioPolicyServiceClient::binderDied(const wp& who __unused) -- cgit v1.1