summaryrefslogtreecommitdiff
path: root/src/com
diff options
context:
space:
mode:
authorQi Wang <wangqi@google.com>2016-03-03 18:24:40 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-03-03 18:24:40 +0000
commitf998add653625ebcfd7032626d59085808ba18a5 (patch)
tree03949b3f56a0f7e0ebae61f71d95e0a6e82c7b7a /src/com
parent79e26069d22c0951eb12682ad6ced19b8576dc14 (diff)
parent1900ad92de73a88363f00a1259de22fc585b3810 (diff)
Merge "Update seek position by using volume rocker in talkback mode." into nyc-dev
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java5
-rw-r--r--src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java9
2 files changed, 14 insertions, 0 deletions
diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java b/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java
index 7d72028b1..19b592d50 100644
--- a/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java
+++ b/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java
@@ -151,6 +151,11 @@ public class VoicemailPlaybackLayout extends LinearLayout
@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 e58cb3405..fcb35e57b 100644
--- a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java
+++ b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java
@@ -747,6 +747,15 @@ public class VoicemailPlaybackPresenter implements MediaPlayer.OnPreparedListene
}
}
+ /**
+ * 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()) {