Commit 1d821ce3 authored by Min Qin's avatar Min Qin Committed by Commit Bot

Fix an issue that Original URL is parsed correctly from download

complete notification

The download complete notification use Uri as an extra type.
But when reading the extra, we treat it as an String.
This CL fixes the issue

BUG=1149649

Change-Id: If937c3688f4af8482fd4e7bbdc392cfcc84ff8f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2542665Reviewed-by: default avatarShakti Sahu <shaktisahu@chromium.org>
Reviewed-by: default avatarXing Liu <xingliu@chromium.org>
Commit-Queue: Min Qin <qinmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#828053}
parent 6ad00eec
...@@ -22,6 +22,7 @@ import android.app.Service; ...@@ -22,6 +22,7 @@ import android.app.Service;
import android.content.ComponentName; import android.content.ComponentName;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.net.Uri;
import android.os.Handler; import android.os.Handler;
import android.os.IBinder; import android.os.IBinder;
...@@ -376,11 +377,13 @@ public class DownloadBroadcastManagerImpl extends DownloadBroadcastManager.Impl ...@@ -376,11 +377,13 @@ public class DownloadBroadcastManagerImpl extends DownloadBroadcastManager.Impl
intent, DownloadNotificationService.EXTRA_IS_SUPPORTED_MIME_TYPE, false); intent, DownloadNotificationService.EXTRA_IS_SUPPORTED_MIME_TYPE, false);
boolean isOffTheRecord = IntentUtils.safeGetBooleanExtra( boolean isOffTheRecord = IntentUtils.safeGetBooleanExtra(
intent, DownloadNotificationService.EXTRA_IS_OFF_THE_RECORD, false); intent, DownloadNotificationService.EXTRA_IS_OFF_THE_RECORD, false);
String originalUrl = IntentUtils.safeGetStringExtra(intent, Intent.EXTRA_ORIGINATING_URI); Uri originalUrl = IntentUtils.safeGetParcelableExtra(intent, Intent.EXTRA_ORIGINATING_URI);
String referrer = IntentUtils.safeGetStringExtra(intent, Intent.EXTRA_REFERRER); Uri referrer = IntentUtils.safeGetParcelableExtra(intent, Intent.EXTRA_REFERRER);
DownloadManagerService.openDownloadedContent(context, downloadFilePath, isSupportedMimeType, DownloadManagerService.openDownloadedContent(context, downloadFilePath, isSupportedMimeType,
isOffTheRecord, contentId.id, id, originalUrl, referrer, isOffTheRecord, contentId.id, id,
DownloadOpenSource.NOTIFICATION, null); originalUrl == null ? null : originalUrl.toString(),
referrer == null ? null : referrer.toString(), DownloadOpenSource.NOTIFICATION,
null);
} }
@Nullable @Nullable
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment