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 a0e48546f..63467ddd6 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); @@ -196,6 +196,7 @@ public class VoicemailPlaybackPresenter } else { mVoicemailUri = voicemailUri; mPosition = 0; + mDuration.set(0); mIsPlaying = startPlayingImmediately; checkForContent(); } @@ -484,7 +485,7 @@ public class VoicemailPlaybackPresenter } enableProximitySensor(); - mView.onPlaybackStarted(mMediaPlayer, getScheduledExecutorServiceInstance()); + mView.onPlaybackStarted(mDuration.get(), getScheduledExecutorServiceInstance()); } /** @@ -566,6 +567,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); |