From a3a757c3efef1bc416910f473cf7a6764d1cf669 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Thu, 25 Jul 2019 10:40:57 +1000 Subject: [PATCH] Disable quick reply for now --- .../securesms/notifications/MessageNotifier.java | 10 +++++----- .../SingleRecipientNotificationBuilder.java | 10 +++++++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/org/thoughtcrime/securesms/notifications/MessageNotifier.java b/src/org/thoughtcrime/securesms/notifications/MessageNotifier.java index d4d16ed3db..bfdef47ac7 100644 --- a/src/org/thoughtcrime/securesms/notifications/MessageNotifier.java +++ b/src/org/thoughtcrime/securesms/notifications/MessageNotifier.java @@ -37,12 +37,10 @@ import android.support.annotation.NonNull; import android.support.v4.app.NotificationCompat; import android.support.v4.app.NotificationManagerCompat; import android.text.TextUtils; -import org.thoughtcrime.securesms.logging.Log; -import org.thoughtcrime.securesms.conversation.ConversationActivity; -import network.loki.messenger.R; -import org.thoughtcrime.securesms.contactshare.ContactUtil; import org.thoughtcrime.securesms.contactshare.Contact; +import org.thoughtcrime.securesms.contactshare.ContactUtil; +import org.thoughtcrime.securesms.conversation.ConversationActivity; import org.thoughtcrime.securesms.database.DatabaseFactory; import org.thoughtcrime.securesms.database.MessagingDatabase.MarkedMessageInfo; import org.thoughtcrime.securesms.database.MmsSmsDatabase; @@ -50,6 +48,7 @@ import org.thoughtcrime.securesms.database.ThreadDatabase; import org.thoughtcrime.securesms.database.model.MediaMmsMessageRecord; import org.thoughtcrime.securesms.database.model.MessageRecord; import org.thoughtcrime.securesms.database.model.MmsMessageRecord; +import org.thoughtcrime.securesms.logging.Log; import org.thoughtcrime.securesms.mms.SlideDeck; import org.thoughtcrime.securesms.recipients.Recipient; import org.thoughtcrime.securesms.service.IncomingMessageObserver; @@ -70,6 +69,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import me.leolin.shortcutbadger.ShortcutBadger; +import network.loki.messenger.R; /** @@ -318,7 +318,7 @@ public class MessageNotifier { ReplyMethod replyMethod = ReplyMethod.forRecipient(context, recipient); builder.addActions(notificationState.getMarkAsReadIntent(context, notificationId), - notificationState.getQuickReplyIntent(context, notifications.get(0).getRecipient()), + /*notificationState.getQuickReplyIntent(context, notifications.get(0).getRecipient()),*/ notificationState.getRemoteReplyIntent(context, notifications.get(0).getRecipient(), replyMethod), replyMethod); diff --git a/src/org/thoughtcrime/securesms/notifications/SingleRecipientNotificationBuilder.java b/src/org/thoughtcrime/securesms/notifications/SingleRecipientNotificationBuilder.java index 4cb7407c06..4f289e52f1 100644 --- a/src/org/thoughtcrime/securesms/notifications/SingleRecipientNotificationBuilder.java +++ b/src/org/thoughtcrime/securesms/notifications/SingleRecipientNotificationBuilder.java @@ -17,7 +17,6 @@ import android.text.SpannableStringBuilder; import com.bumptech.glide.load.engine.DiskCacheStrategy; -import network.loki.messenger.R; import org.thoughtcrime.securesms.contacts.avatars.ContactColors; import org.thoughtcrime.securesms.contacts.avatars.ContactPhoto; import org.thoughtcrime.securesms.contacts.avatars.FallbackContactPhoto; @@ -37,6 +36,8 @@ import java.util.LinkedList; import java.util.List; import java.util.concurrent.ExecutionException; +import network.loki.messenger.R; + public class SingleRecipientNotificationBuilder extends AbstractNotificationBuilder { private static final String TAG = SingleRecipientNotificationBuilder.class.getSimpleName(); @@ -143,7 +144,6 @@ public class SingleRecipientNotificationBuilder extends AbstractNotificationBuil } public void addActions(@NonNull PendingIntent markReadIntent, - @NonNull PendingIntent quickReplyIntent, @NonNull PendingIntent wearableReplyIntent, @NonNull ReplyMethod replyMethod) { @@ -154,17 +154,21 @@ public class SingleRecipientNotificationBuilder extends AbstractNotificationBuil String actionName = context.getString(R.string.MessageNotifier_reply); String label = context.getString(replyMethodLongDescription(replyMethod)); + /* Action replyAction = new Action(R.drawable.ic_reply_white_36dp, actionName, quickReplyIntent); + */ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + /* replyAction = new Action.Builder(R.drawable.ic_reply_white_36dp, actionName, wearableReplyIntent) .addRemoteInput(new RemoteInput.Builder(MessageNotifier.EXTRA_REMOTE_REPLY) .setLabel(label).build()) .build(); + */ } Action wearableReplyAction = new Action.Builder(R.drawable.ic_reply, @@ -175,7 +179,7 @@ public class SingleRecipientNotificationBuilder extends AbstractNotificationBuil .build(); addAction(markAsReadAction); - addAction(replyAction); + // addAction(replyAction); extend(new NotificationCompat.WearableExtender().addAction(markAsReadAction) .addAction(wearableReplyAction));