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

Commit 6d298811 authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

Fix artwork not received in RemoteController metadata update.

Regardless of the artwork value, always update the metadata.

When updating the metadata, make sure the artwork is stored
 in the artwork field, not in the bundle of the MetadataEditor.

Bug 10862527

Change-Id: Iec83fd9bb358a91c852099b30bb6d307a52a034c
parent 01b5743a
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -418,6 +418,12 @@ public final class RemoteController
            mApplied = false;
        }

        private void cleanupBitmapFromBundle(int key) {
            if (METADATA_KEYS_TYPE.get(key, METADATA_TYPE_INVALID) == METADATA_TYPE_BITMAP) {
                mEditorMetadata.remove(String.valueOf(key));
            }
        }

        /**
         * Applies all of the metadata changes that have been set since the MediaMetadataEditor
         * instance was created with {@link RemoteController#editMetadata()}
@@ -529,9 +535,6 @@ public final class RemoteController

        public void setArtwork(int genId, Bitmap artwork) {
            if (DEBUG) { Log.v(TAG, "setArtwork("+genId+")"); }
            if (artwork == null) {
                return;
            }
            synchronized(mGenLock) {
                if (mClientGenerationIdCurrent != genId) {
                    return;
@@ -700,6 +703,10 @@ public final class RemoteController
                    // existing metadata, merge existing and new
                    mMetadataEditor.mEditorMetadata.putAll(metadata);
                }
                mMetadataEditor.putBitmap(MediaMetadataEditor.BITMAP_KEY_ARTWORK,
                        (Bitmap)metadata.getParcelable(
                                String.valueOf(MediaMetadataEditor.BITMAP_KEY_ARTWORK)));
                mMetadataEditor.cleanupBitmapFromBundle(MediaMetadataEditor.BITMAP_KEY_ARTWORK);
            } else {
                mMetadataEditor = new MetadataEditor(metadata, editableKeys);
            }