From 70cfefa01ab7446120c11fbf23cc7fe21e71ac28 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 15 Mar 2017 13:01:53 -0700 Subject: 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.(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 --- core/java/android/os/SystemProperties.java | 6 ++++++ 1 file changed, 6 insertions(+) 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 sChangeCallbacks = new ArrayList(); -- cgit v1.2.3-59-g8ed1b