diff options
Diffstat (limited to 'src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java')
-rw-r--r-- | src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java index 5b4478f53..d47e9e213 100644 --- a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java +++ b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java @@ -78,7 +78,7 @@ public class VoicemailPlaybackPresenter void disableUiElements(); void enableUiElements(); void onPlaybackError(Exception e); - void onPlaybackStarted(MediaPlayer mediaPlayer, ScheduledExecutorService executorService); + void onPlaybackStarted(int duration, ScheduledExecutorService executorService); void onPlaybackStopped(); void onSpeakerphoneOn(boolean on); void setClipPosition(int clipPositionInMillis, int clipLengthInMillis); @@ -197,6 +197,7 @@ public class VoicemailPlaybackPresenter } else { mVoicemailUri = voicemailUri; mPosition = 0; + mDuration.set(0); mIsPlaying = startPlayingImmediately; // Default to earpiece. @@ -498,7 +499,7 @@ public class VoicemailPlaybackPresenter } enableProximitySensor(); - mView.onPlaybackStarted(mMediaPlayer, getScheduledExecutorServiceInstance()); + mView.onPlaybackStarted(mDuration.get(), getScheduledExecutorServiceInstance()); } /** @@ -584,6 +585,10 @@ public class VoicemailPlaybackPresenter return mVoicemailUri; } + public int getMediaPlayerPosition() { + return mIsPrepared ? mMediaPlayer.getCurrentPosition() : 0; + } + private static synchronized ScheduledExecutorService getScheduledExecutorServiceInstance() { if (mScheduledExecutorService == null) { mScheduledExecutorService = Executors.newScheduledThreadPool(NUMBER_OF_THREADS_IN_POOL); |