diff --git a/src/org/thoughtcrime/securesms/notifications/NotificationCenter.java b/src/org/thoughtcrime/securesms/notifications/NotificationCenter.java index 43558f56a..6ea55e708 100644 --- a/src/org/thoughtcrime/securesms/notifications/NotificationCenter.java +++ b/src/org/thoughtcrime/securesms/notifications/NotificationCenter.java @@ -173,7 +173,7 @@ public class NotificationCenter { // channelIds: CH_MSG_* are used here, the other ones from outside (defined here to have some overview) public static final String CH_MSG_PREFIX = "ch_msg"; - public static final String CH_MSG_VERSION = "4"; + public static final String CH_MSG_VERSION = "5"; public static final String CH_PERMANENT = "dc_foreground_notification_ch"; public static final String CH_GENERIC = "ch_generic"; @@ -291,6 +291,8 @@ public class NotificationCenter { new AudioAttributes.Builder().setContentType(AudioAttributes.CONTENT_TYPE_UNKNOWN) .setUsage(AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_INSTANT) .build()); + } else { + channel.setSound(null, null); } notificationManager.createNotificationChannel(channel); @@ -377,7 +379,7 @@ public class NotificationCenter { if (!notificationChannelsSupported()) { if (signal) { Uri sound = effectiveSound(chatId); - if (sound != null) { + if (sound != null && !TextUtils.isEmpty(sound.toString())) { builder.setSound(sound); } boolean vibrate = effectiveVibrate(chatId); diff --git a/src/org/thoughtcrime/securesms/preferences/NotificationsPreferenceFragment.java b/src/org/thoughtcrime/securesms/preferences/NotificationsPreferenceFragment.java index 929a48f34..d7035a33f 100644 --- a/src/org/thoughtcrime/securesms/preferences/NotificationsPreferenceFragment.java +++ b/src/org/thoughtcrime/securesms/preferences/NotificationsPreferenceFragment.java @@ -49,6 +49,7 @@ public class NotificationsPreferenceFragment extends ListSummaryPreferenceFragme this.findPreference(Prefs.RINGTONE_PREF) .setOnPreferenceClickListener(preference -> { Uri current = Prefs.getNotificationRingtone(getContext()); + if (current.toString().isEmpty()) current = null; // silent Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER); intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true);