package androidx.media3.session;

import android.app.Notification;
import android.app.PendingIntent;
import android.os.Bundle;
import androidx.annotation.IntRange;
import androidx.core.app.NotificationCompat;
import androidx.core.graphics.drawable.IconCompat;
import androidx.media3.common.util.Assertions;
import androidx.media3.common.util.UnstableApi;
import com.google.common.collect.ImmutableList;

/* JADX INFO: loaded from: classes.dex */
public final class MediaNotification {

    @UnstableApi
    public static final String NOTIFICATION_DISMISSED_EVENT_KEY = "androidx.media3.session.NOTIFICATION_DISMISSED_EVENT_KEY";
    public final Notification notification;

    @IntRange(from = 1)
    public final int notificationId;

    @UnstableApi
    public interface ActionFactory {
        NotificationCompat.Action createCustomAction(MediaSession mediaSession, IconCompat iconCompat, CharSequence charSequence, String str, Bundle bundle);

        NotificationCompat.Action createCustomActionFromCustomCommandButton(MediaSession mediaSession, CommandButton commandButton);

        NotificationCompat.Action createMediaAction(MediaSession mediaSession, IconCompat iconCompat, CharSequence charSequence, int i2);

        PendingIntent createMediaActionPendingIntent(MediaSession mediaSession, long j2);

        default PendingIntent createNotificationDismissalIntent(MediaSession mediaSession) {
            return createMediaActionPendingIntent(mediaSession, 3L);
        }
    }

    @UnstableApi
    public interface Provider {

        public interface Callback {
            void onNotificationChanged(MediaNotification mediaNotification);
        }

        MediaNotification createNotification(MediaSession mediaSession, ImmutableList<CommandButton> immutableList, ActionFactory actionFactory, Callback callback);

        boolean handleCustomCommand(MediaSession mediaSession, String str, Bundle bundle);
    }

    public MediaNotification(@IntRange(from = 1) int i2, Notification notification) {
        this.notificationId = i2;
        this.notification = (Notification) Assertions.checkNotNull(notification);
    }
}
