Use individual notification channels for background connection and call status.

This commit is contained in:
Cody Henthorne
2022-02-15 16:36:29 -05:00
committed by Greyson Parrelli
parent a1bcbe9c86
commit 9389ee17b6
4 changed files with 19 additions and 9 deletions

View File

@@ -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);