@Implements(value=android.support.v4.media.MediaBrowserCompat.class) public class ShadowMediaBrowserCompat extends java.lang.Object
This will mimic the connection to a MediaBrowserServiceCompat
by creating and maintaining its own account of MediaBrowserCompat.MediaItem
s.
Constructor and Description |
---|
ShadowMediaBrowserCompat() |
Modifier and Type | Method and Description |
---|---|
protected void |
__constructor__(android.content.Context context,
android.content.ComponentName serviceComponent,
android.support.v4.media.MediaBrowserCompat.ConnectionCallback callback,
android.os.Bundle rootHints) |
protected void |
connect() |
android.support.v4.media.MediaBrowserCompat.MediaItem |
createMediaItem(java.lang.String parentId,
java.lang.String mediaId,
java.lang.String title,
int flag)
Creates a MediaItem and returns it.
|
protected void |
disconnect() |
java.util.Map<android.support.v4.media.MediaBrowserCompat.MediaItem,java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>> |
getCopyOfMediaItemChildren() |
protected void |
getItem(java.lang.String mediaId,
android.support.v4.media.MediaBrowserCompat.ItemCallback cb) |
protected java.lang.String |
getRoot() |
protected boolean |
isConnected() |
protected void |
search(java.lang.String query,
android.os.Bundle extras,
android.support.v4.media.MediaBrowserCompat.SearchCallback callback)
This differs from real Android search logic.
|
void |
setRootId(java.lang.String mediaId)
Sets the root id.
|
protected void |
subscribe(java.lang.String parentId,
android.os.Bundle options,
android.support.v4.media.MediaBrowserCompat.SubscriptionCallback callback) |
protected void |
subscribe(java.lang.String parentId,
android.support.v4.media.MediaBrowserCompat.SubscriptionCallback callback) |
@Implementation protected void __constructor__(android.content.Context context, android.content.ComponentName serviceComponent, android.support.v4.media.MediaBrowserCompat.ConnectionCallback callback, android.os.Bundle rootHints)
@Implementation protected void connect()
@Implementation protected void disconnect()
@Implementation protected boolean isConnected()
@Implementation protected java.lang.String getRoot()
@Implementation protected void getItem(@NonNull java.lang.String mediaId, @NonNull android.support.v4.media.MediaBrowserCompat.ItemCallback cb)
@Implementation protected void subscribe(@NonNull java.lang.String parentId, @NonNull android.support.v4.media.MediaBrowserCompat.SubscriptionCallback callback)
@Implementation protected void subscribe(@NonNull java.lang.String parentId, @Nullable android.os.Bundle options, @NonNull android.support.v4.media.MediaBrowserCompat.SubscriptionCallback callback)
@Implementation protected void search(@NonNull java.lang.String query, android.os.Bundle extras, @NonNull android.support.v4.media.MediaBrowserCompat.SearchCallback callback)
This differs from real Android search logic. Search results will contain all MediaBrowserCompat.MediaItem
’s with a title that is a substring of.
public void setRootId(java.lang.String mediaId)
Sets the root id. Can be called more than once.
mediaId
- the id of the root MediaItem. This MediaItem should already have been created.public android.support.v4.media.MediaBrowserCompat.MediaItem createMediaItem(java.lang.String parentId, java.lang.String mediaId, java.lang.String title, int flag)
Creates a MediaItem and returns it.
parentId
- the id of the parent MediaItem. If the MediaItem to be created will be the root, parentId should be null.mediaId
- the id of the MediaItem to be created.title
- the title of the MediaItem to be created.flag
- says if the MediaItem to be created is browsable and/or playable.public java.util.Map<android.support.v4.media.MediaBrowserCompat.MediaItem,java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>> getCopyOfMediaItemChildren()
Map
that maps MediaBrowserCompat.MediaItem
s to their children.