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)
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)
-
-
-
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 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.
-
-