From bebeaf9ae3251e24a214951e6559cd40f15ef4fb Mon Sep 17 00:00:00 2001 From: Wei Jia Date: Wed, 19 Apr 2017 16:22:10 -0700 Subject: [PATCH] MediaPlayer: fix new API seekTo to address API review. Test: compiles Bug: 36790516 Bug: 37514763 Change-Id: I91307d10e6c9bc65779651c056053b3a025b0d50 --- api/current.txt | 2 +- api/system-current.txt | 2 +- api/test-current.txt | 2 +- media/java/android/media/MediaPlayer.java | 42 ++++++++++++++--------- media/jni/android_media_MediaPlayer.cpp | 8 ++--- 5 files changed, 32 insertions(+), 24 deletions(-) diff --git a/api/current.txt b/api/current.txt index 20d249dabe687..9d5e89d891d32 100644 --- a/api/current.txt +++ b/api/current.txt @@ -22776,7 +22776,7 @@ package android.media { method public void releaseDrm() throws android.media.MediaPlayer.NoDrmSchemeException; method public void reset(); method public void restoreKeys(byte[]) throws android.media.MediaPlayer.NoDrmSchemeException; - method public void seekTo(int, int) throws java.lang.IllegalStateException; + method public void seekTo(long, int); method public void seekTo(int) throws java.lang.IllegalStateException; method public void selectTrack(int) throws java.lang.IllegalStateException; method public void setAudioAttributes(android.media.AudioAttributes) throws java.lang.IllegalArgumentException; diff --git a/api/system-current.txt b/api/system-current.txt index 035d80ac36f16..069645cd0a156 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -24612,7 +24612,7 @@ package android.media { method public void releaseDrm() throws android.media.MediaPlayer.NoDrmSchemeException; method public void reset(); method public void restoreKeys(byte[]) throws android.media.MediaPlayer.NoDrmSchemeException; - method public void seekTo(int, int) throws java.lang.IllegalStateException; + method public void seekTo(long, int); method public void seekTo(int) throws java.lang.IllegalStateException; method public void selectTrack(int) throws java.lang.IllegalStateException; method public void setAudioAttributes(android.media.AudioAttributes) throws java.lang.IllegalArgumentException; diff --git a/api/test-current.txt b/api/test-current.txt index f37ef916efe37..9922ee326ea25 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -22883,7 +22883,7 @@ package android.media { method public void releaseDrm() throws android.media.MediaPlayer.NoDrmSchemeException; method public void reset(); method public void restoreKeys(byte[]) throws android.media.MediaPlayer.NoDrmSchemeException; - method public void seekTo(int, int) throws java.lang.IllegalStateException; + method public void seekTo(long, int); method public void seekTo(int) throws java.lang.IllegalStateException; method public void selectTrack(int) throws java.lang.IllegalStateException; method public void setAudioAttributes(android.media.AudioAttributes) throws java.lang.IllegalArgumentException; diff --git a/media/java/android/media/MediaPlayer.java b/media/java/android/media/MediaPlayer.java index d5efc971d1fd5..d65367588484a 100644 --- a/media/java/android/media/MediaPlayer.java +++ b/media/java/android/media/MediaPlayer.java @@ -140,7 +140,7 @@ import java.util.Vector; * {@link #getVideoWidth()}, {@link #setAudioAttributes(AudioAttributes)}, * {@link #setLooping(boolean)}, * {@link #setVolume(float, float)}, {@link #pause()}, {@link #start()}, - * {@link #stop()}, {@link #seekTo(int, int)}, {@link #prepare()} or + * {@link #stop()}, {@link #seekTo(long, int)}, {@link #prepare()} or * {@link #prepareAsync()} in the Idle state for both cases. If any of these * methods is called right after a MediaPlayer object is constructed, * the user supplied callback method OnErrorListener.onError() won't be @@ -286,9 +286,9 @@ import java.util.Vector; * * *
  • The playback position can be adjusted with a call to - * {@link #seekTo(int, int)}. + * {@link #seekTo(long, int)}. *