diff options
-rw-r--r-- | java/com/android/dialer/app/calllog/VisualVoicemailCallLogFragment.java | 6 | ||||
-rw-r--r-- | java/com/android/dialer/app/voicemail/VoicemailPlaybackPresenter.java | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/java/com/android/dialer/app/calllog/VisualVoicemailCallLogFragment.java b/java/com/android/dialer/app/calllog/VisualVoicemailCallLogFragment.java index 930edd186..5575cacc5 100644 --- a/java/com/android/dialer/app/calllog/VisualVoicemailCallLogFragment.java +++ b/java/com/android/dialer/app/calllog/VisualVoicemailCallLogFragment.java @@ -127,6 +127,12 @@ public class VisualVoicemailCallLogFragment extends CallLogFragment { public void onPause() { voicemailPlaybackPresenter.onPause(); voicemailErrorManager.onPause(); + // Necessary to reset the speaker when leaving otherwise the platform will still remain in + // speaker mode + AudioManager audioManager = getContext().getSystemService(AudioManager.class); + if (audioManager.isSpeakerphoneOn()) { + audioManager.setSpeakerphoneOn(false); + } super.onPause(); } diff --git a/java/com/android/dialer/app/voicemail/VoicemailPlaybackPresenter.java b/java/com/android/dialer/app/voicemail/VoicemailPlaybackPresenter.java index 6d1728f34..6fc8d23e3 100644 --- a/java/com/android/dialer/app/voicemail/VoicemailPlaybackPresenter.java +++ b/java/com/android/dialer/app/voicemail/VoicemailPlaybackPresenter.java @@ -24,6 +24,7 @@ import android.content.Context; import android.content.Intent; import android.database.ContentObserver; import android.database.Cursor; +import android.media.AudioManager; import android.media.MediaPlayer; import android.net.Uri; import android.os.AsyncTask; @@ -207,6 +208,8 @@ public class VoicemailPlaybackPresenter position = savedInstanceState.getInt(CLIP_POSITION_KEY, 0); isPlaying = savedInstanceState.getBoolean(IS_PLAYING_STATE_KEY, false); isSpeakerphoneOn = savedInstanceState.getBoolean(IS_SPEAKERPHONE_ON_KEY, false); + AudioManager audioManager = activity.getSystemService(AudioManager.class); + audioManager.setSpeakerphoneOn(isSpeakerphoneOn); } if (mediaPlayer == null) { |