Update seek position by using volume rocker in talkback mode.

Bug: 25452893
Change-Id: Iae3b0a2c2db4642d7cebc74c3ae47f5ab7ad7bc2
diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java b/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java
index 7d72028..19b592d 100644
--- a/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java
+++ b/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java
@@ -151,6 +151,11 @@
         @Override
         public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
             setClipPosition(progress, seekBar.getMax());
+            // Update the seek position if user manually changed it. This makes sure position gets
+            // updated when user use volume button to seek playback in talkback mode.
+            if (fromUser) {
+                mPresenter.seek(progress);
+            }
         }
     };
 
diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java
index e58cb34..fcb35e5 100644
--- a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java
+++ b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java
@@ -747,6 +747,15 @@
         }
     }
 
+    /**
+     * Seek to position. This is called when user manually seek the playback. It could be either
+     * by touch or volume button while in talkback mode.
+     * @param position
+     */
+    public void seek(int position) {
+        mPosition = position;
+    }
+
     private void enableProximitySensor() {
         if (mProximityWakeLock == null || mIsSpeakerphoneOn || !mIsPrepared
                 || mMediaPlayer == null || !mMediaPlayer.isPlaying()) {