am 578fbe89: Merge "Set the metadata rating correctly in RCC" into lmp-dev

* commit '578fbe898f1652b3166bd4e20647572dec9dfb14':
  Set the metadata rating correctly in RCC
This commit is contained in:
RoboErik
2014-10-20 19:13:20 +00:00
committed by Android Git Automerger

View File

@@ -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)}).