Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1574fbe5 authored by Oliver Woodman's avatar Oliver Woodman Committed by Android (Google) Code Review
Browse files

Merge "Proactively unparcel bitmaps in MediaMetadata" into tm-dev

parents 95ac43c8 a110072a
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -429,6 +429,15 @@ public final class MediaMetadata implements Parcelable {
    private MediaMetadata(Parcel in) {
        mBundle = in.readBundle();
        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);
    }

    /**