summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulia Reynolds <juliacr@google.com>2020-08-26 17:07:53 -0400
committerAnis Assi <anisassi@google.com>2020-09-10 13:50:36 -0700
commit37b9257170579a5d3837f4c7f96b5f7b265dfc21 (patch)
tree145b0fda87e3d503390cd9358bcfd4890b5f13ac
parent40c90b472458cee6f33723afb2837cf01ce44633 (diff)
downloadbase-37b9257170579a5d3837f4c7f96b5f7b265dfc21.tar.gz
DO NOT MERGE Sanitize more of the notification text fieldsandroid-security-8.0.0_r52
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 db023fcd738bb054402b771e5de5d758db526e30)
-rw-r--r--core/java/android/app/Notification.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 4dd71b49b974..21c21315b606 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -183,7 +183,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.
@@ -6086,7 +6086,7 @@ public class Notification implements Parcelable
* consistent during re-posts of the notification.
*/
public Message(CharSequence text, long timestamp, CharSequence sender){
- mText = text;
+ mText = safeCharSequence(text);
mTimestamp = timestamp;
mSender = sender;
}
@@ -6175,7 +6175,7 @@ public class Notification implements Parcelable
}
bundle.putLong(KEY_TIMESTAMP, mTimestamp);
if (mSender != null) {
- bundle.putCharSequence(KEY_SENDER, mSender);
+ bundle.putCharSequence(KEY_SENDER, safeCharSequence(mSender));
}
if (mDataMimeType != null) {
bundle.putString(KEY_DATA_MIME_TYPE, mDataMimeType);