am d38d3574: Merge "Always force constructors accessible during inflation" into mnc-dev
* commit 'd38d3574d0b1905d41891c2d7f89892ab13803ae': Always force constructors accessible during inflation
This commit is contained in:
@@ -2095,6 +2095,7 @@ public class Notification implements Parcelable
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Constructor<? extends Style> constructor = styleClass.getConstructor();
|
Constructor<? extends Style> constructor = styleClass.getConstructor();
|
||||||
|
constructor.setAccessible(true);
|
||||||
style = constructor.newInstance();
|
style = constructor.newInstance();
|
||||||
style.restoreFromExtras(extras);
|
style.restoreFromExtras(extras);
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
|
|||||||
@@ -376,6 +376,7 @@ abstract class GenericInflater<T, P extends GenericInflater.Parent> {
|
|||||||
Class clazz = mContext.getClassLoader().loadClass(
|
Class clazz = mContext.getClassLoader().loadClass(
|
||||||
prefix != null ? (prefix + name) : name);
|
prefix != null ? (prefix + name) : name);
|
||||||
constructor = clazz.getConstructor(mConstructorSignature);
|
constructor = clazz.getConstructor(mConstructorSignature);
|
||||||
|
constructor.setAccessible(true);
|
||||||
sConstructorMap.put(name, constructor);
|
sConstructorMap.put(name, constructor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -211,10 +211,10 @@ public class TransitionInflater {
|
|||||||
.asSubclass(expectedType);
|
.asSubclass(expectedType);
|
||||||
if (c != null) {
|
if (c != null) {
|
||||||
constructor = c.getConstructor(sConstructorSignature);
|
constructor = c.getConstructor(sConstructorSignature);
|
||||||
|
constructor.setAccessible(true);
|
||||||
sConstructors.put(className, constructor);
|
sConstructors.put(className, constructor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
constructor.setAccessible(true);
|
|
||||||
return constructor.newInstance(mContext, attrs);
|
return constructor.newInstance(mContext, attrs);
|
||||||
}
|
}
|
||||||
} catch (InstantiationException e) {
|
} catch (InstantiationException e) {
|
||||||
|
|||||||
@@ -590,6 +590,7 @@ public abstract class LayoutInflater {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
constructor = clazz.getConstructor(mConstructorSignature);
|
constructor = clazz.getConstructor(mConstructorSignature);
|
||||||
|
constructor.setAccessible(true);
|
||||||
sConstructorMap.put(name, constructor);
|
sConstructorMap.put(name, constructor);
|
||||||
} else {
|
} else {
|
||||||
// If we have a filter, apply it to cached constructor
|
// If we have a filter, apply it to cached constructor
|
||||||
@@ -615,7 +616,6 @@ public abstract class LayoutInflater {
|
|||||||
Object[] args = mConstructorArgs;
|
Object[] args = mConstructorArgs;
|
||||||
args[1] = attrs;
|
args[1] = attrs;
|
||||||
|
|
||||||
constructor.setAccessible(true);
|
|
||||||
final View view = constructor.newInstance(args);
|
final View view = constructor.newInstance(args);
|
||||||
if (view instanceof ViewStub) {
|
if (view instanceof ViewStub) {
|
||||||
// Use the same context when inflating ViewStub later.
|
// Use the same context when inflating ViewStub later.
|
||||||
|
|||||||
@@ -544,6 +544,7 @@ public class MenuInflater {
|
|||||||
try {
|
try {
|
||||||
Class<?> clazz = mContext.getClassLoader().loadClass(className);
|
Class<?> clazz = mContext.getClassLoader().loadClass(className);
|
||||||
Constructor<?> constructor = clazz.getConstructor(constructorSignature);
|
Constructor<?> constructor = clazz.getConstructor(constructorSignature);
|
||||||
|
constructor.setAccessible(true);
|
||||||
return (T) constructor.newInstance(arguments);
|
return (T) constructor.newInstance(arguments);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.w(LOG_TAG, "Cannot instantiate class: " + className, e);
|
Log.w(LOG_TAG, "Cannot instantiate class: " + className, e);
|
||||||
|
|||||||
Reference in New Issue
Block a user