mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-25 06:49:35 +00:00
Fix notification ringtone problems
Default ringtone was often showing up as a call tone Silent wasn't working correctly globally
This commit is contained in:
@@ -45,11 +45,11 @@ public abstract class AbstractNotificationBuilder extends NotificationCompat.Bui
|
||||
}
|
||||
|
||||
public void setAlarms(@Nullable Uri ringtone, RecipientDatabase.VibrateState vibrate) {
|
||||
String defaultRingtoneName = TextSecurePreferences.getNotificationRingtone(context);
|
||||
boolean defaultVibrate = TextSecurePreferences.isNotificationVibrateEnabled(context);
|
||||
Uri defaultRingtone = TextSecurePreferences.getNotificationRingtone(context);
|
||||
boolean defaultVibrate = TextSecurePreferences.isNotificationVibrateEnabled(context);
|
||||
|
||||
if (ringtone == null && !TextUtils.isEmpty(defaultRingtoneName)) setSound(Uri.parse(defaultRingtoneName));
|
||||
else if (ringtone != null && !ringtone.toString().isEmpty()) setSound(ringtone);
|
||||
if (ringtone == null && !TextUtils.isEmpty(defaultRingtone.toString())) setSound(defaultRingtone);
|
||||
else if (ringtone != null && !ringtone.toString().isEmpty()) setSound(ringtone);
|
||||
|
||||
if (vibrate == RecipientDatabase.VibrateState.ENABLED ||
|
||||
(vibrate == RecipientDatabase.VibrateState.DEFAULT && defaultVibrate))
|
||||
|
||||
@@ -384,19 +384,7 @@ public class MessageNotifier {
|
||||
Uri uri = recipient != null ? recipient.getRingtone() : null;
|
||||
|
||||
if (uri == null) {
|
||||
String ringtone = TextSecurePreferences.getNotificationRingtone(context);
|
||||
|
||||
if (ringtone == null) {
|
||||
Log.w(TAG, "ringtone preference was null.");
|
||||
return;
|
||||
}
|
||||
|
||||
uri = Uri.parse(ringtone);
|
||||
|
||||
if (uri == null) {
|
||||
Log.w(TAG, "couldn't parse ringtone uri " + ringtone);
|
||||
return;
|
||||
}
|
||||
uri = TextSecurePreferences.getNotificationRingtone(context);
|
||||
}
|
||||
|
||||
if (uri.toString().isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user