MediaSessionManager
public
final
class
MediaSessionManager
extends Object
java.lang.Object | |
↳ | androidx.media.MediaSessionManager |
Provides support for interacting with media sessions
that
applications have published to express their ongoing media playback state.
See also:
Summary
Nested classes | |
---|---|
class |
MediaSessionManager.RemoteUserInfo
Information of a remote user of |
Public methods | |
---|---|
static
MediaSessionManager
|
getSessionManager(Context context)
Gets an instance of the media session manager associated with the context. |
boolean
|
isTrustedForMediaControl(MediaSessionManager.RemoteUserInfo userInfo)
Checks whether the remote user is a trusted app. |
Inherited methods | |
---|---|
Public methods
getSessionManager
public static MediaSessionManager getSessionManager (Context context)
Gets an instance of the media session manager associated with the context.
Parameters | |
---|---|
context |
Context |
Returns | |
---|---|
MediaSessionManager |
The MediaSessionManager instance for this context. |
isTrustedForMediaControl
public boolean isTrustedForMediaControl (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 | |
---|---|
userInfo |
MediaSessionManager.RemoteUserInfo : The remote user info from either
MediaSessionCompat.getCurrentControllerInfo() and
MediaBrowserServiceCompat.getCurrentBrowserInfo() . |
Returns | |
---|---|
boolean |
true if the remote user is trusted and its package name matches with the UID.
false otherwise.
|
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-02-24 UTC.