Package org.robolectric.shadows
Class ShadowMediaSessionManager
- java.lang.Object
-
- org.robolectric.shadows.ShadowMediaSessionManager
-
@Implements(value=android.media.session.MediaSessionManager.class, minSdk=21) public class ShadowMediaSessionManager extends java.lang.ObjectShadow forMediaSessionManager.
-
-
Constructor Summary
Constructors Constructor Description ShadowMediaSessionManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddController(android.media.session.MediaController controller)Adds aMediaControllerthat will be returned when callinggetActiveSessions(ComponentName).protected voidaddOnActiveSessionsChangedListener(android.media.session.MediaSessionManager.OnActiveSessionsChangedListener listener, android.content.ComponentName ignoredNotificationListener)voidclearControllers()Clears all controllers such thatgetActiveSessions(ComponentName)will return the empty list.protected java.util.List<android.media.session.MediaController>getActiveSessions(android.content.ComponentName ignoredNotificationListener)protected voidremoveOnActiveSessionsChangedListener(android.media.session.MediaSessionManager.OnActiveSessionsChangedListener listener)
-
-
-
Method Detail
-
getActiveSessions
@Implementation protected java.util.List<android.media.session.MediaController> getActiveSessions(android.content.ComponentName ignoredNotificationListener)
-
addOnActiveSessionsChangedListener
@Implementation protected void addOnActiveSessionsChangedListener(android.media.session.MediaSessionManager.OnActiveSessionsChangedListener listener, android.content.ComponentName ignoredNotificationListener)
-
removeOnActiveSessionsChangedListener
@Implementation protected void removeOnActiveSessionsChangedListener(android.media.session.MediaSessionManager.OnActiveSessionsChangedListener listener)
-
addController
public void addController(android.media.session.MediaController controller)
Adds aMediaControllerthat will be returned when callinggetActiveSessions(ComponentName). This will trigger a callback on eachMediaSessionManager.OnActiveSessionsChangedListenercallback registered with this class.- Parameters:
controller- The controller to add.
-
clearControllers
public void clearControllers()
Clears all controllers such thatgetActiveSessions(ComponentName)will return the empty list.
-
-