Bug 1529367 - Part 2: Minor intent processing optimisation. r=snorp

The extension is only ever used for local files, so don't bother retrieving it
otherwise.

Differential Revision: https://phabricator.services.mozilla.com/D21049

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jan Henning 2019-02-26 14:54:27 +00:00
Родитель 8ff617cb88
Коммит 2a0386d4c6
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -342,12 +342,12 @@ public final class IntentHelper implements BundleEventListener {
// 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 Intent intent = getIntentForActionString(action);
intent.setData(uri);
if ("file".equals(scheme)) {
// Only set explicit mimeTypes on file://.
final String extension = MimeTypeMap.getFileExtensionFromUrl(targetURI);
final String mimeType2 = GeckoAppShell.getMimeTypeFromExtension(extension);
intent.setType(mimeType2);
return intent;