diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-03-01 00:41:26 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-03-01 00:41:26 +0000 |
commit | 360c751fe5f6e75d45dfbe05facf225bfe5d2eca (patch) | |
tree | 365d08cd3bcdfa0205c136aa60777b2912bcb8e4 /java/com/android/dialer/voicemail/listui | |
parent | 5959cb2ea88aa5d95dff3cde8823775a86417757 (diff) | |
parent | 99e0aa4d3be26001182634f15327da5b0749c74c (diff) |
Merge changes I3f6a5887,Icf91804d
* changes:
Never start playing voicemails in the NUI VM tab from the speaker
Remove background of RTT chat fragment.
Diffstat (limited to 'java/com/android/dialer/voicemail/listui')
-rw-r--r-- | java/com/android/dialer/voicemail/listui/NewVoicemailMediaPlayer.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/java/com/android/dialer/voicemail/listui/NewVoicemailMediaPlayer.java b/java/com/android/dialer/voicemail/listui/NewVoicemailMediaPlayer.java index 519a0dfbd..efa1060ed 100644 --- a/java/com/android/dialer/voicemail/listui/NewVoicemailMediaPlayer.java +++ b/java/com/android/dialer/voicemail/listui/NewVoicemailMediaPlayer.java @@ -17,6 +17,7 @@ package com.android.dialer.voicemail.listui; import android.content.Context; +import android.media.AudioManager; import android.media.MediaPlayer; import android.media.MediaPlayer.OnCompletionListener; import android.media.MediaPlayer.OnErrorListener; @@ -63,6 +64,7 @@ public class NewVoicemailMediaPlayer { () -> { try { mediaPlayer.setDataSource(context, uri); + setAudioManagerToNonSpeakerMode(context); } catch (IOException e) { LogUtil.i( "NewVoicemailMediaPlayer", @@ -86,6 +88,13 @@ public class NewVoicemailMediaPlayer { } } + /** We should never start playing voicemails from the speaker mode */ + private void setAudioManagerToNonSpeakerMode(Context context) { + AudioManager audioManager = context.getSystemService(AudioManager.class); + audioManager.setMode(AudioManager.STREAM_MUSIC); + audioManager.setSpeakerphoneOn(false); + } + private void verifyListenersNotNull() { Assert.isNotNull( newVoicemailMediaPlayerOnErrorListener, |