Merge pull request #780 from mfietz/download_report

Download Report
This commit is contained in:
Tom Hennen 2015-05-02 08:26:04 -04:00
commit 1bd6bf76f6
2 changed files with 6 additions and 7 deletions

View File

@ -520,9 +520,7 @@ public class DownloadService extends Service {
/**
* Creates a notification at the end of the service lifecycle to notify the
* user about the number of completed downloads. A report will only be
* created if the number of successfully downloaded feeds is bigger than 1
* or if there is at least one failed download which is not an image or if
* there is at least one downloaded media file.
* created if there is at least one failed download excluding images
*/
private void updateReport() {
// check if report should be created
@ -550,16 +548,16 @@ public class DownloadService extends Service {
.setTicker(
getString(R.string.download_report_title))
.setContentTitle(
getString(R.string.download_report_title))
getString(R.string.download_report_content_title))
.setContentText(
String.format(
getString(R.string.download_report_content),
successfulDownloads, failedDownloads)
)
.setSmallIcon(R.drawable.stat_notify_sync)
.setSmallIcon(R.drawable.stat_notify_sync_error)
.setLargeIcon(
BitmapFactory.decodeResource(getResources(),
R.drawable.stat_notify_sync)
R.drawable.stat_notify_sync_error)
)
.setContentIntent(
ClientConfig.downloadServiceCallbacks.getReportNotificationContentIntent(this)

View File

@ -128,7 +128,8 @@
<string name="download_error_unauthorized">Authentication error</string>
<string name="cancel_all_downloads_label">Cancel all downloads</string>
<string name="download_cancelled_msg">Download cancelled</string>
<string name="download_report_title">Downloads completed</string>
<string name="download_report_title">Downloads completed with error(s)</string>
<string name="download_report_content_title">Download report</string>
<string name="download_error_malformed_url">Malformed URL</string>
<string name="download_error_io_error">IO Error</string>
<string name="download_error_request_error">Request error</string>