X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/c9ce39241ea7e20a791dcd2ba8a8ca8b8bed3c1b..c407a568e09de0c13c9a42fcd3e4662e38744cb2:/src/com/owncloud/android/files/services/FileDownloader.java diff --git a/src/com/owncloud/android/files/services/FileDownloader.java b/src/com/owncloud/android/files/services/FileDownloader.java index 1c53bea4..b525bc4a 100644 --- a/src/com/owncloud/android/files/services/FileDownloader.java +++ b/src/com/owncloud/android/files/services/FileDownloader.java @@ -461,8 +461,9 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis */ private void notifyDownloadResult(DownloadFileOperation download, RemoteOperationResult downloadResult) { mNotificationManager.cancel(R.string.downloader_download_in_progress_ticker); - if (!downloadResult.isCancelled() && !downloadResult.isSuccess()) { - int tickerId = R.string.downloader_download_failed_ticker; + if (!downloadResult.isCancelled()) { + int tickerId = (downloadResult.isSuccess()) ? R.string.downloader_download_succeeded_ticker : + R.string.downloader_download_failed_ticker; boolean needsToUpdateCredentials = (downloadResult.getCode() == ResultCode.UNAUTHORIZED || (downloadResult.isIdPRedirection() @@ -501,8 +502,20 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis } mNotificationBuilder.setContentText(ErrorMessageAdapter.getErrorCauseMessage(downloadResult, download, getResources())); - mNotificationManager.notify(tickerId, mNotificationBuilder.build()); + + // Remove success notification + if (downloadResult.isSuccess()) { + // Sleep 2 seconds, so show the notification before remove it + Handler handler = new Handler(); + handler.postDelayed(new Runnable() { + public void run() { + mNotificationManager.cancel(R.string.downloader_download_succeeded_ticker); + } + }, 2000); + + } + } }