From 0d2e4377efc87a7162629ff462722a5a3e6c4ec2 Mon Sep 17 00:00:00 2001 From: Dong Van Hung Date: Mon, 14 Nov 2022 09:34:27 +0900 Subject: [PATCH] Added a method in DownloadService to support for Clear all DownloadManagerHelper to restart the new service. --- .../android/exoplayer2/offline/DownloadService.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadService.java b/library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadService.java index 8170c497433..5b26381ee79 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadService.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadService.java @@ -869,6 +869,14 @@ private static void startService(Context context, Intent intent, boolean foregro } } + /** + * Clear all DownloadManagerHelper to restart the new service. + */ + public static void clearDownloadManagerHelpers() { + downloadManagerHelpers.clear(); + } + + private final class ForegroundNotificationUpdater { private final int notificationId;