Don't use extended notifications when privacy mode is enabled

This commit is contained in:
cketti 2013-06-17 16:26:49 +02:00
parent 08e249a2e9
commit 2789e9fa38
1 changed files with 6 additions and 9 deletions

View File

@ -4822,15 +4822,12 @@ public class MessagingController implements Runnable {
final CharSequence subject = getMessageSubject(context, message);
CharSequence summary = buildMessageSummary(context, sender, subject);
// If privacy mode active and keyguard active
// OR
// GlobalPreference is ALWAYS hide subject
// OR
// If we could not set a per-message notification, revert to a default message
if ((K9.getNotificationHideSubject() == NotificationHideSubject.WHEN_LOCKED &&
keyguardService.inKeyguardRestrictedInputMode()) ||
boolean privacyModeEnabled =
(K9.getNotificationHideSubject() == NotificationHideSubject.ALWAYS) ||
summary.length() == 0) {
(K9.getNotificationHideSubject() == NotificationHideSubject.WHEN_LOCKED &&
keyguardService.inKeyguardRestrictedInputMode());
if (privacyModeEnabled || summary.length() == 0) {
summary = context.getString(R.string.notification_new_title);
}
@ -4855,7 +4852,7 @@ public class MessagingController implements Runnable {
account.getDescription() : account.getEmail();
final ArrayList<MessageReference> allRefs = data.getAllMessageRefs();
if (platformSupportsExtendedNotifications()) {
if (platformSupportsExtendedNotifications() && !privacyModeEnabled) {
if (newMessages > 1) {
// multiple messages pending, show inbox style
NotificationCompat.InboxStyle style = new NotificationCompat.InboxStyle(builder);