summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2011-02-22 13:36:12 -0800
committerJames Dong <jdong@google.com>2011-02-22 13:45:57 -0800
commit14460b9564ab700a8d426855003064568bff31e3 (patch)
tree1370de9e6507241741d7f6270071cce550380733 /media
parent7036d76a6e172de300c63cb9c33b65a63fe7ce0f (diff)
downloadframeworks_base-14460b9564ab700a8d426855003064568bff31e3.zip
frameworks_base-14460b9564ab700a8d426855003064568bff31e3.tar.gz
frameworks_base-14460b9564ab700a8d426855003064568bff31e3.tar.bz2
Added more warnings in javadoc for failure to call MediaPlayer.release() immediately if a MediaPlayer is not needed
bug - 3040402 Change-Id: I455d2a664851c73212711e8c4b88e97b50ee5b62
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/MediaPlayer.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/media/java/android/media/MediaPlayer.java b/media/java/android/media/MediaPlayer.java
index f61ac0f..98ddbe7 100644
--- a/media/java/android/media/MediaPlayer.java
+++ b/media/java/android/media/MediaPlayer.java
@@ -1055,7 +1055,14 @@ public class MediaPlayer
/**
* Releases resources associated with this MediaPlayer object.
* It is considered good practice to call this method when you're
- * done using the MediaPlayer.
+ * done using the MediaPlayer. For instance, whenever the Activity
+ * of an application is paused, this method should be invoked to
+ * release the MediaPlayer object. In addition to unnecessary resources
+ * (such as memory and instances of codecs) being hold, failure to
+ * call this method immediately if a MediaPlayer object is no longer
+ * needed may also lead to continuous battery consumption for mobile
+ * devices, and playback failure if no multiple instances of the
+ * same codec is supported on a device.
*/
public void release() {
stayAwake(false);