Loading core/java/android/app/Notification.java +12 −0 Original line number Diff line number Diff line Loading @@ -129,6 +129,14 @@ public class Notification implements Parcelable public static final int DEFAULT_LIGHTS = 4; /** * Maximum length of CharSequences accepted by Builder and friends. * * <p> * Avoids spamming the system with overly large strings such as full e-mails. */ private static final int MAX_CHARSEQUENCE_LENGTH = 5 * 1024; /** * A timestamp related to this notification, in milliseconds since the epoch. * Loading Loading @@ -1429,6 +1437,10 @@ public class Notification implements Parcelable * @hide */ public static CharSequence safeCharSequence(CharSequence cs) { if (cs == null) return cs; if (cs.length() > MAX_CHARSEQUENCE_LENGTH) { cs = cs.subSequence(0, MAX_CHARSEQUENCE_LENGTH); } if (cs instanceof Parcelable) { Log.e(TAG, "warning: " + cs.getClass().getCanonicalName() + " instance is a custom Parcelable and not allowed in Notification"); Loading Loading
core/java/android/app/Notification.java +12 −0 Original line number Diff line number Diff line Loading @@ -129,6 +129,14 @@ public class Notification implements Parcelable public static final int DEFAULT_LIGHTS = 4; /** * Maximum length of CharSequences accepted by Builder and friends. * * <p> * Avoids spamming the system with overly large strings such as full e-mails. */ private static final int MAX_CHARSEQUENCE_LENGTH = 5 * 1024; /** * A timestamp related to this notification, in milliseconds since the epoch. * Loading Loading @@ -1429,6 +1437,10 @@ public class Notification implements Parcelable * @hide */ public static CharSequence safeCharSequence(CharSequence cs) { if (cs == null) return cs; if (cs.length() > MAX_CHARSEQUENCE_LENGTH) { cs = cs.subSequence(0, MAX_CHARSEQUENCE_LENGTH); } if (cs instanceof Parcelable) { Log.e(TAG, "warning: " + cs.getClass().getCanonicalName() + " instance is a custom Parcelable and not allowed in Notification"); Loading