From 38a77c404807426661d0ab878ade7afc3bad3c0e Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Wed, 18 Oct 2017 09:25:17 -0700 Subject: [PATCH] Allow ro. properties to have arbitrary lengths Bug: 23102347 Bug: 34954705 Test: build Change-Id: I99b074633c60e95cdd2284bf8a708b9187c1e310 --- core/java/android/os/SystemProperties.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/android/os/SystemProperties.java b/core/java/android/os/SystemProperties.java index 84111fbf7f936..4f6d322ba8710 100644 --- a/core/java/android/os/SystemProperties.java +++ b/core/java/android/os/SystemProperties.java @@ -157,7 +157,7 @@ public class SystemProperties { * @throws IllegalArgumentException if the {@code val} exceeds 91 characters */ public static void set(@NonNull String key, @Nullable String val) { - if (val != null && val.length() > PROP_VALUE_MAX) { + if (val != null && !val.startsWith("ro.") && val.length() > PROP_VALUE_MAX) { throw new IllegalArgumentException("value of system property '" + key + "' is longer than " + PROP_VALUE_MAX + " characters: " + val); }