Loading core/java/android/content/res/Resources.java +14 −1 Original line number Diff line number Diff line Loading @@ -631,6 +631,19 @@ public class Resources { * resource -- for example, a solid color, PNG image, scalable image, etc. * The Drawable API hides these implementation details. * * <p class="note"><strong>Note:</strong> Prior to * {@link android.os.Build.VERSION_CODES#JELLY_BEAN}, this function * would not correctly retrieve the final configuration density when * the resource ID passed here is an alias to another Drawable resource. * This means that if the density configuration of the alias resource * is different than the actual resource, the density of the returned * Drawable would be incorrect, resulting in bad scaling. To work * around this, you can instead retrieve the Drawable through * {@link TypedArray#getDrawable TypedArray.getDrawable}. Use * {@link android.content.Context#obtainStyledAttributes(int[]) * Context.obtainStyledAttributes} with * an array containing the resource ID of interest to create the TypedArray.</p> * * @param id The desired resource identifier, as generated by the aapt * tool. This integer encodes the package, type, and resource * entry. The value 0 is an invalid identifier. Loading core/jni/android_util_AssetManager.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -703,7 +703,7 @@ static jint android_content_AssetManager_loadResourceValue(JNIEnv* env, jobject #endif uint32_t ref = ident; if (resolve) { block = res.resolveReference(&value, block, &ref); block = res.resolveReference(&value, block, &ref, &typeSpecFlags, &config); #if THROW_ON_BAD_ID if (block == BAD_INDEX) { jniThrowException(env, "java/lang/IllegalStateException", "Bad resource!"); Loading Loading
core/java/android/content/res/Resources.java +14 −1 Original line number Diff line number Diff line Loading @@ -631,6 +631,19 @@ public class Resources { * resource -- for example, a solid color, PNG image, scalable image, etc. * The Drawable API hides these implementation details. * * <p class="note"><strong>Note:</strong> Prior to * {@link android.os.Build.VERSION_CODES#JELLY_BEAN}, this function * would not correctly retrieve the final configuration density when * the resource ID passed here is an alias to another Drawable resource. * This means that if the density configuration of the alias resource * is different than the actual resource, the density of the returned * Drawable would be incorrect, resulting in bad scaling. To work * around this, you can instead retrieve the Drawable through * {@link TypedArray#getDrawable TypedArray.getDrawable}. Use * {@link android.content.Context#obtainStyledAttributes(int[]) * Context.obtainStyledAttributes} with * an array containing the resource ID of interest to create the TypedArray.</p> * * @param id The desired resource identifier, as generated by the aapt * tool. This integer encodes the package, type, and resource * entry. The value 0 is an invalid identifier. Loading
core/jni/android_util_AssetManager.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -703,7 +703,7 @@ static jint android_content_AssetManager_loadResourceValue(JNIEnv* env, jobject #endif uint32_t ref = ident; if (resolve) { block = res.resolveReference(&value, block, &ref); block = res.resolveReference(&value, block, &ref, &typeSpecFlags, &config); #if THROW_ON_BAD_ID if (block == BAD_INDEX) { jniThrowException(env, "java/lang/IllegalStateException", "Bad resource!"); Loading