From 5d9ec01224d123bb482d1833d5427fac5cdd2364 Mon Sep 17 00:00:00 2001 From: PhotonQyv Date: Sat, 26 Aug 2017 15:11:41 +0100 Subject: [PATCH] Cleaned up code so that Defaults are set up correctly in notifyUser() method. --- .../java/fr/gouv/etalab/mastodon/helper/Helper.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java b/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java index 72ae751ef..1e71beb5c 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java @@ -596,14 +596,11 @@ public class Helper { .setAutoCancel(true) .setContentIntent(pIntent) .setContentText(message); - if( sharedpreferences.getBoolean(Helper.SET_NOTIF_SILENT,false) ) { - notificationBuilder.setDefaults(DEFAULT_VIBRATE|FLAG_SHOW_LIGHTS); - /* My phone's LED can only do a RED colour, so someone else will need to see how - it looks, and perhaps tweak it to a nicer BLUE, or whatever colour. - Could as angryTux suggested add some sort of option for user to choose the colour, - but not really sure that wouldn't just add another extra setting for no real reason. - */ + int notifDefaults = FLAG_SHOW_LIGHTS; + notificationBuilder.setDefaults(notifDefaults); + if( sharedpreferences.getBoolean(Helper.SET_NOTIF_SILENT,false) ) { + notificationBuilder.setDefaults(notifDefaults|DEFAULT_VIBRATE); }else { String soundUri = ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + context.getPackageName() +"/"; notificationBuilder.setSound(Uri.parse(soundUri + R.raw.boop));