diff options
author | twyen <twyen@google.com> | 2017-08-01 15:56:14 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-08-01 17:18:31 -0700 |
commit | 9cc5a590ca34ac4f05c5bb5c733b0587b4422427 (patch) | |
tree | 6654371e9cc7687fb73cc962944c4f70e4b7add4 /java/com | |
parent | 6adbdbe32d0aa6b0d71c2034dda427452c7b0b8b (diff) |
Prevent voicemail from playing when call is in progress
Visual voicemail playback uses the phone stream, which will cause all sort of audio conflict in a call. This CL forces voicemail playback to fail if a call is in progress.
Bug: 63584851
Test: manual - play voicemail while in call, "Cannot play voicemail" shown.
PiperOrigin-RevId: 163899919
Change-Id: I7350f6904b5a76f9c21a1d541f3c1f39271a5608
Diffstat (limited to 'java/com')
-rw-r--r-- | java/com/android/dialer/app/voicemail/VoicemailPlaybackPresenter.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/java/com/android/dialer/app/voicemail/VoicemailPlaybackPresenter.java b/java/com/android/dialer/app/voicemail/VoicemailPlaybackPresenter.java index 5c9bc01c2..6d5015a22 100644 --- a/java/com/android/dialer/app/voicemail/VoicemailPlaybackPresenter.java +++ b/java/com/android/dialer/app/voicemail/VoicemailPlaybackPresenter.java @@ -57,6 +57,7 @@ import com.android.dialer.constants.Constants; import com.android.dialer.logging.DialerImpression; import com.android.dialer.logging.Logger; import com.android.dialer.phonenumbercache.CallLogQuery; +import com.android.dialer.telecom.TelecomUtil; import com.android.dialer.util.PermissionsUtil; import com.google.common.io.ByteStreams; import java.io.File; @@ -515,6 +516,11 @@ public class VoicemailPlaybackPresenter mView.disableUiElements(); mIsPrepared = false; + if (mContext != null && TelecomUtil.isInCall(mContext)) { + handleError(new IllegalStateException("Cannot play voicemail when call is in progress")); + return; + } + try { mMediaPlayer = new MediaPlayer(); mMediaPlayer.setOnPreparedListener(this); |