summaryrefslogtreecommitdiff
path: root/core/java/android/os/SystemProperties.java
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2017-03-15 13:01:53 -0700
committerElliott Hughes <enh@google.com>2017-03-15 13:01:53 -0700
commit70cfefa01ab7446120c11fbf23cc7fe21e71ac28 (patch)
tree5c3f4f87ade02471a157a6e78aa3424be30764ff /core/java/android/os/SystemProperties.java
parent40aa5ee583c3948e1ac67b0afff71f899d131414 (diff)
Restore SystemProperties.PROP_NAME_MAX to keep Kindle running.
The limit has been lifted in O, but without this constant, Kindle crashes here: Caused by: java.lang.NoSuchFieldException: PROP_NAME_MAX at java.lang.Class.getField(Class.java:1607) at com.amazon.android.webkit.AmazonWebKitFactories$Implementation.<clinit>(AmazonWebKitFactories.java:59) The code seems to want to truncate a system property name to avoid the exception that SystemProperty.get threw if passed a name that was too long. Bug: http://b/36095274 Test: select a word in Kindle Change-Id: Id1881a8a7c6386400a1024beb0d1b741bdaefba7
Diffstat (limited to 'core/java/android/os/SystemProperties.java')
-rw-r--r--core/java/android/os/SystemProperties.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/java/android/os/SystemProperties.java b/core/java/android/os/SystemProperties.java
index 2bf3c2c7b489..c52091779126 100644
--- a/core/java/android/os/SystemProperties.java
+++ b/core/java/android/os/SystemProperties.java
@@ -35,6 +35,12 @@ public class SystemProperties {
private static final String TAG = "SystemProperties";
private static final boolean TRACK_KEY_ACCESS = false;
+ /**
+ * Android O removed the property name length limit, but com.amazon.kindle 7.8.1.5
+ * uses reflection to read this whenever text is selected (http://b/36095274).
+ */
+ public static final int PROP_NAME_MAX = Integer.MAX_VALUE;
+
public static final int PROP_VALUE_MAX = 91;
private static final ArrayList<Runnable> sChangeCallbacks = new ArrayList<Runnable>();