Commit 9f09267e authored by Min Qin's avatar Min Qin Committed by Commit Bot

Catch an exception when publishing a download

BUG=1059201

Change-Id: Ia2a6f4dd477bc52ec607d7d989e03875140d058d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2091944Reviewed-by: default avatarXing Liu <xingliu@chromium.org>
Commit-Queue: Min Qin <qinmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747922}
parent 85560e5c
......@@ -196,11 +196,14 @@ public class DownloadCollectionBridge {
PendingSession session = openPendingUri(intermediateUri);
Uri publishedUri = session.publish();
if (!TextUtils.isEmpty(mimeType)) {
final ContentValues updateValues = new ContentValues();
updateValues.put(MediaColumns.MIME_TYPE, mimeType);
resolver.update(publishedUri, updateValues, null, null);
try {
final ContentValues updateValues = new ContentValues();
updateValues.put(MediaColumns.MIME_TYPE, mimeType);
resolver.update(publishedUri, updateValues, null, null);
} catch (Exception e) {
Log.e(TAG, "Unable to modify mimeType.", e);
}
}
return publishedUri.toString();
}
......
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