summaryrefslogtreecommitdiffstats
path: root/core/java/android/preference/GenericInflater.java
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2015-05-04 10:32:57 -0700
committerAlan Viverette <alanv@google.com>2015-05-04 10:32:57 -0700
commit904de2ec9360de2ee54b91aaf9e141d9d8ab1de1 (patch)
treee28ae68b8b33ecb3a2e16e4024f3e3989114023c /core/java/android/preference/GenericInflater.java
parent5551aca2b8ec9fe7ab5ffda8dad82ee104556962 (diff)
downloadframeworks_base-904de2ec9360de2ee54b91aaf9e141d9d8ab1de1.zip
frameworks_base-904de2ec9360de2ee54b91aaf9e141d9d8ab1de1.tar.gz
frameworks_base-904de2ec9360de2ee54b91aaf9e141d9d8ab1de1.tar.bz2
Always force constructors accessible during inflation
We now correctly throw an IllegalAccessException for non-public accesses, but we were relying on the old incorrect behavior during inflation. This CL forces constructors to be accessible so that we emulate the old behavior and don't crash. Where we were already doing this, the CL moves the setAccessible() call immediately after the getConstructor() call, since there's no point in calling it multiple times. Bug: 20810495 Change-Id: I63dfcb857e445f688080eea05e86ef22760ed49f
Diffstat (limited to 'core/java/android/preference/GenericInflater.java')
-rw-r--r--core/java/android/preference/GenericInflater.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/java/android/preference/GenericInflater.java b/core/java/android/preference/GenericInflater.java
index 918933b..3319e64 100644
--- a/core/java/android/preference/GenericInflater.java
+++ b/core/java/android/preference/GenericInflater.java
@@ -376,6 +376,7 @@ abstract class GenericInflater<T, P extends GenericInflater.Parent> {
Class clazz = mContext.getClassLoader().loadClass(
prefix != null ? (prefix + name) : name);
constructor = clazz.getConstructor(mConstructorSignature);
+ constructor.setAccessible(true);
sConstructorMap.put(name, constructor);
}