Merge "Proactively unparcel bitmaps in MediaMetadata" into tm-dev am: 1574fbe57c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18918926 Change-Id: I6dce5d62fd0acbf23176abc13a03ce3d9660a4f9 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -429,6 +429,15 @@ public final class MediaMetadata implements Parcelable {
|
|||||||
private MediaMetadata(Parcel in) {
|
private MediaMetadata(Parcel in) {
|
||||||
mBundle = in.readBundle();
|
mBundle = in.readBundle();
|
||||||
mBitmapDimensionLimit = Math.max(in.readInt(), 1);
|
mBitmapDimensionLimit = Math.max(in.readInt(), 1);
|
||||||
|
|
||||||
|
// Proactively read bitmaps from known bitmap keys, to ensure that they're unparceled and
|
||||||
|
// added to mBundle's internal map. This ensures that the GC accounts for the underlying
|
||||||
|
// allocations, which it does not do if the bitmaps remain parceled (see b/215820910).
|
||||||
|
// TODO(b/223225532): Remove this workaround once the underlying allocations are properly
|
||||||
|
// tracked in NativeAllocationsRegistry.
|
||||||
|
getBitmap(METADATA_KEY_ART);
|
||||||
|
getBitmap(METADATA_KEY_ALBUM_ART);
|
||||||
|
getBitmap(METADATA_KEY_DISPLAY_ICON);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user