diff options
author | Qi Wang <wangqi@google.com> | 2016-03-03 18:29:57 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-03-03 18:29:57 +0000 |
commit | 384a96a5e6f2e52e6a8a905906f8880bedd727cf (patch) | |
tree | 8d0f939332c539440199ca46d7a58dc0e93ea192 /src/com/android | |
parent | 8d77890beeca6c9812de2d324277a0e57bd0cae2 (diff) | |
parent | 279ef2f495153e471ff9cded39b1d847b7973b11 (diff) |
Merge "Update seek position by using volume rocker in talkback mode." into nyc-dev am: f998add653
am: 279ef2f495
* commit '279ef2f495153e471ff9cded39b1d847b7973b11':
Update seek position by using volume rocker in talkback mode.
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java | 5 | ||||
-rw-r--r-- | src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java | 9 |
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()) { |