public interface

MediaNotification.Provider

 androidx.media3.session.MediaNotification.Provider

Overview

Provides media notifications to be posted as notifications that reflect the state of a MediaController and to send media commands to a MediaSession.

The provider is required to create a notification channel, which is required to show notification for SDK_INT >= 26.

Summary

Methods
public MediaNotificationcreateNotification(MediaController mediaController, MediaNotification.ActionFactory actionFactory, MediaNotification.Provider.Callback onNotificationChangedCallback)

Creates a new MediaNotification.

public voidhandleCustomAction(MediaController mediaController, java.lang.String action, Bundle extras)

Handles a notification's custom action.

Methods

public MediaNotification createNotification(MediaController mediaController, MediaNotification.ActionFactory actionFactory, MediaNotification.Provider.Callback onNotificationChangedCallback)

Creates a new MediaNotification.

Parameters:

mediaController: The controller of the session.
actionFactory: The MediaNotification.ActionFactory for creating notification .
onNotificationChangedCallback: A callback that the provider needs to notify when the notification has changed and needs to be posted again, for example after a bitmap has been loaded asynchronously.

public void handleCustomAction(MediaController mediaController, java.lang.String action, Bundle extras)

Handles a notification's custom action.

Parameters:

mediaController: The controller of the session.
action: The custom action.
extras: Extras set in the custom action, otherwise .

See also: MediaNotification.ActionFactory.createCustomAction(IconCompat, CharSequence, String, Bundle)