summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorRoboErik <epastern@google.com>2014-10-20 09:48:13 -0700
committerRoboErik <epastern@google.com>2014-10-20 09:48:13 -0700
commit38696ba77d7f614cb50672aaca99f7ba59b56126 (patch)
treed130286839616ec8e4eabb89f529e77a8c5be0ef /media
parent040d89bb0a4563d93073b7a27b3f201ce11dcf58 (diff)
downloadframeworks_base-38696ba77d7f614cb50672aaca99f7ba59b56126.zip
frameworks_base-38696ba77d7f614cb50672aaca99f7ba59b56126.tar.gz
frameworks_base-38696ba77d7f614cb50672aaca99f7ba59b56126.tar.bz2
Set the metadata rating correctly in RCC
We weren't setting the ratings in the new MediaMetadata from RCC. This adds some code to set them correctly. bug:18051829 Change-Id: I358eeb2b25b3fb9bd9a5d207eb3314bb2cdff25e
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/RemoteControlClient.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/media/java/android/media/RemoteControlClient.java b/media/java/android/media/RemoteControlClient.java
index 0336f11..1b6536f 100644
--- a/media/java/android/media/RemoteControlClient.java
+++ b/media/java/android/media/RemoteControlClient.java
@@ -535,6 +535,21 @@ import java.lang.IllegalArgumentException;
return this;
}
+ @Override
+ public synchronized MetadataEditor putObject(int key, Object object)
+ throws IllegalArgumentException {
+ super.putObject(key, object);
+ if (mMetadataBuilder != null &&
+ (key == MediaMetadataEditor.RATING_KEY_BY_USER ||
+ key == MediaMetadataEditor.RATING_KEY_BY_OTHERS)) {
+ String metadataKey = MediaMetadata.getKeyFromMetadataEditorKey(key);
+ if (metadataKey != null) {
+ mMetadataBuilder.putRating(metadataKey, (Rating) object);
+ }
+ }
+ return this;
+ }
+
/**
* Clears all the metadata that has been set since the MetadataEditor instance was created
* (with {@link RemoteControlClient#editMetadata(boolean)}).