Skip to content

Commit 34d0d30

Browse files
committed
Fix bug 5327199 Recycle bitmaps in RemoteControlClient
When applying the new bitmap from the editor to the client, recycle the old bitmap, and set the reference to the editor bitmap to null. Change-Id: I7d79e4b8410e5035fa51b20be4b1ada391c84c28
1 parent ebdcae7 commit 34d0d30

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

media/java/android/media/RemoteControlClient.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,11 @@ public synchronized void apply() {
482482
synchronized(mCacheLock) {
483483
// assign the edited data
484484
mMetadata = new Bundle(mEditorMetadata);
485+
if ((mArtwork != null) && (!mArtwork.equals(mEditorArtwork))) {
486+
mArtwork.recycle();
487+
}
485488
mArtwork = mEditorArtwork;
489+
mEditorArtwork = null;
486490
if (mMetadataChanged & mArtworkChanged) {
487491
// send to remote control display if conditions are met
488492
sendMetadataWithArtwork_syncCacheLock();

0 commit comments

Comments
 (0)