summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2019-04-03 13:14:39 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-04-03 13:14:39 -0700
commitcb6605192ce601c2d8772a2160e85f5051841ed2 (patch)
tree269cad0205108de6912fa0368aeede86f27724a2 /core/java/android
parentde2654be88798002f202088c9ef83efe83c304b9 (diff)
parent1b7fb8f7ae57ad5ac70f49ee5ceab2a031ceae99 (diff)
Merge "Use Class.forName instead of ClassLoader.loadClass." am: dc489aba0e
am: 1b7fb8f7ae Change-Id: I41141b6fc6934faf086ea930b19539a0daba8298
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/view/LayoutInflater.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/java/android/view/LayoutInflater.java b/core/java/android/view/LayoutInflater.java
index 2ee72bffc9ec..ae2deb97c756 100644
--- a/core/java/android/view/LayoutInflater.java
+++ b/core/java/android/view/LayoutInflater.java
@@ -512,7 +512,7 @@ public abstract class LayoutInflater {
String layout = res.getResourceEntryName(resource);
try {
- Class clazz = mPrecompiledClassLoader.loadClass("" + pkg + ".CompiledView");
+ Class clazz = Class.forName("" + pkg + ".CompiledView", false, mPrecompiledClassLoader);
Method inflater = clazz.getMethod(layout, Context.class, int.class);
View view = (View) inflater.invoke(null, mContext, resource);
@@ -731,8 +731,8 @@ public abstract class LayoutInflater {
if (constructor == null) {
// Class not found in the cache, see if it's real, and try to add it
- clazz = mContext.getClassLoader().loadClass(
- prefix != null ? (prefix + name) : name).asSubclass(View.class);
+ clazz = Class.forName(prefix != null ? (prefix + name) : name, false,
+ mContext.getClassLoader()).asSubclass(View.class);
if (mFilter != null && clazz != null) {
boolean allowed = mFilter.onLoadClass(clazz);
@@ -750,8 +750,8 @@ public abstract class LayoutInflater {
Boolean allowedState = mFilterMap.get(name);
if (allowedState == null) {
// New class -- remember whether it is allowed
- clazz = mContext.getClassLoader().loadClass(
- prefix != null ? (prefix + name) : name).asSubclass(View.class);
+ clazz = Class.forName(prefix != null ? (prefix + name) : name, false,
+ mContext.getClassLoader()).asSubclass(View.class);
boolean allowed = clazz != null && mFilter.onLoadClass(clazz);
mFilterMap.put(name, allowed);