From 905359a291e9566cb32bf646b64ad99ec38d3066 Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 6 Jan 2016 23:27:43 +0100 Subject: [PATCH] Change 'save attachment' experience - Don't use toast with path to file to notify user of success - Don't trigger scan of file using MediaScanner API Both functions are now handled by the DownloadManager. --- .../com/fsck/k9/helper/MediaScannerNotifier.java | 15 --------------- .../k9/ui/messageview/AttachmentController.java | 11 +---------- 2 files changed, 1 insertion(+), 25 deletions(-) delete mode 100644 k9mail/src/main/java/com/fsck/k9/helper/MediaScannerNotifier.java diff --git a/k9mail/src/main/java/com/fsck/k9/helper/MediaScannerNotifier.java b/k9mail/src/main/java/com/fsck/k9/helper/MediaScannerNotifier.java deleted file mode 100644 index 9dbed11ce..000000000 --- a/k9mail/src/main/java/com/fsck/k9/helper/MediaScannerNotifier.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.fsck.k9.helper; - - -import java.io.File; - -import android.content.Context; -import android.media.MediaScannerConnection; - - -public class MediaScannerNotifier { - public static void notify(Context context, File file) { - String[] paths = { file.getAbsolutePath() }; - MediaScannerConnection.scanFile(context, paths, null, null); - } -} diff --git a/k9mail/src/main/java/com/fsck/k9/ui/messageview/AttachmentController.java b/k9mail/src/main/java/com/fsck/k9/ui/messageview/AttachmentController.java index 7516cd018..dd0cf7025 100644 --- a/k9mail/src/main/java/com/fsck/k9/ui/messageview/AttachmentController.java +++ b/k9mail/src/main/java/com/fsck/k9/ui/messageview/AttachmentController.java @@ -28,7 +28,6 @@ import com.fsck.k9.cache.TemporaryAttachmentStore; import com.fsck.k9.controller.MessagingController; import com.fsck.k9.controller.MessagingListener; import com.fsck.k9.helper.FileHelper; -import com.fsck.k9.helper.MediaScannerNotifier; import com.fsck.k9.mail.Message; import com.fsck.k9.mail.Part; import com.fsck.k9.mail.internet.MimeUtility; @@ -280,11 +279,6 @@ public class AttachmentController { return resolveInfos.size(); } - private void displayAttachmentSavedMessage(final String filename) { - String message = context.getString(R.string.message_view_status_attachment_saved, filename); - displayMessageToUser(message); - } - private void displayAttachmentNotSavedMessage() { String message = context.getString(R.string.message_view_status_attachment_not_saved); displayMessageToUser(message); @@ -373,10 +367,7 @@ public class AttachmentController { @Override protected void onPostExecute(File file) { messageViewFragment.enableAttachmentButtons(attachment); - if (file != null) { - displayAttachmentSavedMessage(file.toString()); - MediaScannerNotifier.notify(context, file); - } else { + if (file == null) { displayAttachmentNotSavedMessage(); } }