summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/com/android/dialer/CallDetailActivity.java4
-rw-r--r--src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java16
2 files changed, 12 insertions, 8 deletions
diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java
index 7fa3750d2..ce29049d3 100644
--- a/src/com/android/dialer/CallDetailActivity.java
+++ b/src/com/android/dialer/CallDetailActivity.java
@@ -272,7 +272,7 @@ public class CallDetailActivity extends Activity {
@Override
public void onPause() {
if (mVoicemailPlaybackPresenter != null) {
- mVoicemailPlaybackPresenter.onPause();
+ mVoicemailPlaybackPresenter.onPause(isFinishing());
}
super.onPause();
}
@@ -280,7 +280,7 @@ public class CallDetailActivity extends Activity {
@Override
public void onDestroy() {
if (mVoicemailPlaybackPresenter != null) {
- mVoicemailPlaybackPresenter.onDestroy();
+ mVoicemailPlaybackPresenter.onDestroy(isFinishing());
}
super.onDestroy();
}
diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java
index 1ee376582..e8b04602d 100644
--- a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java
+++ b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java
@@ -170,24 +170,28 @@ public class VoicemailPlaybackPresenter
PlaybackView view, Uri voicemailUri, boolean startPlayingImmediately) {
mView = view;
mVoicemailUri = voicemailUri;
- setPosition(0, startPlayingImmediately);
mView.setPresenter(this);
- mIsPrepared = false;
+ if (!mMediaPlayer.isPlaying()) {
+ setPosition(0, startPlayingImmediately);
+ mIsPrepared = false;
+ }
checkForContent();
}
- public void onPause() {
- if (mMediaPlayer.isPlaying()) {
+ public void onPause(boolean isFinishing) {
+ // Do not pause for orientation changes.
+ if (mMediaPlayer.isPlaying() && isFinishing) {
pausePlayback(mMediaPlayer.getCurrentPosition(), mIsPlaying);
}
disableProximitySensor(false /* waitForFarState */);
}
- public void onDestroy() {
- if (mIsPrepared) {
+ public void onDestroy(boolean isFinishing) {
+ // Do not release for orientation changes.
+ if (mIsPrepared && isFinishing) {
mMediaPlayer.release();
mIsPrepared = false;
}