From 284cca3e259d5096670ac7f5d58e361988df0bde Mon Sep 17 00:00:00 2001 From: Alan Evans Date: Mon, 17 Jun 2019 10:39:41 -0400 Subject: [PATCH] Prevent reply and mark as read abilities while Signal is locked. Fixes #8874 --- .../securesms/notifications/MessageNotifier.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/org/thoughtcrime/securesms/notifications/MessageNotifier.java b/src/org/thoughtcrime/securesms/notifications/MessageNotifier.java index 9825afd0f6..112523b86c 100644 --- a/src/org/thoughtcrime/securesms/notifications/MessageNotifier.java +++ b/src/org/thoughtcrime/securesms/notifications/MessageNotifier.java @@ -320,15 +320,17 @@ public class MessageNotifier { long timestamp = notifications.get(0).getTimestamp(); if (timestamp != 0) builder.setWhen(timestamp); - ReplyMethod replyMethod = ReplyMethod.forRecipient(context, recipient); + if (!KeyCachingService.isLocked(context)) { + ReplyMethod replyMethod = ReplyMethod.forRecipient(context, recipient); - builder.addActions(notificationState.getMarkAsReadIntent(context, notificationId), - notificationState.getQuickReplyIntent(context, notifications.get(0).getRecipient()), - notificationState.getRemoteReplyIntent(context, notifications.get(0).getRecipient(), replyMethod), - replyMethod); + builder.addActions(notificationState.getMarkAsReadIntent(context, notificationId), + notificationState.getQuickReplyIntent(context, notifications.get(0).getRecipient()), + notificationState.getRemoteReplyIntent(context, notifications.get(0).getRecipient(), replyMethod), + replyMethod); - builder.addAndroidAutoAction(notificationState.getAndroidAutoReplyIntent(context, notifications.get(0).getRecipient()), - notificationState.getAndroidAutoHeardIntent(context, notificationId), notifications.get(0).getTimestamp()); + builder.addAndroidAutoAction(notificationState.getAndroidAutoReplyIntent(context, notifications.get(0).getRecipient()), + notificationState.getAndroidAutoHeardIntent(context, notificationId), notifications.get(0).getTimestamp()); + } ListIterator iterator = notifications.listIterator(notifications.size());