diff options
author | Julia Reynolds <juliacr@google.com> | 2020-08-26 17:07:53 -0400 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-09-30 00:06:02 +0000 |
commit | 6d3a134a634470c08ab3bd38f4aa1a276594d0a6 (patch) | |
tree | cf2312c2ac6ffad878ddc0df625ba328757d6067 | |
parent | 4cf2d7c35c5e0195c99790532c2abad782c4a318 (diff) | |
download | base-6d3a134a634470c08ab3bd38f4aa1a276594d0a6.tar.gz |
Sanitize more of the notification text fields
Test: manual; monitor SystemUI performance when an app tries to
post a messaging style notification with messages with long text
Bug: 158304295
Bug: 147358092
Merged-In: c953fdf6bc498ca791aed49df04e5a07c935b63a
Change-Id: I0e2ea12fc3351b1a56645b556720ea2306f5422a
(cherry picked from commit c953fdf6bc498ca791aed49df04e5a07c935b63a)
(cherry picked from commit a19f9ed2b1c04fe7e73bab1a8ca51400dbf8a07a)
-rw-r--r-- | core/java/android/app/Notification.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index 79d2a8102358..609083e719ba 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -207,7 +207,7 @@ public class Notification implements Parcelable * <p> * Avoids spamming the system with overly large strings such as full e-mails. */ - private static final int MAX_CHARSEQUENCE_LENGTH = 5 * 1024; + private static final int MAX_CHARSEQUENCE_LENGTH = 1024; /** * Maximum entries of reply text that are accepted by Builder and friends. @@ -7830,7 +7830,7 @@ public class Notification implements Parcelable */ public Message(@NonNull CharSequence text, long timestamp, @Nullable Person sender, boolean remoteInputHistory) { - mText = text; + mText = safeCharSequence(text); mTimestamp = timestamp; mSender = sender; mRemoteInputHistory = remoteInputHistory; @@ -7944,7 +7944,7 @@ public class Notification implements Parcelable bundle.putLong(KEY_TIMESTAMP, mTimestamp); if (mSender != null) { // Legacy listeners need this - bundle.putCharSequence(KEY_SENDER, mSender.getName()); + bundle.putCharSequence(KEY_SENDER, safeCharSequence(mSender.getName())); bundle.putParcelable(KEY_SENDER_PERSON, mSender); } if (mDataMimeType != null) { |