Bug 1100100 - "Downloaded file can't be opened from "Downloads" page" [r=wjohnston]

This commit is contained in:
wesj 2014-12-19 13:46:00 -08:00
parent 318e7ac495
commit ab7501f93d

View File

@ -1168,7 +1168,7 @@ public class GeckoAppShell
}
final Uri uri = normalizeUriScheme(targetURI.indexOf(':') >= 0 ? Uri.parse(targetURI) : new Uri.Builder().scheme(targetURI).build());
if (mimeType.length() > 0) {
if (!TextUtils.isEmpty(mimeType)) {
Intent intent = getIntentForActionString(action);
intent.setDataAndType(uri, mimeType);
return intent;
@ -1184,8 +1184,10 @@ public class GeckoAppShell
// custom handlers that would apply.
// Start with the original URI. If we end up modifying it, we'll
// overwrite it.
final String extension = MimeTypeMap.getFileExtensionFromUrl(targetURI);
final String mimeType2 = getMimeTypeFromExtension(extension);
final Intent intent = getIntentForActionString(action);
intent.setData(uri);
intent.setDataAndType(uri, mimeType2);
if ("vnd.youtube".equals(scheme) &&
!hasHandlersForIntent(intent) &&