Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2898)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java

Issue 2647343005: [Download Home] Fix for 0 seconds remaining (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java
index 737dd84c23e7f77ce2df6154e81bfc04c1573d11..e1f32ad42fe9f34ead4cc488b344117f56603295 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadNotificationService.java
@@ -270,7 +270,7 @@ public class DownloadNotificationService extends Service {
* @param percentage Percentage completed. Value should be between 0 to 100 if
* the percentage can be determined, or -1 if it is unknown.
* @param bytesReceived Total number of bytes received.
- * @param timeRemainingInMillis Remaining download time in milliseconds.
+ * @param timeRemainingInMillis Remaining download time in milliseconds or -1 if it is unknown.
* @param startTime Time when download started.
* @param isOffTheRecord Whether the download is off the record.
* @param canDownloadWhileMetered Whether the download can happen in metered network.
@@ -291,6 +291,8 @@ public class DownloadNotificationService extends Service {
} else if (indeterminate) {
contentText = DownloadUtils.getStringForBytes(
mContext, DownloadUtils.BYTES_DOWNLOADED_STRINGS, bytesReceived);
+ } else if (timeRemainingInMillis < 0) {
+ contentText = mContext.getResources().getString(R.string.download_started);
qinmin 2017/01/25 18:21:51 nit: you can save one else block here, just else
shaktisahu 2017/01/25 19:24:56 Done.
} else {
contentText = formatRemainingTime(mContext, timeRemainingInMillis);
}

Powered by Google App Engine
This is Rietveld 408576698