diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java index feb4dd9b..4744b09b 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java @@ -78,7 +78,7 @@ public class NotificationListener extends NotificationListenerService { } if (source.equals("eu.siacs.conversations")) { - if (!"never".equals(sharedPrefs.getString("notification_mode_pebblemsg", "never"))) { + if (!"never".equals(sharedPrefs.getString("notification_mode_pebblemsg", "when_screen_off"))) { return; } } @@ -88,18 +88,14 @@ public class NotificationListener extends NotificationListenerService { Bundle extras = notification.extras; String title = extras.getCharSequence(Notification.EXTRA_TITLE).toString(); String content = null; - if (extras.containsKey(Notification.EXTRA_TEXT)) - - { + if (extras.containsKey(Notification.EXTRA_TEXT)) { CharSequence contentCS = extras.getCharSequence(Notification.EXTRA_TEXT); if (contentCS != null) { content = contentCS.toString(); } } - if (content != null) - - { + if (content != null) { Intent startIntent = new Intent(NotificationListener.this, BluetoothCommunicationService.class); startIntent.setAction(BluetoothCommunicationService.ACTION_NOTIFICATION_GENERIC); startIntent.putExtra("notification_title", title); diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/PebbleReceiver.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/PebbleReceiver.java index bedef8f6..fe45002b 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/PebbleReceiver.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/PebbleReceiver.java @@ -21,10 +21,10 @@ public class PebbleReceiver extends BroadcastReceiver { public void onReceive(Context context, Intent intent) { SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); - if ("never".equals(sharedPrefs.getString("notification_mode_pebblemsg", "never"))) { + if ("never".equals(sharedPrefs.getString("notification_mode_pebblemsg", "when_screen_off"))) { return; } - if ("when_screen_off".equals(sharedPrefs.getString("notification_mode_pebblemsg", "never"))) { + if ("when_screen_off".equals(sharedPrefs.getString("notification_mode_pebblemsg", "when_screen_off"))) { PowerManager powermanager = (PowerManager) context.getSystemService(Context.POWER_SERVICE); if (powermanager.isScreenOn()) { return; diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index f9f7ba7d..919977f2 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -36,7 +36,7 @@ android:title="@string/pref_title_notifications_k9mail" />