diff options
author | Andrew Sapperstein <asapperstein@google.com> | 2013-06-24 14:10:38 -0700 |
---|---|---|
committer | Andrew Sapperstein <asapperstein@google.com> | 2013-06-24 14:10:38 -0700 |
commit | 1317896352698e41d2053d6f83175c181c6e39f0 (patch) | |
tree | f41e948ca9375d3c3aceb577d9ad502f641fe600 | |
parent | 7434e800d4313a227120ca36bd95683752a7879f (diff) | |
download | android_packages_apps_UnifiedEmail-1317896352698e41d2053d6f83175c181c6e39f0.tar.gz android_packages_apps_UnifiedEmail-1317896352698e41d2053d6f83175c181c6e39f0.tar.bz2 android_packages_apps_UnifiedEmail-1317896352698e41d2053d6f83175c181c6e39f0.zip |
Allow installing APKs from eml viewer.
Fixes b/9528672. Need to change the content
uri to a direct file uri so install will work.
Change-Id: Iac9e17e45ecf5c9551e271dbde6cc3f18bf4f8ee
-rw-r--r-- | src/com/android/mail/providers/EmlAttachmentProvider.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/mail/providers/EmlAttachmentProvider.java b/src/com/android/mail/providers/EmlAttachmentProvider.java index e0b08a3d0..0c8a7cbd1 100644 --- a/src/com/android/mail/providers/EmlAttachmentProvider.java +++ b/src/com/android/mail/providers/EmlAttachmentProvider.java @@ -34,6 +34,7 @@ import com.android.ex.photo.provider.PhotoContract; import com.android.mail.R; import com.android.mail.utils.LogTag; import com.android.mail.utils.LogUtils; +import com.android.mail.utils.MimeType; import com.google.common.collect.Lists; import com.google.common.collect.Maps; @@ -315,6 +316,11 @@ public class EmlAttachmentProvider extends ContentProvider { } } + // if the attachment is an APK, change contentUri to be a direct file uri + if (MimeType.isInstallable(attachment.getContentType())) { + attachment.contentUri = Uri.parse("file://" + newFilePath); + } + // 3. add file to download manager try { |