• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtpythonrubywindowsphpgamebathyscapheguic翻訳omegatframework計画中(planning stage)twitterdombtronvb.nettestarduinodirectxpreviewerゲームエンジン

frameworks/base


Commit MetaInfo

Revision820614a394f75ea7f82dbc63029da8dcf43cb8a4 (tree)
Time2020-11-06 08:32:38
AuthorJulia Reynolds <juliacr@goog...>
Commitersyphyr

Log Message

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)

Change Summary

Incremental Difference

--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -154,7 +154,7 @@ public class Notification implements Parcelable
154154 * <p>
155155 * Avoids spamming the system with overly large strings such as full e-mails.
156156 */
157- private static final int MAX_CHARSEQUENCE_LENGTH = 5 * 1024;
157+ private static final int MAX_CHARSEQUENCE_LENGTH = 1024;
158158
159159 /**
160160 * Maximum entries of reply text that are accepted by Builder and friends.
@@ -4973,7 +4973,7 @@ public class Notification implements Parcelable
49734973 * consistent during re-posts of the notification.
49744974 */
49754975 public Message(CharSequence text, long timestamp, CharSequence sender){
4976- mText = text;
4976+ mText = safeCharSequence(text);
49774977 mTimestamp = timestamp;
49784978 mSender = sender;
49794979 }
@@ -5055,7 +5055,7 @@ public class Notification implements Parcelable
50555055 }
50565056 bundle.putLong(KEY_TIMESTAMP, mTimestamp);
50575057 if (mSender != null) {
5058- bundle.putCharSequence(KEY_SENDER, mSender);
5058+ bundle.putCharSequence(KEY_SENDER, safeCharSequence(mSender));
50595059 }
50605060 if (mDataMimeType != null) {
50615061 bundle.putString(KEY_DATA_MIME_TYPE, mDataMimeType);