summaryrefslogtreecommitdiffstats
path: root/media/java
diff options
context:
space:
mode:
authorInsun Kang <insun@google.com>2012-05-04 20:52:57 +0900
committerInsun Kang <insun@google.com>2012-05-07 11:31:18 +0900
commitbe0ea968bf8b3f92f6975ccd14031aec23a2c47f (patch)
tree6d961deab229be527c0fd98b0b51ec7e121919ae /media/java
parent58d5ff875750755f166ec943ca0bf177bdba9683 (diff)
downloadframeworks_base-be0ea968bf8b3f92f6975ccd14031aec23a2c47f.zip
frameworks_base-be0ea968bf8b3f92f6975ccd14031aec23a2c47f.tar.gz
frameworks_base-be0ea968bf8b3f92f6975ccd14031aec23a2c47f.tar.bz2
Fix: Missed parcel recycling in MediaPlayer.
Change-Id: I2c99f771b33bf627af10e8baea455181558360e6 related-to-bug: 6405934
Diffstat (limited to 'media/java')
-rw-r--r--media/java/android/media/MediaPlayer.java58
1 files changed, 39 insertions, 19 deletions
diff --git a/media/java/android/media/MediaPlayer.java b/media/java/android/media/MediaPlayer.java
index 7540c6f..9f0fd48 100644
--- a/media/java/android/media/MediaPlayer.java
+++ b/media/java/android/media/MediaPlayer.java
@@ -743,9 +743,14 @@ public class MediaPlayer
}
Parcel request = Parcel.obtain();
Parcel reply = Parcel.obtain();
- request.writeInterfaceToken(IMEDIA_PLAYER);
- request.writeInt(INVOKE_ID_SET_VIDEO_SCALE_MODE);
- invoke(request, reply);
+ try {
+ request.writeInterfaceToken(IMEDIA_PLAYER);
+ request.writeInt(INVOKE_ID_SET_VIDEO_SCALE_MODE);
+ invoke(request, reply);
+ } finally {
+ request.recycle();
+ reply.recycle();
+ }
}
/**
@@ -1642,11 +1647,16 @@ public class MediaPlayer
public TrackInfo[] getTrackInfo() throws IllegalStateException {
Parcel request = Parcel.obtain();
Parcel reply = Parcel.obtain();
- request.writeInterfaceToken(IMEDIA_PLAYER);
- request.writeInt(INVOKE_ID_GET_TRACK_INFO);
- invoke(request, reply);
- TrackInfo trackInfo[] = reply.createTypedArray(TrackInfo.CREATOR);
- return trackInfo;
+ try {
+ request.writeInterfaceToken(IMEDIA_PLAYER);
+ request.writeInt(INVOKE_ID_GET_TRACK_INFO);
+ invoke(request, reply);
+ TrackInfo trackInfo[] = reply.createTypedArray(TrackInfo.CREATOR);
+ return trackInfo;
+ } finally {
+ request.recycle();
+ reply.recycle();
+ }
}
/* Do not change these values without updating their counterparts
@@ -1791,13 +1801,18 @@ public class MediaPlayer
Parcel request = Parcel.obtain();
Parcel reply = Parcel.obtain();
- request.writeInterfaceToken(IMEDIA_PLAYER);
- request.writeInt(INVOKE_ID_ADD_EXTERNAL_SOURCE_FD);
- request.writeFileDescriptor(fd);
- request.writeLong(offset);
- request.writeLong(length);
- request.writeString(mimeType);
- invoke(request, reply);
+ try {
+ request.writeInterfaceToken(IMEDIA_PLAYER);
+ request.writeInt(INVOKE_ID_ADD_EXTERNAL_SOURCE_FD);
+ request.writeFileDescriptor(fd);
+ request.writeLong(offset);
+ request.writeLong(length);
+ request.writeString(mimeType);
+ invoke(request, reply);
+ } finally {
+ request.recycle();
+ reply.recycle();
+ }
}
/**
@@ -1854,10 +1869,15 @@ public class MediaPlayer
throws IllegalStateException {
Parcel request = Parcel.obtain();
Parcel reply = Parcel.obtain();
- request.writeInterfaceToken(IMEDIA_PLAYER);
- request.writeInt(select? INVOKE_ID_SELECT_TRACK: INVOKE_ID_DESELECT_TRACK);
- request.writeInt(index);
- invoke(request, reply);
+ try {
+ request.writeInterfaceToken(IMEDIA_PLAYER);
+ request.writeInt(select? INVOKE_ID_SELECT_TRACK: INVOKE_ID_DESELECT_TRACK);
+ request.writeInt(index);
+ invoke(request, reply);
+ } finally {
+ request.recycle();
+ reply.recycle();
+ }
}