From 44bb2c7c72c54e0bbcd7b044bfa0b41b0bf7669f Mon Sep 17 00:00:00 2001 From: Christian Ascheberg Date: Thu, 23 Feb 2017 17:28:34 +0100 Subject: [PATCH] Do not call Notification.setSound with empty ringtone Closes #6293 // FREEBIE --- .../securesms/notifications/AbstractNotificationBuilder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/thoughtcrime/securesms/notifications/AbstractNotificationBuilder.java b/src/org/thoughtcrime/securesms/notifications/AbstractNotificationBuilder.java index 946430b78f..d37efc507c 100644 --- a/src/org/thoughtcrime/securesms/notifications/AbstractNotificationBuilder.java +++ b/src/org/thoughtcrime/securesms/notifications/AbstractNotificationBuilder.java @@ -44,8 +44,8 @@ public abstract class AbstractNotificationBuilder extends NotificationCompat.Bui String defaultRingtoneName = TextSecurePreferences.getNotificationRingtone(context); boolean defaultVibrate = TextSecurePreferences.isNotificationVibrateEnabled(context); - if (ringtone != null) setSound(ringtone); - else if (!TextUtils.isEmpty(defaultRingtoneName)) setSound(Uri.parse(defaultRingtoneName)); + if (ringtone == null && !TextUtils.isEmpty(defaultRingtoneName)) setSound(Uri.parse(defaultRingtoneName)); + else if (ringtone != null && !ringtone.toString().isEmpty()) setSound(ringtone); if (vibrate == RecipientPreferenceDatabase.VibrateState.ENABLED || (vibrate == RecipientPreferenceDatabase.VibrateState.DEFAULT && defaultVibrate))