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
|
||||
protected void onDownloadStateChanged(DownloadState downloadState) {
|
||||
Notification notification = null;
|
||||
Notification notification;
|
||||
if (downloadState.state == DownloadState.STATE_COMPLETED) {
|
||||
notification =
|
||||
DownloadNotificationUtil.buildDownloadCompletedNotification(
|
||||
|
@ -462,7 +462,7 @@ public abstract class DownloadService extends Service {
|
||||
public void detachService(DownloadService downloadService, boolean unschedule) {
|
||||
Assertions.checkState(this.downloadService == downloadService);
|
||||
this.downloadService = null;
|
||||
if (unschedule) {
|
||||
if (scheduler != null && unschedule) {
|
||||
scheduler.cancel();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user