Merge "Sanitize more of the notification text fields" into rvc-dev am: ceb7aefd6f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12512483

Change-Id: Ief6065688eb49cd0d795dbd892ea9bfa76290f2b
This commit is contained in:
TreeHugger Robot
2020-09-10 00:20:15 +00:00
committed by Automerger Merge Worker

View File

@@ -207,7 +207,7 @@ public class Notification implements Parcelable
* <p> * <p>
* Avoids spamming the system with overly large strings such as full e-mails. * 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. * 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, public Message(@NonNull CharSequence text, long timestamp, @Nullable Person sender,
boolean remoteInputHistory) { boolean remoteInputHistory) {
mText = text; mText = safeCharSequence(text);
mTimestamp = timestamp; mTimestamp = timestamp;
mSender = sender; mSender = sender;
mRemoteInputHistory = remoteInputHistory; mRemoteInputHistory = remoteInputHistory;
@@ -7944,7 +7944,7 @@ public class Notification implements Parcelable
bundle.putLong(KEY_TIMESTAMP, mTimestamp); bundle.putLong(KEY_TIMESTAMP, mTimestamp);
if (mSender != null) { if (mSender != null) {
// Legacy listeners need this // Legacy listeners need this
bundle.putCharSequence(KEY_SENDER, mSender.getName()); bundle.putCharSequence(KEY_SENDER, safeCharSequence(mSender.getName()));
bundle.putParcelable(KEY_SENDER_PERSON, mSender); bundle.putParcelable(KEY_SENDER_PERSON, mSender);
} }
if (mDataMimeType != null) { if (mDataMimeType != null) {