From f315b1db80f41089e3b8e492a765be305479c0e1 Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Fri, 8 Dec 2017 14:58:42 -0800 Subject: [PATCH] Make save attachment task toast location instead of snackbar --- res/xml/file_provider_paths.xml | 5 +++ .../securesms/ConversationTitleView.java | 3 ++ .../securesms/util/SaveAttachmentTask.java | 33 ++++--------------- 3 files changed, 15 insertions(+), 26 deletions(-) diff --git a/res/xml/file_provider_paths.xml b/res/xml/file_provider_paths.xml index 30c4032eb2..06d146a8fb 100644 --- a/res/xml/file_provider_paths.xml +++ b/res/xml/file_provider_paths.xml @@ -1,4 +1,9 @@ + + + + + \ No newline at end of file diff --git a/src/org/thoughtcrime/securesms/ConversationTitleView.java b/src/org/thoughtcrime/securesms/ConversationTitleView.java index de72b09f00..2e555e589f 100644 --- a/src/org/thoughtcrime/securesms/ConversationTitleView.java +++ b/src/org/thoughtcrime/securesms/ConversationTitleView.java @@ -1,5 +1,6 @@ package org.thoughtcrime.securesms; +import android.annotation.SuppressLint; import android.content.Context; import android.support.annotation.NonNull; import android.support.annotation.Nullable; @@ -24,6 +25,7 @@ import java.lang.ref.WeakReference; public class ConversationTitleView extends RelativeLayout { + @SuppressWarnings("unused") private static final String TAG = ConversationTitleView.class.getSimpleName(); private View content; @@ -118,6 +120,7 @@ public class ConversationTitleView extends RelativeLayout { this.subtitle.setVisibility(View.VISIBLE); } + @SuppressLint("SetTextI18n") private void setNonContactRecipientTitle(Recipient recipient) { this.title.setText(recipient.getAddress().serialize()); diff --git a/src/org/thoughtcrime/securesms/util/SaveAttachmentTask.java b/src/org/thoughtcrime/securesms/util/SaveAttachmentTask.java index e3168a7fd5..0e2641950a 100644 --- a/src/org/thoughtcrime/securesms/util/SaveAttachmentTask.java +++ b/src/org/thoughtcrime/securesms/util/SaveAttachmentTask.java @@ -29,7 +29,7 @@ import java.io.OutputStream; import java.lang.ref.WeakReference; import java.text.SimpleDateFormat; -public class SaveAttachmentTask extends ProgressDialogAsyncTask> { +public class SaveAttachmentTask extends ProgressDialogAsyncTask> { private static final String TAG = SaveAttachmentTask.class.getSimpleName(); protected static final int SUCCESS = 0; @@ -57,7 +57,7 @@ public class SaveAttachmentTask extends ProgressDialogAsyncTask doInBackground(SaveAttachmentTask.Attachment... attachments) { + protected Pair doInBackground(SaveAttachmentTask.Attachment... attachments) { if (attachments == null || attachments.length == 0) { throw new AssertionError("must pass in at least one attachment"); } @@ -65,7 +65,7 @@ public class SaveAttachmentTask extends ProgressDialogAsyncTask(WRITE_ACCESS_FAILURE, null); @@ -90,7 +90,7 @@ public class SaveAttachmentTask extends ProgressDialogAsyncTask result) { + protected void onPostExecute(final Pair result) { super.onPostExecute(result); final Context context = contextReference.get(); if (context == null) return; @@ -197,26 +197,7 @@ public class SaveAttachmentTask extends ProgressDialogAsyncTask