mirror of
https://github.com/androidx/media.git
synced 2025-05-04 06:00:37 +08:00
Fix scheduler NPE in DownloadService
PiperOrigin-RevId: 230260266
This commit is contained in:
parent
29711b922d
commit
de3a749b97
@ -65,7 +65,7 @@ public class DemoDownloadService extends DownloadService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDownloadStateChanged(DownloadState downloadState) {
|
protected void onDownloadStateChanged(DownloadState downloadState) {
|
||||||
Notification notification = null;
|
Notification notification;
|
||||||
if (downloadState.state == DownloadState.STATE_COMPLETED) {
|
if (downloadState.state == DownloadState.STATE_COMPLETED) {
|
||||||
notification =
|
notification =
|
||||||
DownloadNotificationUtil.buildDownloadCompletedNotification(
|
DownloadNotificationUtil.buildDownloadCompletedNotification(
|
||||||
|
@ -462,7 +462,7 @@ public abstract class DownloadService extends Service {
|
|||||||
public void detachService(DownloadService downloadService, boolean unschedule) {
|
public void detachService(DownloadService downloadService, boolean unschedule) {
|
||||||
Assertions.checkState(this.downloadService == downloadService);
|
Assertions.checkState(this.downloadService == downloadService);
|
||||||
this.downloadService = null;
|
this.downloadService = null;
|
||||||
if (unschedule) {
|
if (scheduler != null && unschedule) {
|
||||||
scheduler.cancel();
|
scheduler.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user