summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorBart Sears <bsears@google.com>2012-01-06 15:45:13 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-01-06 15:45:13 -0800
commita476eed6b291d06f5e571597b928b7b2f0b3f257 (patch)
tree08bea7bd2f4c6d0cb2edc97ef6bbb2e21193a1f9 /core
parent2f143a966ccfec71de2c3a9785f5f3f47d418acb (diff)
parent149537cb70576fa2227ff665cb00afe72f9ac9b1 (diff)
downloadframeworks_base-a476eed6b291d06f5e571597b928b7b2f0b3f257.zip
frameworks_base-a476eed6b291d06f5e571597b928b7b2f0b3f257.tar.gz
frameworks_base-a476eed6b291d06f5e571597b928b7b2f0b3f257.tar.bz2
Merge "getDuration can be only called after prepared. DO NOT MERGE" into ics-mr1
Diffstat (limited to 'core')
-rw-r--r--core/java/android/webkit/HTML5Audio.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/java/android/webkit/HTML5Audio.java b/core/java/android/webkit/HTML5Audio.java
index 97d61ba..0baf2eb 100644
--- a/core/java/android/webkit/HTML5Audio.java
+++ b/core/java/android/webkit/HTML5Audio.java
@@ -311,7 +311,11 @@ class HTML5Audio extends Handler
}
private float getMaxTimeSeekable() {
- return mMediaPlayer.getDuration() / 1000.0f;
+ if (mState >= PREPARED) {
+ return mMediaPlayer.getDuration() / 1000.0f;
+ } else {
+ return 0;
+ }
}
private native void nativeOnBuffering(int percent, int nativePointer);