@Implements(value=android.media.session.MediaSessionManager.class, minSdk=21) public class ShadowMediaSessionManager extends Object
MediaSessionManager
.Constructor | Description |
---|---|
ShadowMediaSessionManager() |
Modifier and Type | Method | Description |
---|---|---|
void |
addController(MediaController controller) |
Adds a
MediaController that will be returned when calling getActiveSessions(ComponentName) . |
protected void |
addOnActiveSessionsChangedListener(MediaSessionManager.OnActiveSessionsChangedListener listener,
ComponentName ignoredNotificationListener) |
|
void |
clearControllers() |
Clears all controllers such that
getActiveSessions(ComponentName) will return the
empty list. |
protected List<MediaController> |
getActiveSessions(ComponentName ignoredNotificationListener) |
|
protected void |
removeOnActiveSessionsChangedListener(MediaSessionManager.OnActiveSessionsChangedListener listener) |
@Implementation protected List<MediaController> getActiveSessions(ComponentName ignoredNotificationListener)
@Implementation protected void addOnActiveSessionsChangedListener(MediaSessionManager.OnActiveSessionsChangedListener listener, ComponentName ignoredNotificationListener)
@Implementation protected void removeOnActiveSessionsChangedListener(MediaSessionManager.OnActiveSessionsChangedListener listener)
public void addController(MediaController controller)
MediaController
that will be returned when calling getActiveSessions(ComponentName)
. This will trigger a callback on each MediaSessionManager.OnActiveSessionsChangedListener
callback registered with this class.controller
- The controller to add.public void clearControllers()
getActiveSessions(ComponentName)
will return the
empty list.