From 97ea95c30fdfe3a2a72b3e6b5a6015b09404b8a2 Mon Sep 17 00:00:00 2001 From: Dariusz Olszewski Date: Mon, 11 Jul 2022 21:46:54 +0200 Subject: [PATCH] Mark as read - SpotBugs Signed-off-by: Dariusz Olszewski --- .../com/nextcloud/talk/jobs/NotificationWorker.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.java b/app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.java index 4f53ad220..c94fe9247 100644 --- a/app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.java +++ b/app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.java @@ -499,7 +499,7 @@ public class NotificationWorker extends Worker { MessagingStyle newStyle = new MessagingStyle(person); newStyle.setConversationTitle(decryptedPushMessage.getSubject()); - newStyle.setGroupConversation(!conversationType.equals("one2one")); + newStyle.setGroupConversation(!"one2one".equals(conversationType)); if (style != null) { style.getMessages().forEach(message -> newStyle.addMessage( @@ -512,7 +512,7 @@ public class NotificationWorker extends Worker { return newStyle; } - private int parseMessageId(@NonNull String objectId) throws NumberFormatException { + private int parseMessageId(@NonNull String objectId) { String[] objectIdParts = objectId.split("/"); if (objectIdParts.length < 2) { throw new NumberFormatException("Invalid objectId, doesn't contain at least one '/'"); @@ -531,7 +531,7 @@ public class NotificationWorker extends Worker { return; } - if (!notification.category.equals(Notification.CATEGORY_CALL) || !muteCall) { + if (!Notification.CATEGORY_CALL.equals(notification.category) || !muteCall) { Uri soundUri = NotificationUtils.INSTANCE.getMessageRingtoneUri(context, appPreferences); if (soundUri != null && !ApplicationWideCurrentRoomHolder.getInstance().isInCall() && (DoNotDisturbUtils.INSTANCE.shouldPlaySound() || importantConversation)) { @@ -611,14 +611,14 @@ public class NotificationWorker extends Worker { ncApi = retrofit.newBuilder().client(okHttpClient.newBuilder().cookieJar(new JavaNetCookieJar(new CookieManager())).build()).build().create(NcApi.class); - boolean shouldShowNotification = decryptedPushMessage.getApp().equals("spreed"); + boolean shouldShowNotification = "spreed".equals(decryptedPushMessage.getApp()); if (shouldShowNotification) { Intent intent; Bundle bundle = new Bundle(); - boolean startACall = decryptedPushMessage.getType().equals("call"); + boolean startACall = "call".equals(decryptedPushMessage.getType()); if (startACall) { intent = new Intent(context, CallActivity.class); } else {