Merge pull request #4623 from ByteHamster/cancel-future

Cancel notification updater future before shutting down executor
This commit is contained in:
ByteHamster 2020-11-01 09:47:32 +01:00 committed by GitHub
commit dc98c445c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -219,9 +219,9 @@ public class DownloadService extends Service {
} catch (InterruptedException e) {
e.printStackTrace();
}
cancelNotificationUpdater();
syncExecutor.shutdown();
schedExecutor.shutdown();
cancelNotificationUpdater();
if (downloadPostFuture != null) {
downloadPostFuture.cancel(true);
}
@ -640,6 +640,7 @@ public class DownloadService extends Service {
if (n != null) {
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
nm.notify(R.id.notification_downloading, n);
Log.d(TAG, "Download progress notification was posted");
}
}
}

View File

@ -173,6 +173,7 @@ public class DownloadServiceNotification {
}
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
nm.notify(id, builder.build());
Log.d(TAG, "Download report notification was posted");
} else {
Log.d(TAG, "No report is created");
}