Dela via


MediaSessionManager.MediaKeyEventSessionPackageName Property

Definition

Gets the package name of the media key event session.

public string MediaKeyEventSessionPackageName { [Android.Runtime.Register("getMediaKeyEventSessionPackageName", "()Ljava/lang/String;", "", ApiSince=33)] get; }
[<get: Android.Runtime.Register("getMediaKeyEventSessionPackageName", "()Ljava/lang/String;", "", ApiSince=33)>]
member this.MediaKeyEventSessionPackageName : string

Property Value

The package name of the media key event session or the last session's media button receiver if the media key event session is null. Returns an empty string if neither of them exists.

Attributes

Remarks

Gets the package name of the media key event session.

This requires the android.Manifest.permission#MEDIA_CONTENT_CONTROL permission be held by the calling app, or the app has an enabled notification listener using the NotificationListenerService APIs. If none of them applies, it will throw a SecurityException.

Java documentation for android.media.session.MediaSessionManager.getMediaKeyEventSessionPackageName().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to