MediaSessionManager
public final 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 |
|---|
public final class MediaSessionManager.RemoteUserInfoInformation of a remote user of |
Public methods |
|
|---|---|
static @NonNull MediaSessionManager |
getSessionManager(@NonNull 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 methods
getSessionManager
public static @NonNull MediaSessionManager getSessionManager(@NonNull Context context)
Gets an instance of the media session manager associated with the context.
| Returns | |
|---|---|
@NonNull MediaSessionManager |
The MediaSessionManager instance for this context. |
isTrustedForMediaControl
public boolean isTrustedForMediaControl(
@NonNull MediaSessionManager.RemoteUserInfo userInfo
)
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 | |
|---|---|
@NonNull MediaSessionManager.RemoteUserInfo userInfo |
The remote user info from either |
| Returns | |
|---|---|
boolean |
|