summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2015-05-04 19:38:56 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-05-04 19:38:57 +0000
commitd38d3574d0b1905d41891c2d7f89892ab13803ae (patch)
tree282b5ef5a0e2a73207e58ed5445cbdce4ec22b5b
parentad2399f3be4861d0f5acf072460d98fafc951c57 (diff)
parent904de2ec9360de2ee54b91aaf9e141d9d8ab1de1 (diff)
downloadframeworks_base-d38d3574d0b1905d41891c2d7f89892ab13803ae.zip
frameworks_base-d38d3574d0b1905d41891c2d7f89892ab13803ae.tar.gz
frameworks_base-d38d3574d0b1905d41891c2d7f89892ab13803ae.tar.bz2
Merge "Always force constructors accessible during inflation" into mnc-dev
-rw-r--r--core/java/android/app/Notification.java1
-rw-r--r--core/java/android/preference/GenericInflater.java1
-rw-r--r--core/java/android/transition/TransitionInflater.java2
-rw-r--r--core/java/android/view/LayoutInflater.java2
-rw-r--r--core/java/android/view/MenuInflater.java1
5 files changed, 5 insertions, 2 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index ff589f9..49b2549 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -2095,6 +2095,7 @@ public class Notification implements Parcelable
try {
Constructor<? extends Style> constructor = styleClass.getConstructor();
+ constructor.setAccessible(true);
style = constructor.newInstance();
style.restoreFromExtras(extras);
} catch (Throwable t) {
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);
}
diff --git a/core/java/android/transition/TransitionInflater.java b/core/java/android/transition/TransitionInflater.java
index ca37d49..cbf76bc 100644
--- a/core/java/android/transition/TransitionInflater.java
+++ b/core/java/android/transition/TransitionInflater.java
@@ -211,10 +211,10 @@ public class TransitionInflater {
.asSubclass(expectedType);
if (c != null) {
constructor = c.getConstructor(sConstructorSignature);
+ constructor.setAccessible(true);
sConstructors.put(className, constructor);
}
}
- constructor.setAccessible(true);
return constructor.newInstance(mContext, attrs);
}
} catch (InstantiationException e) {
diff --git a/core/java/android/view/LayoutInflater.java b/core/java/android/view/LayoutInflater.java
index 1503728..37312d0 100644
--- a/core/java/android/view/LayoutInflater.java
+++ b/core/java/android/view/LayoutInflater.java
@@ -590,6 +590,7 @@ public abstract class LayoutInflater {
}
}
constructor = clazz.getConstructor(mConstructorSignature);
+ constructor.setAccessible(true);
sConstructorMap.put(name, constructor);
} else {
// If we have a filter, apply it to cached constructor
@@ -615,7 +616,6 @@ public abstract class LayoutInflater {
Object[] args = mConstructorArgs;
args[1] = attrs;
- constructor.setAccessible(true);
final View view = constructor.newInstance(args);
if (view instanceof ViewStub) {
// Use the same context when inflating ViewStub later.
diff --git a/core/java/android/view/MenuInflater.java b/core/java/android/view/MenuInflater.java
index b49a59e..dc8cadf 100644
--- a/core/java/android/view/MenuInflater.java
+++ b/core/java/android/view/MenuInflater.java
@@ -544,6 +544,7 @@ public class MenuInflater {
try {
Class<?> clazz = mContext.getClassLoader().loadClass(className);
Constructor<?> constructor = clazz.getConstructor(constructorSignature);
+ constructor.setAccessible(true);
return (T) constructor.newInstance(arguments);
} catch (Exception e) {
Log.w(LOG_TAG, "Cannot instantiate class: " + className, e);