diff options
author | Nancy Chen <nancychen@google.com> | 2015-10-27 15:38:48 -0700 |
---|---|---|
committer | Nancy Chen <nancychen@google.com> | 2015-10-27 15:41:12 -0700 |
commit | 128fe6987ec832e63a21ab7d551c0b55494d8964 (patch) | |
tree | 1e4f81d78c467dc0dbff58a38f404736785ca2b2 /src | |
parent | 996cb6f52901ab9e67354978f7f04e677600ee9f (diff) |
Retain progress for voicemail playback when rebinding voicemail card.
When rebinding the voicemail card, onPrepared gets called and resets the
voicemail playback to 0 because mPosition is not updated to the most
recent value. Update mPosition in this case to the position of the media
player and then call onPrepared.
Bug: 25080811
Change-Id: Ief3a021f4c11bac7b8c0a563765e14c897cb43b5
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java index c0884ad1b..658aaec2d 100644 --- a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java +++ b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java @@ -246,6 +246,10 @@ public class VoicemailPlaybackPresenter implements MediaPlayer.OnPreparedListene // Handles cases where the same entry is binded again when scrolling in list, or where // the MediaPlayer was retained after an orientation change. if (mMediaPlayer != null && mIsPrepared && voicemailUri.equals(mVoicemailUri)) { + // If the voicemail card was rebinded, we need to set the position to the appropriate + // point. Since we retain the media player, we can just set it to the position of the + // media player. + mPosition = mMediaPlayer.getCurrentPosition(); onPrepared(mMediaPlayer); } else { if (!voicemailUri.equals(mVoicemailUri)) { |