diff options
author | Nancy Chen <nancychen@google.com> | 2015-07-15 23:29:30 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-07-15 23:29:30 +0000 |
commit | 4fd6bf292a04bb5d709e8a8d3fed643e1607c01e (patch) | |
tree | 863b2e71a13b38e0ae43d18958e429e71fe5da28 /src | |
parent | 70f2f9de8b3e16b06a6f64e35ecb4d7e881b10f9 (diff) | |
parent | 5559d41658f62e407e7f59c7f20c2a21555aa024 (diff) |
am 5559d416: Merge "Pause playback when voicemail is deleted." into mnc-dev
* commit '5559d41658f62e407e7f59c7f20c2a21555aa024':
Pause playback when voicemail is deleted.
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java | 1 | ||||
-rw-r--r-- | src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java b/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java index 2017bc578..70d6c6133 100644 --- a/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java +++ b/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java @@ -183,6 +183,7 @@ public class VoicemailPlaybackLayout extends LinearLayout if (mPresenter == null) { return; } + mPresenter.pausePlayback(); CallLogAsyncTaskUtil.deleteVoicemail(mContext, mVoicemailUri, null); } }; diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java index f76af59a4..90617df79 100644 --- a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java +++ b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java @@ -627,7 +627,8 @@ public class VoicemailPlaybackPresenter mMediaPlayer.pause(); } - mPosition = mMediaPlayer.getCurrentPosition(); + mPosition = mMediaPlayer == null ? 0 : mMediaPlayer.getCurrentPosition(); + Log.d(TAG, "Paused playback at " + mPosition + "."); if (mView != null) { @@ -646,7 +647,9 @@ public class VoicemailPlaybackPresenter * playing to know whether to resume playback once the user selects a new position. */ public void pausePlaybackForSeeking() { - mShouldResumePlaybackAfterSeeking = mMediaPlayer.isPlaying(); + if (mMediaPlayer != null) { + mShouldResumePlaybackAfterSeeking = mMediaPlayer.isPlaying(); + } pausePlayback(); } |