public boolean unBindServiceIfIdle ( ) { // check idle if ( ! isServiceConnected ( ) ) { return false ; } if ( FileDownloadList . getImpl ( ) . isEmpty ( ) && FileDownloadServiceProxy . getImpl ( ) . isIdle ( ) ) { unBindService ( ) ; return true ; } return false ; }
Unbind and stop the downloader service when there is no task running in the FileDownloader .