Save attachments to /sdcard/Download

Bug: 3339015
Change-Id: Iee08f0c358e6680175c732ef0d5e416a86da5a5d
This commit is contained in:
Andy Stadler 2011-01-11 13:46:01 -08:00
parent f6fe21b483
commit 0faa37d771
1 changed files with 4 additions and 2 deletions

View File

@ -680,8 +680,10 @@ public abstract class MessageViewFragmentBase extends Fragment implements View.O
Uri attachmentUri = AttachmentProvider.getAttachmentUri(mAccountId, attachment.mId);
try {
File file = Utility.createUniqueFile(Environment.getExternalStorageDirectory(),
attachment.mFileName);
File downloads = Environment.getExternalStoragePublicDirectory(
Environment.DIRECTORY_DOWNLOADS);
downloads.mkdirs();
File file = Utility.createUniqueFile(downloads, attachment.mFileName);
Uri contentUri = AttachmentProvider.resolveAttachmentIdToContentUri(
mContext.getContentResolver(), attachmentUri);
InputStream in = mContext.getContentResolver().openInputStream(contentUri);