diff options
author | Taesu Lee <taesu82.lee@samsung.com> | 2020-05-08 17:42:27 +0900 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2020-05-24 20:13:50 +0300 |
commit | 398ad51836825699c01e13c1d6077ee80d904dba (patch) | |
tree | 560735515f8036d471deaafe89d2abf377bd8855 | |
parent | e3485c132a6d2ebabca95dbfdc74ff5b91f64609 (diff) | |
download | android_packages_apps_Messaging-398ad51836825699c01e13c1d6077ee80d904dba.tar.gz android_packages_apps_Messaging-398ad51836825699c01e13c1d6077ee80d904dba.tar.bz2 android_packages_apps_Messaging-398ad51836825699c01e13c1d6077ee80d904dba.zip |
Fix NPE on MultiConversationNotificationState
Use the most recent notification's state to print out log because
mContent is null in case of a notification for multiple messages in at
least 2 different conversations.
And no need sanitizePII() since this log is only for VERBOSE already.
Test: 1) adb shell setprop log.tag.MessagingAppNotif VERBOSE
2) Receive SMS from different senders
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Change-Id: Ie300620f0014577ca65b9a7e3a4c397a39717992
-rw-r--r-- | src/com/android/messaging/datamodel/MessageNotificationState.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/com/android/messaging/datamodel/MessageNotificationState.java b/src/com/android/messaging/datamodel/MessageNotificationState.java index 53c6aeb..7555d97 100644 --- a/src/com/android/messaging/datamodel/MessageNotificationState.java +++ b/src/com/android/messaging/datamodel/MessageNotificationState.java @@ -100,7 +100,6 @@ public abstract class MessageNotificationState extends NotificationState { protected CharSequence mContent = null; protected Uri mAttachmentUri = null; protected String mAttachmentType = null; - protected boolean mTickerNoContent; @Override protected Uri getAttachmentUri() { @@ -1066,8 +1065,10 @@ public abstract class MessageNotificationState extends NotificationState { } if (state != null && LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) { LogUtil.v(TAG, "MessageNotificationState: Notification state created" - + ", title = " + LogUtil.sanitizePII(state.mTitle) - + ", content = " + LogUtil.sanitizePII(state.mContent.toString())); + + ", title = " + + (state.mTickerSender != null ? state.mTickerSender : state.mTitle) + + ", content = " + + (state.mTickerText != null ? state.mTickerText : state.mContent)); } return state; } @@ -1091,8 +1092,9 @@ public abstract class MessageNotificationState extends NotificationState { protected CharSequence getTicker() { return BugleNotifications.buildColonSeparatedMessage( mTickerSender != null ? mTickerSender : mTitle, - mTickerText != null ? mTickerText : (mTickerNoContent ? null : mContent), null, - null); + mTickerText != null ? mTickerText : mContent, + null, + null); } private static CharSequence convertHtmlAndStripUrls(final String s) { |