MediaSessionManager
class MediaSessionManager
Provides support for interacting with media sessions that applications have published to express their ongoing media playback state.
| See also | |
|---|---|
MediaSessionCompat |
|
MediaControllerCompat |
Summary
Nested types |
|---|
|
Information of a remote user of |
Public functions |
|
|---|---|
java-static MediaSessionManager |
getSessionManager(context: Context)Gets an instance of the media session manager associated with the context. |
Boolean |
Checks whether the remote user is a trusted app. |
Public functions
getSessionManager
java-static fun getSessionManager(context: Context): MediaSessionManager
Gets an instance of the media session manager associated with the context.
| Returns | |
|---|---|
MediaSessionManager |
The MediaSessionManager instance for this context. |
isTrustedForMediaControl
fun isTrustedForMediaControl(userInfo: MediaSessionManager.RemoteUserInfo): Boolean
Checks whether the remote user is a trusted app.
An app is trusted if the app holds the android.Manifest.permission.MEDIA_CONTENT_CONTROL permission or has an enabled notification listener.
| Parameters | |
|---|---|
userInfo: MediaSessionManager.RemoteUserInfo |
The remote user info from either |
| Returns | |
|---|---|
Boolean |
|