summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruabdullah <uabdullah@google.com>2018-06-22 13:03:39 -0700
committerEric Erfanian <erfanian@google.com>2018-06-26 16:22:26 +0000
commitffe31a01aee23b928d332b1308584638cc17e580 (patch)
tree4b88fea17d4706bbd5e97ea1a24c80927ab78986
parent336cc00d41656dc8651a4c24cfe1e8c6f5848d7a (diff)
Reset speaker mode when done with VVM Tab
Bug: 110530781,78281972 Test: N/A PiperOrigin-RevId: 201729044 Change-Id: Id00e8e3e4ee89b846bce78f4a29d5e6f26384e0c
-rw-r--r--java/com/android/dialer/app/calllog/VisualVoicemailCallLogFragment.java6
-rw-r--r--java/com/android/dialer/app/voicemail/VoicemailPlaybackPresenter.java3
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) {