summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author John Reck <jreck@google.com> 2019-02-07 18:30:39 +0000
committer John Reck <jreck@google.com> 2019-02-07 18:31:50 +0000
commitf8c0d70f3ecfb87bf4e109e34c836932afe59f64 (patch)
tree303aa78e6cc4316da3918aabce0c4417c191546c
parent86076a7cbecbfd3abc6eb354ee3c78aff42d6bcf (diff)
Revert "Add view inflation device config property"
This reverts commit 86076a7cbecbfd3abc6eb354ee3c78aff42d6bcf. Reason for revert: Requires apps to have READ_DEVICE_CONFIG permission which they cannot possibly get. Also breaks instant apps (which don't have & can't get that permission) Bug: 123524494 Test: CtsAccelerationTestCases[instant] passes. Change-Id: I789a2c9007780331c510802a9f807cc24174be2d
-rw-r--r--api/system-current.txt5
-rw-r--r--core/java/android/provider/DeviceConfig.java15
-rw-r--r--core/java/android/view/LayoutInflater.java24
3 files changed, 6 insertions, 38 deletions
diff --git a/api/system-current.txt b/api/system-current.txt
index 98159adcd45d..bf3c0a2716eb 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -5763,11 +5763,6 @@ package android.provider {
field public static final String PROPERTY_PERMISSIONS_HUB_ENABLED = "permissions_hub_enabled";
}
- public static interface DeviceConfig.Runtime {
- field public static final String NAMESPACE = "runtime";
- field public static final String USE_PRECOMPILED_LAYOUT = "view.precompiled_layout_enabled";
- }
-
public static interface DeviceConfig.RuntimeNative {
field public static final String NAMESPACE = "runtime_native";
}
diff --git a/core/java/android/provider/DeviceConfig.java b/core/java/android/provider/DeviceConfig.java
index ab5314639fc5..92650e114a66 100644
--- a/core/java/android/provider/DeviceConfig.java
+++ b/core/java/android/provider/DeviceConfig.java
@@ -150,21 +150,6 @@ public final class DeviceConfig {
}
/**
- * Namespace for all runtime related features.
- *
- * @hide
- */
- @SystemApi
- public interface Runtime {
- String NAMESPACE = "runtime";
-
- /**
- * Whether or not we use the precompiled layout.
- */
- String USE_PRECOMPILED_LAYOUT = "view.precompiled_layout_enabled";
- }
-
- /**
* Namespace for all runtime native related features.
*
* @hide
diff --git a/core/java/android/view/LayoutInflater.java b/core/java/android/view/LayoutInflater.java
index c1302503134e..6a290b7fe045 100644
--- a/core/java/android/view/LayoutInflater.java
+++ b/core/java/android/view/LayoutInflater.java
@@ -33,8 +33,6 @@ import android.os.Handler;
import android.os.Message;
import android.os.SystemProperties;
import android.os.Trace;
-import android.provider.DeviceConfig;
-import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.util.TypedValue;
@@ -44,14 +42,13 @@ import android.widget.FrameLayout;
import com.android.internal.R;
import dalvik.system.PathClassLoader;
-
+import java.io.File;
+import java.lang.reflect.Method;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
-import java.io.File;
import java.io.IOException;
import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
import java.util.HashMap;
/**
@@ -81,6 +78,8 @@ public abstract class LayoutInflater {
private static final String TAG = LayoutInflater.class.getSimpleName();
private static final boolean DEBUG = false;
+ private static final String USE_PRECOMPILED_LAYOUT_SYSTEM_PROPERTY
+ = "view.precompiled_layout_enabled";
private static final String COMPILED_VIEW_DEX_FILE_NAME = "/compiled_view.dex";
/** Empty stack trace used to avoid log spam in re-throw exceptions. */
@@ -401,19 +400,8 @@ public abstract class LayoutInflater {
}
private void initPrecompiledViews() {
- // Use the device config if enabled, otherwise default to the system property.
- String usePrecompiledLayout = DeviceConfig.getProperty(
- DeviceConfig.Runtime.NAMESPACE,
- DeviceConfig.Runtime.USE_PRECOMPILED_LAYOUT);
- boolean enabled = false;
- if (TextUtils.isEmpty(usePrecompiledLayout)) {
- enabled = SystemProperties.getBoolean(
- DeviceConfig.Runtime.USE_PRECOMPILED_LAYOUT,
- false);
- } else {
- enabled = Boolean.parseBoolean(usePrecompiledLayout);
- }
- initPrecompiledViews(enabled);
+ initPrecompiledViews(
+ SystemProperties.getBoolean(USE_PRECOMPILED_LAYOUT_SYSTEM_PROPERTY, false));
}
private void initPrecompiledViews(boolean enablePrecompiledViews) {