Class DownloadNotificationHelper


  • @Deprecated
    public final class DownloadNotificationHelper
    extends Object
    Deprecated.
    com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
    Helper for creating download notifications.
    • Constructor Detail

      • DownloadNotificationHelper

        public DownloadNotificationHelper​(Context context,
                                          String channelId)
        Deprecated.
        Parameters:
        context - A context.
        channelId - The id of the notification channel to use.
    • Method Detail

      • buildProgressNotification

        public Notification buildProgressNotification​(Context context,
                                                      @DrawableRes
                                                      int smallIcon,
                                                      @Nullable
                                                      PendingIntent contentIntent,
                                                      @Nullable
                                                      String message,
                                                      List<Download> downloads,
                                                      @RequirementFlags
                                                      @com.google.android.exoplayer2.scheduler.Requirements.RequirementFlags int notMetRequirements)
        Deprecated.
        Returns a progress notification for the given downloads.
        Parameters:
        context - A context.
        smallIcon - A small icon for the notification.
        contentIntent - An optional content intent to send when the notification is clicked.
        message - An optional message to display on the notification.
        downloads - The downloads.
        notMetRequirements - Any requirements for downloads that are not currently met.
        Returns:
        The notification.
      • buildDownloadCompletedNotification

        public Notification buildDownloadCompletedNotification​(Context context,
                                                               @DrawableRes
                                                               int smallIcon,
                                                               @Nullable
                                                               PendingIntent contentIntent,
                                                               @Nullable
                                                               String message)
        Deprecated.
        Returns a notification for a completed download.
        Parameters:
        context - A context.
        smallIcon - A small icon for the notifications.
        contentIntent - An optional content intent to send when the notification is clicked.
        message - An optional message to display on the notification.
        Returns:
        The notification.
      • buildDownloadFailedNotification

        public Notification buildDownloadFailedNotification​(Context context,
                                                            @DrawableRes
                                                            int smallIcon,
                                                            @Nullable
                                                            PendingIntent contentIntent,
                                                            @Nullable
                                                            String message)
        Deprecated.
        Returns a notification for a failed download.
        Parameters:
        context - A context.
        smallIcon - A small icon for the notifications.
        contentIntent - An optional content intent to send when the notification is clicked.
        message - An optional message to display on the notification.
        Returns:
        The notification.