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 Object
Shadow for
MediaSessionManager.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void__constructor__(Context context) voidaddController(MediaController controller) Adds aMediaControllerthat will be returned when callinggetActiveSessions(ComponentName).protected voidaddOnActiveSessionsChangedListener(MediaSessionManager.OnActiveSessionsChangedListener listener, ComponentName ignoredNotificationListener) protected voidaddOnActiveSessionsChangedListener(MediaSessionManager.OnActiveSessionsChangedListener listener, ComponentName ignoredNotificationListener, Handler ignoreHandler) voidClears all controllers such thatgetActiveSessions(ComponentName)will return the empty list.protected List<MediaController>getActiveSessions(ComponentName ignoredNotificationListener) protected void
-
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 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.
-