DownloadService: Remove deprecated protected methods

PiperOrigin-RevId: 397138908
This commit is contained in:
olly 2021-09-16 20:18:41 +01:00 committed by bachinger
parent 4455554e9e
commit f6d8cfeb1f
2 changed files with 8 additions and 32 deletions

View File

@ -85,6 +85,11 @@
`HttpDataSource.Factory.setDefaultRequestProperties` instead. `HttpDataSource.Factory.setDefaultRequestProperties` instead.
* Remove `GvrAudioProcessor` and the GVR extension, which has been * Remove `GvrAudioProcessor` and the GVR extension, which has been
deprecated since 2.11.0. 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: * Cast extension:
* Implement `CastPlayer.setPlaybackParameters(PlaybackParameters)` to * Implement `CastPlayer.setPlaybackParameters(PlaybackParameters)` to
support setting the playback speed support setting the playback speed

View File

@ -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. * 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. * @param download The state of the download.
*/ */
@SuppressWarnings("deprecation")
private void notifyDownloadChanged(Download download) { private void notifyDownloadChanged(Download download) {
onDownloadChanged(download);
if (foregroundNotificationUpdater != null) { if (foregroundNotificationUpdater != null) {
if (needsStartedService(download.state)) { if (needsStartedService(download.state)) {
foregroundNotificationUpdater.startPeriodicUpdates(); foregroundNotificationUpdater.startPeriodicUpdates();
@ -817,14 +794,8 @@ public abstract class DownloadService extends Service {
} }
} }
/** /** Called when a download is removed. */
* Called when a download is removed. private void notifyDownloadRemoved() {
*
* @param download The last state of the download before it was removed.
*/
@SuppressWarnings("deprecation")
private void notifyDownloadRemoved(Download download) {
onDownloadRemoved(download);
if (foregroundNotificationUpdater != null) { if (foregroundNotificationUpdater != null) {
foregroundNotificationUpdater.invalidate(); foregroundNotificationUpdater.invalidate();
} }
@ -996,7 +967,7 @@ public abstract class DownloadService extends Service {
@Override @Override
public void onDownloadRemoved(DownloadManager downloadManager, Download download) { public void onDownloadRemoved(DownloadManager downloadManager, Download download) {
if (downloadService != null) { if (downloadService != null) {
downloadService.notifyDownloadRemoved(download); downloadService.notifyDownloadRemoved();
} }
} }