public void updateDownload(){
  ArrayList<DownloadInfoRunnable> ongoingDownloads=getOngoingDownloads();
  if (!ongoingDownloads.isEmpty()) {
    updateProgress();
  }
 else {
    timer.cancel();
    timer.purge();
    stopSelf();
    mBuilder=null;
    stopForeground(true);
    isStopped=true;
  }
}

public void updateDownload ( ) { ArrayList < DownloadInfoRunnable > ongoingDownloads = getOngoingDownloads ( ) ; if ( ! ongoingDownloads . isEmpty ( ) ) { updateProgress ( ) ; } else { timer . cancel ( ) ; timer . purge ( ) ; stopSelf ( ) ; mBuilder = null ; stopForeground ( true ) ; isStopped = true ; } }
updates the download list and stops the service if it ' s empty . if not , updates the progress in the notification bar
