From 30ad70bbd756e6117e477031a57dc664e50488c1 Mon Sep 17 00:00:00 2001 From: olly Date: Tue, 9 Feb 2021 12:44:33 +0000 Subject: [PATCH] Remove deprecated DownloadNotificationUtil PiperOrigin-RevId: 356474350 --- RELEASENOTES.md | 2 + .../ui/DownloadNotificationUtil.java | 97 ------------------- 2 files changed, 2 insertions(+), 97 deletions(-) delete mode 100644 library/ui/src/main/java/com/google/android/exoplayer2/ui/DownloadNotificationUtil.java diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 47cafd52a4..03f0840c66 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -16,6 +16,8 @@ * Remove deprecated symbols: * Remove `extension-jobdispatcher` module. Use the `extension-workmanager` module instead. + * Remove `DownloadNotificationUtil`. Use `DownloadNotificationHelper` + instead. ### 2.13.0 (2021-02-04) diff --git a/library/ui/src/main/java/com/google/android/exoplayer2/ui/DownloadNotificationUtil.java b/library/ui/src/main/java/com/google/android/exoplayer2/ui/DownloadNotificationUtil.java deleted file mode 100644 index 8c03dbea42..0000000000 --- a/library/ui/src/main/java/com/google/android/exoplayer2/ui/DownloadNotificationUtil.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (C) 2018 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.google.android.exoplayer2.ui; - -import android.app.Notification; -import android.app.PendingIntent; -import android.content.Context; -import androidx.annotation.DrawableRes; -import androidx.annotation.Nullable; -import com.google.android.exoplayer2.offline.Download; -import com.google.android.exoplayer2.util.Util; -import java.util.List; - -/** - * @deprecated Using this class can cause notifications to flicker on devices with {@link - * Util#SDK_INT} < 21. Use {@link DownloadNotificationHelper} instead. - */ -@Deprecated -public final class DownloadNotificationUtil { - - private DownloadNotificationUtil() {} - - /** - * Returns a progress notification for the given downloads. - * - * @param context A context for accessing resources. - * @param smallIcon A small icon for the notification. - * @param channelId The id of the notification channel to use. - * @param contentIntent An optional content intent to send when the notification is clicked. - * @param message An optional message to display on the notification. - * @param downloads The downloads. - * @return The notification. - */ - public static Notification buildProgressNotification( - Context context, - @DrawableRes int smallIcon, - String channelId, - @Nullable PendingIntent contentIntent, - @Nullable String message, - List downloads) { - return new DownloadNotificationHelper(context, channelId) - .buildProgressNotification(context, smallIcon, contentIntent, message, downloads); - } - - /** - * Returns a notification for a completed download. - * - * @param context A context for accessing resources. - * @param smallIcon A small icon for the notifications. - * @param channelId The id of the notification channel to use. - * @param contentIntent An optional content intent to send when the notification is clicked. - * @param message An optional message to display on the notification. - * @return The notification. - */ - public static Notification buildDownloadCompletedNotification( - Context context, - @DrawableRes int smallIcon, - String channelId, - @Nullable PendingIntent contentIntent, - @Nullable String message) { - return new DownloadNotificationHelper(context, channelId) - .buildDownloadCompletedNotification(context, smallIcon, contentIntent, message); - } - - /** - * Returns a notification for a failed download. - * - * @param context A context for accessing resources. - * @param smallIcon A small icon for the notifications. - * @param channelId The id of the notification channel to use. - * @param contentIntent An optional content intent to send when the notification is clicked. - * @param message An optional message to display on the notification. - * @return The notification. - */ - public static Notification buildDownloadFailedNotification( - Context context, - @DrawableRes int smallIcon, - String channelId, - @Nullable PendingIntent contentIntent, - @Nullable String message) { - return new DownloadNotificationHelper(context, channelId) - .buildDownloadFailedNotification(context, smallIcon, contentIntent, message); - } -}