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 forMediaSessionManager.
-
-
Constructor Summary
Constructors Constructor Description ShadowMediaSessionManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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)voidclearControllers()Clears all controllers such thatgetActiveSessions(ComponentName)will return the empty list.protected List<MediaController>getActiveSessions(ComponentName ignoredNotificationListener)protected voidremoveOnActiveSessionsChangedListener(MediaSessionManager.OnActiveSessionsChangedListener listener)
-
-
-
Method Detail
-
__constructor__
@Implementation(minSdk=31) protected void __constructor__(Context context)
-
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
public void addController(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.
-
-