From 5bb1995eb9c176edf19fe289dba67d08da86bb95 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Thu, 9 Feb 2017 17:10:39 +0100 Subject: [PATCH] Pebble: fix privacy mode title being "null" in some cases --- .../service/devices/pebble/PebbleSupport.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleSupport.java index d4afb684..6140b24c 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/pebble/PebbleSupport.java @@ -122,7 +122,13 @@ public class PebbleSupport extends AbstractSerialDeviceSupport { notificationSpec.title = null; notificationSpec.phoneNumber = null; } else if (getContext().getString(R.string.p_pebble_privacy_mode_content).equals(currentPrivacyMode)) { - notificationSpec.sender = "\n\n\n\n\n" + notificationSpec.sender; + if (notificationSpec.sender != null) {if (notificationSpec.sender != null) { + notificationSpec.sender = "\n\n\n\n\n" + notificationSpec.sender; + } else if (notificationSpec.title != null) { + notificationSpec.title = "\n\n\n\n\n" + notificationSpec.title; + } else if (notificationSpec.subject != null) { + notificationSpec.subject = "\n\n\n\n\n" + notificationSpec.subject; + } } if (reconnect()) { super.onNotification(notificationSpec);