summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNancy Chen <nancychen@google.com>2015-07-15 23:40:24 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-07-15 23:40:24 +0000
commit70b010e82acde3ae12a8d836c1a939fcf98fb74b (patch)
tree6c6f14d2d79ad536504a58b71d93cfee4286144c /src
parent597e4df3d7a2dad587c71210364a75f729eb181a (diff)
parent4fd6bf292a04bb5d709e8a8d3fed643e1607c01e (diff)
am 4fd6bf29: am 5559d416: Merge "Pause playback when voicemail is deleted." into mnc-dev
* commit '4fd6bf292a04bb5d709e8a8d3fed643e1607c01e': Pause playback when voicemail is deleted.
Diffstat (limited to 'src')
-rw-r--r--src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java1
-rw-r--r--src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java7
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();
}