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

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

Issue 2446643004: Fixing a crash when clicking download notification while Chrome is killed (Closed)
Patch Set: nit Created 4 years, 2 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 16983bc7e514544eafa695d2d58395afd4d21035..c4119348c84771defe237e4928d78650a255d8a8 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
@@ -60,6 +60,7 @@ public class DownloadNotificationService extends Service {
static final String EXTRA_NOTIFICATION_DISMISSED = "NotificationDismissed";
static final String EXTRA_DOWNLOAD_IS_OFF_THE_RECORD = "DownloadIsOffTheRecord";
static final String EXTRA_DOWNLOAD_IS_OFFLINE_PAGE = "DownloadIsOfflinePage";
+ static final String EXTRA_IS_SUPPORTED_MIME_TYPE = "IsSupportedMimeType";
static final String ACTION_DOWNLOAD_CANCEL =
"org.chromium.chrome.browser.download.DOWNLOAD_CANCEL";
static final String ACTION_DOWNLOAD_PAUSE =
@@ -339,12 +340,14 @@ public class DownloadNotificationService extends Service {
* @param filePath Full path to the download.
* @param fileName Filename of the download.
* @param systemDownloadId Download ID assigned by system DownloadManager.
+ * @param isOfflinePage Whether the download is for offline page.
+ * @param isSupportedMimeType Whether the MIME type can be viewed inside browser.
* @return ID of the successful download notification. Used for removing the notification when
* user click on the snackbar.
*/
public int notifyDownloadSuccessful(
String downloadGuid, String filePath, String fileName, long systemDownloadId,
- boolean isOfflinePage) {
+ boolean isOfflinePage, boolean isSupportedMimeType) {
int notificationId = getNotificationId(downloadGuid);
NotificationCompat.Builder builder = buildNotification(
R.drawable.offline_pin, fileName,
@@ -360,6 +363,7 @@ public class DownloadNotificationService extends Service {
long[] idArray = {systemDownloadId};
intent.putExtra(DownloadManager.EXTRA_NOTIFICATION_CLICK_DOWNLOAD_IDS, idArray);
intent.putExtra(EXTRA_DOWNLOAD_FILE_PATH, filePath);
+ intent.putExtra(EXTRA_IS_SUPPORTED_MIME_TYPE, isSupportedMimeType);
}
intent.setComponent(component);
builder.setContentIntent(PendingIntent.getBroadcast(

Powered by Google App Engine
This is Rietveld 408576698