diff options
author | Sarmad Hashmi <mhashmi@google.com> | 2016-02-10 17:41:12 -0800 |
---|---|---|
committer | Sarmad Hashmi <mhashmi@google.com> | 2016-02-24 21:45:50 +0000 |
commit | 6d8399afae309207237456c27b336d948ed912ff (patch) | |
tree | 196e2ddcbefb4d2427f0888d6eebec8b5ca28e88 /src/com/android/dialer/voicemail | |
parent | 5d9fdc591a5e8b5b8b0cbb1d9060f10fc2816325 (diff) |
Fix bug where 00:00 duration is shown for voicemails without a duration.
Instead of showing a 00:00 duration, nothing is displayed. When the
content is loaded, the duration field for the call log entry associated
with the voicemail is updated with the duration fetched from the
mediaplayer. The proper duration is then displayed in MM:SS format.
BUG=24175525
Change-Id: I1cafebae4fcbc749f573accfcf8833b598675f0b
(cherry picked from commit 6f3016d9065564bf09a5759f16563a05abbe105d)
Diffstat (limited to 'src/com/android/dialer/voicemail')
-rw-r--r-- | src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java index 93ff00270..2bb4de932 100644 --- a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java +++ b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java @@ -36,6 +36,7 @@ import android.view.WindowManager.LayoutParams; import android.widget.SeekBar; import com.android.dialer.R; +import com.android.dialer.calllog.CallLogAsyncTaskUtil; import com.android.dialer.util.AsyncTaskExecutor; import com.android.dialer.util.AsyncTaskExecutors; import com.android.common.io.MoreCloseables; @@ -557,6 +558,12 @@ public class VoicemailPlaybackPresenter implements MediaPlayer.OnPreparedListene Log.d(TAG, "onPrepared"); mIsPrepared = true; + // Update the duration in the database if it was not previously retrieved + if (mDuration.get() == 0) { + CallLogAsyncTaskUtil.updateVoicemailDuration(mContext, mVoicemailUri, + mMediaPlayer.getDuration() / 1000); + } + mDuration.set(mMediaPlayer.getDuration()); Log.d(TAG, "onPrepared: mPosition=" + mPosition); |