mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Fix scheduler NPE in DownloadService
PiperOrigin-RevId: 230260266
This commit is contained in:
parent
29711b922d
commit
de3a749b97
2 changed files with 2 additions and 2 deletions
|
|
@ -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…
Reference in a new issue