diff options
| author | 2013-02-12 00:44:26 +0000 | |
|---|---|---|
| committer | 2013-02-12 00:44:26 +0000 | |
| commit | 681533e0005200a3e55782f7ffe8ef516c7099c3 (patch) | |
| tree | cb3fe85241b5896cfd05c7fa93493794dffaf65f | |
| parent | 1d3079cb8d477b50d5873e571695d938a6cb4712 (diff) | |
| parent | e5b50a65ad26a32f6e58588ffdcbc0389eac9257 (diff) | |
Merge "Fix issue #8176917: Stabillity : Native Crash :"
| -rw-r--r-- | core/java/android/content/res/Resources.java | 4 | ||||
| -rw-r--r-- | core/jni/android_util_AssetManager.cpp | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java index 777529394045..24a0bb532a8a 100644 --- a/core/java/android/content/res/Resources.java +++ b/core/java/android/content/res/Resources.java @@ -792,6 +792,7 @@ public class Resources { "Resource ID #0x" + Integer.toHexString(id) + " type #0x" + Integer.toHexString(value.type) + " is not valid"); } + mTmpValue = null; } ColorStateList csl = loadColorStateList(value, id); synchronized (mAccessLock) { @@ -2227,6 +2228,9 @@ public class Resources { throws NotFoundException { synchronized (mAccessLock) { TypedValue value = mTmpValue; + if (value == null) { + mTmpValue = value = new TypedValue(); + } getValue(id, value, true); if (value.type == TypedValue.TYPE_STRING) { return loadXmlResourceParser(value.string.toString(), id, diff --git a/core/jni/android_util_AssetManager.cpp b/core/jni/android_util_AssetManager.cpp index d422951039e8..8a8b15fb9bbf 100644 --- a/core/jni/android_util_AssetManager.cpp +++ b/core/jni/android_util_AssetManager.cpp @@ -685,6 +685,10 @@ static jint android_content_AssetManager_loadResourceValue(JNIEnv* env, jobject jobject outValue, jboolean resolve) { + if (outValue == null) { + jniThrowNullPointerException(env, "outValue"); + return null; + } AssetManager* am = assetManagerForJavaObject(env, clazz); if (am == NULL) { return 0; |