Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 820614a3 authored by Julia Reynolds's avatar Julia Reynolds Committed by syphyr
Browse files

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: c953fdf6
Change-Id: I0e2ea12fc3351b1a56645b556720ea2306f5422a
(cherry picked from commit c953fdf6)
(cherry picked from commit a19f9ed2)
parent 10c01c2f
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -154,7 +154,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.
@@ -4973,7 +4973,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;
            }
@@ -5055,7 +5055,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);