diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/impl/GBDeviceService.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/impl/GBDeviceService.java index 2c707cbbd..80c6db28d 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/impl/GBDeviceService.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/impl/GBDeviceService.java @@ -162,9 +162,10 @@ public class GBDeviceService implements DeviceService { @Override public void onNotification(NotificationSpec notificationSpec) { - boolean hideMessageDetails = GBApplication.getPrefs().getString("pref_message_privacy_mode", - GBApplication.getContext().getString(R.string.p_message_privacy_mode_off)) - .equals(GBApplication.getContext().getString(R.string.p_message_privacy_mode_complete)); + String messagePrivacyMode = GBApplication.getPrefs().getString("pref_message_privacy_mode", + GBApplication.getContext().getString(R.string.p_message_privacy_mode_off)); + boolean hideMessageDetails = messagePrivacyMode.equals(GBApplication.getContext().getString(R.string.p_message_privacy_mode_complete)); + boolean hideMessageBodyOnly = messagePrivacyMode.equals(GBApplication.getContext().getString(R.string.p_message_privacy_mode_bodyonly)); Intent intent = createIntent().setAction(ACTION_NOTIFICATION) .putExtra(EXTRA_NOTIFICATION_FLAGS, notificationSpec.flags) @@ -172,7 +173,7 @@ public class GBDeviceService implements DeviceService { .putExtra(EXTRA_NOTIFICATION_SENDER, hideMessageDetails ? null : coalesce(notificationSpec.sender, getContactDisplayNameByNumber(notificationSpec.phoneNumber))) .putExtra(EXTRA_NOTIFICATION_SUBJECT, hideMessageDetails ? null : notificationSpec.subject) .putExtra(EXTRA_NOTIFICATION_TITLE, hideMessageDetails ? null : notificationSpec.title) - .putExtra(EXTRA_NOTIFICATION_BODY, hideMessageDetails ? null : notificationSpec.body) + .putExtra(EXTRA_NOTIFICATION_BODY, hideMessageDetails || hideMessageBodyOnly ? null : notificationSpec.body) .putExtra(EXTRA_NOTIFICATION_ID, notificationSpec.getId()) .putExtra(EXTRA_NOTIFICATION_TYPE, notificationSpec.type) .putExtra(EXTRA_NOTIFICATION_ACTIONS, notificationSpec.attachedActions) diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 3fb277a00..e345a3f9e 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -2062,11 +2062,13 @@ @string/pref_message_privacy_mode_off @string/pref_message_privacy_mode_complete + @string/pref_message_privacy_mode_bodyonly @string/p_message_privacy_mode_off @string/p_message_privacy_mode_complete + @string/p_message_privacy_mode_bodyonly diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a8314b1a4..49c5aa3a7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -293,8 +293,9 @@ Hide number but display name Hide name and number Message privacy mode - Display content - Hide content + Display all content + Hide all content + Hide only body Weather Weather location (for LineageOS weather provider) Used for the LineageOS weather provider, other Android versions need to use an app like \"Weather notification\". Find more information in the Gadgetbridge wiki. diff --git a/app/src/main/res/values/values.xml b/app/src/main/res/values/values.xml index d94ff91eb..0ef16367a 100644 --- a/app/src/main/res/values/values.xml +++ b/app/src/main/res/values/values.xml @@ -108,6 +108,7 @@ off complete + bodyonly UNKNOWN PLAY