From 020454af875e5ce5be64e42dde5e8feeb66bb16e Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 29 Dec 2019 17:00:03 +0100 Subject: [PATCH] Allow silent sound on older Android versions --- .../eu/faircode/email/FragmentOptionsNotifications.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsNotifications.java b/app/src/main/java/eu/faircode/email/FragmentOptionsNotifications.java index 915f65643d..5e877e4a47 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsNotifications.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsNotifications.java @@ -311,7 +311,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION); intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, getString(R.string.title_advanced_sound)); intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true); - intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, false); + intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, true); intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, sound == null ? null : Uri.parse(sound)); startActivityForResult(Helper.getChooser(getContext(), intent), ActivitySetup.REQUEST_SOUND); } @@ -333,7 +333,9 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared tvNoChannels.setVisibility(Build.VERSION.SDK_INT < Build.VERSION_CODES.O ? View.VISIBLE : View.GONE); grpChannel.setVisibility(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ? View.VISIBLE : View.GONE); - grpNotification.setVisibility(Build.VERSION.SDK_INT < Build.VERSION_CODES.O ? View.VISIBLE : View.GONE); + grpNotification.setVisibility( + Build.VERSION.SDK_INT < Build.VERSION_CODES.O || BuildConfig.DEBUG + ? View.VISIBLE : View.GONE); PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this);