@Override
  public void onDestroy() {
    if (BuildConfig.DEBUG) Log.d(TAG, "Service shutting down");
    isRunning = false;
    updateReport();

    stopForeground(true);
    NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
    nm.cancel(NOTIFICATION_ID);

    downloadCompletionThread.interrupt();
    syncExecutor.shutdown();
    schedExecutor.shutdown();
    feedSyncThread.shutdown();
    cancelNotificationUpdater();
    unregisterReceiver(cancelDownloadReceiver);

    DBTasks.autodownloadUndownloadedItems(getApplicationContext());
  }