diff --git a/RELEASENOTES.md b/RELEASENOTES.md index d30bce256c..bfe440a713 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -85,6 +85,11 @@ `HttpDataSource.Factory.setDefaultRequestProperties` instead. * Remove `GvrAudioProcessor` and the GVR extension, which has been deprecated since 2.11.0. + * Remove `DownloadService.onDownloadChanged` and + `DownloadService.onDownloadRemoved`. Instead, use + `DownloadManager.addListener` to register a listener directly to + the `DownloadManager` returned through + `DownloadService.getDownloadManager`. * Cast extension: * Implement `CastPlayer.setPlaybackParameters(PlaybackParameters)` to support setting the playback speed 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 25ca27bdce..200e2decda 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 @@ -763,27 +763,6 @@ public abstract class DownloadService extends Service { } } - /** - * @deprecated Some state change events may not be delivered to this method. Instead, use {@link - * DownloadManager#addListener(DownloadManager.Listener)} to register a listener directly to - * the {@link DownloadManager} that you return through {@link #getDownloadManager()}. - */ - @Deprecated - protected void onDownloadChanged(Download download) { - // Do nothing. - } - - /** - * @deprecated Some download removal events may not be delivered to this method. Instead, use - * {@link DownloadManager#addListener(DownloadManager.Listener)} to register a listener - * directly to the {@link DownloadManager} that you return through {@link - * #getDownloadManager()}. - */ - @Deprecated - protected void onDownloadRemoved(Download download) { - // Do nothing. - } - /** * Called after the service is created, once the downloads are known. * @@ -805,9 +784,7 @@ public abstract class DownloadService extends Service { * * @param download The state of the download. */ - @SuppressWarnings("deprecation") private void notifyDownloadChanged(Download download) { - onDownloadChanged(download); if (foregroundNotificationUpdater != null) { if (needsStartedService(download.state)) { foregroundNotificationUpdater.startPeriodicUpdates(); @@ -817,14 +794,8 @@ public abstract class DownloadService extends Service { } } - /** - * Called when a download is removed. - * - * @param download The last state of the download before it was removed. - */ - @SuppressWarnings("deprecation") - private void notifyDownloadRemoved(Download download) { - onDownloadRemoved(download); + /** Called when a download is removed. */ + private void notifyDownloadRemoved() { if (foregroundNotificationUpdater != null) { foregroundNotificationUpdater.invalidate(); } @@ -996,7 +967,7 @@ public abstract class DownloadService extends Service { @Override public void onDownloadRemoved(DownloadManager downloadManager, Download download) { if (downloadService != null) { - downloadService.notifyDownloadRemoved(download); + downloadService.notifyDownloadRemoved(); } }