diff --git a/app/src/main/java/org/thoughtcrime/securesms/messages/IncomingMessageObserver.java b/app/src/main/java/org/thoughtcrime/securesms/messages/IncomingMessageObserver.java index 7f973f2646..c2b81792d4 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/messages/IncomingMessageObserver.java +++ b/app/src/main/java/org/thoughtcrime/securesms/messages/IncomingMessageObserver.java @@ -264,7 +264,7 @@ public class IncomingMessageObserver { public int onStartCommand(Intent intent, int flags, int startId) { super.onStartCommand(intent, flags, startId); - NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext(), NotificationChannels.OTHER); + NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext(), NotificationChannels.BACKGROUND); builder.setContentTitle(getApplicationContext().getString(R.string.MessageRetrievalService_signal)); builder.setContentText(getApplicationContext().getString(R.string.MessageRetrievalService_background_connection_enabled)); builder.setPriority(NotificationCompat.PRIORITY_MIN); diff --git a/app/src/main/java/org/thoughtcrime/securesms/notifications/NotificationChannels.java b/app/src/main/java/org/thoughtcrime/securesms/notifications/NotificationChannels.java index 6ffa5ca854..46c8ae7ebf 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/notifications/NotificationChannels.java +++ b/app/src/main/java/org/thoughtcrime/securesms/notifications/NotificationChannels.java @@ -72,6 +72,8 @@ public class NotificationChannels { public static final String OTHER = "other_v3"; public static final String VOICE_NOTES = "voice_notes"; public static final String JOIN_EVENTS = "join_events"; + public static final String BACKGROUND = "background_connection"; + public static final String CALL_STATUS = "call_status"; /** * Ensures all of the notification channels are created. No harm in repeat calls. Call is safely @@ -596,6 +598,8 @@ public class NotificationChannels { NotificationChannel other = new NotificationChannel(OTHER, context.getString(R.string.NotificationChannel_other), NotificationManager.IMPORTANCE_LOW); NotificationChannel voiceNotes = new NotificationChannel(VOICE_NOTES, context.getString(R.string.NotificationChannel_voice_notes), NotificationManager.IMPORTANCE_LOW); NotificationChannel joinEvents = new NotificationChannel(JOIN_EVENTS, context.getString(R.string.NotificationChannel_contact_joined_signal), NotificationManager.IMPORTANCE_DEFAULT); + NotificationChannel background = new NotificationChannel(BACKGROUND, context.getString(R.string.NotificationChannel_background_connection), NotificationManager.IMPORTANCE_LOW); + NotificationChannel callStatus = new NotificationChannel(CALL_STATUS, context.getString(R.string.NotificationChannel_call_status), NotificationManager.IMPORTANCE_LOW); messages.setGroup(CATEGORY_MESSAGES); setVibrationEnabled(messages, SignalStore.settings().isMessageVibrateEnabled()); @@ -609,8 +613,10 @@ public class NotificationChannels { setVibrationEnabled(other, false); voiceNotes.setShowBadge(false); joinEvents.setShowBadge(false); + background.setShowBadge(false); + callStatus.setShowBadge(false); - notificationManager.createNotificationChannels(Arrays.asList(messages, calls, failures, backups, lockedStatus, other, voiceNotes, joinEvents)); + notificationManager.createNotificationChannels(Arrays.asList(messages, calls, failures, backups, lockedStatus, other, voiceNotes, joinEvents, background, callStatus)); if (BuildConfig.PLAY_STORE_DISABLED) { NotificationChannel appUpdates = new NotificationChannel(APP_UPDATES, context.getString(R.string.NotificationChannel_app_updates), NotificationManager.IMPORTANCE_HIGH); diff --git a/app/src/main/java/org/thoughtcrime/securesms/webrtc/CallNotificationBuilder.java b/app/src/main/java/org/thoughtcrime/securesms/webrtc/CallNotificationBuilder.java index 78b4d4496e..c97a3b235e 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/webrtc/CallNotificationBuilder.java +++ b/app/src/main/java/org/thoughtcrime/securesms/webrtc/CallNotificationBuilder.java @@ -86,12 +86,12 @@ public class CallNotificationBuilder { PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, contentIntent, 0); - return new NotificationCompat.Builder(context, NotificationChannels.OTHER).setSmallIcon(R.drawable.ic_call_secure_white_24dp) - .setContentIntent(pendingIntent) - .setOngoing(true) - .setContentTitle(context.getString(R.string.NotificationBarManager__stopping_signal_call_service)) - .setPriority(NotificationCompat.PRIORITY_MIN) - .build(); + return new NotificationCompat.Builder(context, NotificationChannels.CALL_STATUS).setSmallIcon(R.drawable.ic_call_secure_white_24dp) + .setContentIntent(pendingIntent) + .setOngoing(true) + .setContentTitle(context.getString(R.string.NotificationBarManager__stopping_signal_call_service)) + .setPriority(NotificationCompat.PRIORITY_MIN) + .build(); } public static int getStoppingNotificationId() { @@ -107,7 +107,7 @@ public class CallNotificationBuilder { if (callActivityRestricted() && type == TYPE_INCOMING_RINGING) { return NotificationChannels.CALLS; } else { - return NotificationChannels.OTHER; + return NotificationChannels.CALL_STATUS; } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b8b82919f8..f05de991e2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1868,6 +1868,10 @@ Voice Notes Contact joined Signal No activity available to open notification channel settings. + + Background connection + + Call status