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 Constructor Description ShadowMediaSessionManager()
-
Method Summary
Modifier and Type Method Description protected 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
clearControllers()
Clears all controllers such thatgetActiveSessions(ComponentName)
will return the empty list.protected List<MediaController>
getActiveSessions(ComponentName ignoredNotificationListener)
protected void
removeOnActiveSessionsChangedListener(MediaSessionManager.OnActiveSessionsChangedListener listener)
-
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.
-