summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author James Dong <jdong@google.com> 2011-11-15 20:16:47 -0800
committer Android Git Automerger <android-git-automerger@android.com> 2011-11-15 20:16:47 -0800
commit4e72e2bfc24afe053ca98c6de2591a4057cfd9fa (patch)
tree5071202f980d8e18e80f00d2987facb075b416a6
parent868933e0e43faca442bc8d319898201b233cfb94 (diff)
parent4fdc36e6d6003cdce911678f0b233697554f8dbf (diff)
am 4fdc36e6: Merge "Document that release() should be called with onPause() and onStop() for media objects" into ics-mr1
* commit '4fdc36e6d6003cdce911678f0b233697554f8dbf': Document that release() should be called with onPause() and onStop() for media objects
-rw-r--r--media/java/android/media/MediaPlayer.java22
-rw-r--r--media/java/android/media/MediaRecorder.java15
2 files changed, 28 insertions, 9 deletions
diff --git a/media/java/android/media/MediaPlayer.java b/media/java/android/media/MediaPlayer.java
index eb32563d7388..8d71dcf644d0 100644
--- a/media/java/android/media/MediaPlayer.java
+++ b/media/java/android/media/MediaPlayer.java
@@ -1149,14 +1149,20 @@ 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. 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.
+ * done using the MediaPlayer. In particular, whenever an Activity
+ * of an application is paused (its onPause() method is called),
+ * or stopped (its onStop() method is called), this method should be
+ * invoked to release the MediaPlayer object, unless the application
+ * has a special need to keep the object around. In addition to
+ * unnecessary resources (such as memory and instances of codecs)
+ * being held, 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 for other applications if no multiple instances of the
+ * same codec are supported on a device. Even if multiple instances
+ * of the same codec are supported, some performance degradation
+ * may be expected when unnecessary multiple instances are used
+ * at the same time.
*/
public void release() {
stayAwake(false);
diff --git a/media/java/android/media/MediaRecorder.java b/media/java/android/media/MediaRecorder.java
index ceeacbb513ea..08e603252c5c 100644
--- a/media/java/android/media/MediaRecorder.java
+++ b/media/java/android/media/MediaRecorder.java
@@ -926,7 +926,20 @@ public class MediaRecorder
/**
* Releases resources associated with this MediaRecorder object.
* It is good practice to call this method when you're done
- * using the MediaRecorder.
+ * using the MediaRecorder. In particular, whenever an Activity
+ * of an application is paused (its onPause() method is called),
+ * or stopped (its onStop() method is called), this method should be
+ * invoked to release the MediaRecorder object, unless the application
+ * has a special need to keep the object around. In addition to
+ * unnecessary resources (such as memory and instances of codecs)
+ * being held, failure to call this method immediately if a
+ * MediaRecorder object is no longer needed may also lead to
+ * continuous battery consumption for mobile devices, and recording
+ * failure for other applications if no multiple instances of the
+ * same codec are supported on a device. Even if multiple instances
+ * of the same codec are supported, some performance degradation
+ * may be expected when unnecessary multiple instances are used
+ * at the same time.
*/
public native void release();