RemoteControlClient.MetadataEditor  |  API reference  |  Android Developers


public class RemoteControlClient.MetadataEditor
extends MediaMetadataEditor



This class was deprecated in API level 21.
Use MediaMetadata and MediaSession instead.

Class used to modify metadata in a RemoteControlClient object. Use RemoteControlClient.editMetadata(boolean) to create an instance of an editor, on which you set the metadata for the RemoteControlClient instance. Once all the information has been set, use apply() to make it the new metadata that should be displayed for the associated client. Once the metadata has been "applied", you cannot reuse this instance of the MetadataEditor.

Summary

Constants

int BITMAP_KEY_ARTWORK

The metadata key for the content artwork / album art.

Inherited constants

From class android.media.MediaMetadataEditor

int BITMAP_KEY_ARTWORK

The metadata key for the content artwork / album art.

int RATING_KEY_BY_OTHERS

The metadata key for the content's average rating, not the user's rating.

int RATING_KEY_BY_USER

The metadata key for the content's user rating.

Public methods

void apply()

Associates all the metadata that has been set since the MetadataEditor instance was created with RemoteControlClient.editMetadata(boolean), or since clear() was called, with the RemoteControlClient.

void clear()

Clears all the metadata that has been set since the MetadataEditor instance was created (with RemoteControlClient.editMetadata(boolean)).

Object clone()

Creates and returns a copy of this object.

RemoteControlClient.MetadataEditor putBitmap(int key, Bitmap bitmap)

Sets the album / artwork picture to be displayed on the remote control.

RemoteControlClient.MetadataEditor putLong(int key, long value)

Adds numerical information to be displayed.

RemoteControlClient.MetadataEditor putObject(int key, Object object)

Adds information stored as an instance.

RemoteControlClient.MetadataEditor putString(int key, String value)

Adds textual information to be displayed.

Inherited methods

From class android.media.MediaMetadataEditor

void addEditableKey(int key)

Flags the given key as being editable.

abstract void apply()

Applies all of the metadata changes that have been set since the MediaMetadataEditor instance was created or since clear() was called.

void clear()

Clears all the pending metadata changes set since the MediaMetadataEditor instance was created or since this method was last called.

Bitmap getBitmap(int key, Bitmap defaultValue)

Returns the Bitmap value for the key.

int[] getEditableKeys()

Retrieves the keys flagged as editable.

long getLong(int key, long defaultValue)

Returns the long value for the key.

Object getObject(int key, Object defaultValue)

Returns an object representation of the value for the key

String getString(int key, String defaultValue)

Returns the String value for the key.

MediaMetadataEditor putBitmap(int key, Bitmap bitmap)

Adds image.

MediaMetadataEditor putLong(int key, long value)

Adds numerical information.

MediaMetadataEditor putObject(int key, Object value)

Adds information stored as an instance.

MediaMetadataEditor putString(int key, String value)

Adds textual information.

void removeEditableKeys()

Causes all metadata fields to be read-only.

From class java.lang.Object

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Constants

BITMAP_KEY_ARTWORK

public static final int BITMAP_KEY_ARTWORK

The metadata key for the content artwork / album art.

Constant Value: 100 (0x00000064)

Public methods

apply

public void apply ()

Associates all the metadata that has been set since the MetadataEditor instance was created with RemoteControlClient.editMetadata(boolean), or since clear() was called, with the RemoteControlClient. Once "applied", this MetadataEditor cannot be reused to edit the RemoteControlClient's metadata.

clone

public Object clone ()

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

 x.clone() != x

will be true, and that the expression:

 x.clone().getClass() == x.getClass()

will be true, but these are not absolute requirements. While it is typically the case that:

 x.clone().equals(x)

will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns
Object a clone of this instance.
Throws
CloneNotSupportedException

putString

public RemoteControlClient.MetadataEditor putString (int key, 
                String value)

Adds textual information to be displayed. Note that none of the information added after apply() has been called, will be displayed.

Parameters
key int: The identifier of a the metadata field to set. Valid values are MediaMetadataRetriever.METADATA_KEY_ALBUM, MediaMetadataRetriever.METADATA_KEY_ALBUMARTIST, MediaMetadataRetriever.METADATA_KEY_TITLE, MediaMetadataRetriever.METADATA_KEY_ARTIST, MediaMetadataRetriever.METADATA_KEY_AUTHOR, MediaMetadataRetriever.METADATA_KEY_COMPILATION, MediaMetadataRetriever.METADATA_KEY_COMPOSER, MediaMetadataRetriever.METADATA_KEY_DATE, MediaMetadataRetriever.METADATA_KEY_GENRE, MediaMetadataRetriever.METADATA_KEY_TITLE, MediaMetadataRetriever.METADATA_KEY_WRITER.
value String: The text for the given key, or null to signify there is no valid information for the field.
Returns
RemoteControlClient.MetadataEditor Returns a reference to the same MetadataEditor object, so you can chain put calls together.
Throws
IllegalArgumentException