+ * Updates the status notification with the result of a download operation.\r
+ * \r
+ * @param downloadResult Result of the download operation.\r
+ * @param download Finished download operation\r
+ */\r
+ private void notifyDownloadResult(DownloadFileOperation download, RemoteOperationResult downloadResult) {\r
+ mNotificationManager.cancel(R.string.downloader_download_in_progress_ticker);\r
+ if (!downloadResult.isCancelled()) {\r
+ int tickerId = (downloadResult.isSuccess()) ? R.string.downloader_download_succeeded_ticker : R.string.downloader_download_failed_ticker;\r
+ int contentId = (downloadResult.isSuccess()) ? R.string.downloader_download_succeeded_content : R.string.downloader_download_failed_content;\r
+ Notification finalNotification = new Notification(R.drawable.icon, getString(tickerId), System.currentTimeMillis());\r
+ finalNotification.flags |= Notification.FLAG_AUTO_CANCEL;\r
+ // TODO put something smart in the contentIntent below\r
+ finalNotification.contentIntent = PendingIntent.getActivity(getApplicationContext(), (int)System.currentTimeMillis(), new Intent(), 0);\r
+ finalNotification.setLatestEventInfo(getApplicationContext(), getString(tickerId), String.format(getString(contentId), new File(download.getSavePath()).getName()), finalNotification.contentIntent);\r
+ mNotificationManager.notify(tickerId, finalNotification);\r
+ }\r
+ }\r
+ \r
+ \r
+ /**\r