Package org.robolectric.shadows
Class ShadowMediaSessionManager
java.lang.Object
org.robolectric.shadows.ShadowMediaSessionManager
@Implements(android.media.session.MediaSessionManager.class)
public class ShadowMediaSessionManager
extends Object
Shadow for
MediaSessionManager
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
__constructor__
(Context context) void
addController
(MediaController controller) Adds aMediaController
that will be returned when callinggetActiveSessions(ComponentName)
.protected void
addOnActiveSessionsChangedListener
(MediaSessionManager.OnActiveSessionsChangedListener listener, ComponentName ignoredNotificationListener) protected void
addOnActiveSessionsChangedListener
(MediaSessionManager.OnActiveSessionsChangedListener listener, ComponentName ignoredNotificationListener, Handler ignoreHandler) void
Clears all controllers such thatgetActiveSessions(ComponentName)
will return the empty list.protected List<MediaController>
getActiveSessions
(ComponentName ignoredNotificationListener) protected void
static void
reset()
-
Constructor Details
-
ShadowMediaSessionManager
public ShadowMediaSessionManager()
-
-
Method Details
-
__constructor__
-
getActiveSessions
@Implementation protected List<MediaController> getActiveSessions(ComponentName ignoredNotificationListener) -
addOnActiveSessionsChangedListener
@Implementation protected void addOnActiveSessionsChangedListener(MediaSessionManager.OnActiveSessionsChangedListener listener, ComponentName ignoredNotificationListener) -
addOnActiveSessionsChangedListener
@Implementation protected void addOnActiveSessionsChangedListener(MediaSessionManager.OnActiveSessionsChangedListener listener, ComponentName ignoredNotificationListener, Handler ignoreHandler) -
removeOnActiveSessionsChangedListener
@Implementation protected void removeOnActiveSessionsChangedListener(MediaSessionManager.OnActiveSessionsChangedListener listener) -
addController
Adds aMediaController
that will be returned when callinggetActiveSessions(ComponentName)
. This will trigger a callback on eachMediaSessionManager.OnActiveSessionsChangedListener
callback 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. This will trigger a callback on eachMediaSessionManager.OnActiveSessionsChangedListener
callback registered with this class. -
reset
-