Loading core/java/android/content/res/Resources.java +8 −6 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.content.res; import android.animation.Animator; import android.animation.StateListAnimator; import android.annotation.NonNull; import android.util.Pools.SynchronizedPool; import android.view.ViewDebug; import com.android.internal.util.XmlUtils; Loading Loading @@ -1548,20 +1549,21 @@ public class Resources { * contents of the typed array are ultimately filled in by * {@link Resources#getValue}. * * @param values The base set of attribute values, must be equal * in length to {@code attrs} or {@code null}. All values * must be of type {@link TypedValue#TYPE_ATTRIBUTE}. * @param values The base set of attribute values, must be equal in * length to {@code attrs}. All values must be of type * {@link TypedValue#TYPE_ATTRIBUTE}. * @param attrs The desired attributes to be retrieved. * @return Returns a TypedArray holding an array of the attribute * values. Be sure to call {@link TypedArray#recycle()} * when done with it. * @hide */ public TypedArray resolveAttributes(int[] values, int[] attrs) { @NonNull public TypedArray resolveAttributes(@NonNull int[] values, @NonNull int[] attrs) { final int len = attrs.length; if (values != null && len != values.length) { if (values == null || len != values.length) { throw new IllegalArgumentException( "Base attribute values must be null or the same length as attrs"); "Base attribute values must the same length as attrs"); } final TypedArray array = TypedArray.obtain(Resources.this, len); Loading graphics/java/android/graphics/drawable/AnimatedStateListDrawable.java +1 −1 Original line number Diff line number Diff line Loading @@ -361,7 +361,7 @@ public class AnimatedStateListDrawable extends StateListDrawable { super.applyTheme(theme); final AnimatedStateListState state = mState; if (state == null || !state.canApplyTheme()) { if (state == null || state.mAnimThemeAttrs == null) { return; } Loading graphics/java/android/graphics/drawable/ClipDrawable.java +1 −1 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ public class ClipDrawable extends Drawable implements Drawable.Callback { super.applyTheme(t); final ClipState state = mState; if (state == null) { if (state == null || state.mThemeAttrs == null) { return; } Loading graphics/java/android/graphics/drawable/RotateDrawable.java +11 −8 Original line number Diff line number Diff line Loading @@ -427,6 +427,7 @@ public class RotateDrawable extends Drawable implements Drawable.Callback { return; } if (state.mThemeAttrs != null) { final TypedArray a = t.resolveAttributes(state.mThemeAttrs, R.styleable.RotateDrawable); try { updateStateFromTypedArray(a); Loading @@ -436,10 +437,12 @@ public class RotateDrawable extends Drawable implements Drawable.Callback { } finally { a.recycle(); } } if (state.mDrawable != null && state.mDrawable.canApplyTheme()) { state.mDrawable.applyTheme(t); } } private void inflateChildElements(Resources r, XmlPullParser parser, AttributeSet attrs, Loading graphics/java/android/graphics/drawable/ScaleDrawable.java +1 −1 Original line number Diff line number Diff line Loading @@ -114,7 +114,7 @@ public class ScaleDrawable extends Drawable implements Drawable.Callback { return; } if (state.mThemeAttrs == null) { if (state.mThemeAttrs != null) { final TypedArray a = t.resolveAttributes(state.mThemeAttrs, R.styleable.ScaleDrawable); try { updateStateFromTypedArray(a); Loading Loading
core/java/android/content/res/Resources.java +8 −6 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.content.res; import android.animation.Animator; import android.animation.StateListAnimator; import android.annotation.NonNull; import android.util.Pools.SynchronizedPool; import android.view.ViewDebug; import com.android.internal.util.XmlUtils; Loading Loading @@ -1548,20 +1549,21 @@ public class Resources { * contents of the typed array are ultimately filled in by * {@link Resources#getValue}. * * @param values The base set of attribute values, must be equal * in length to {@code attrs} or {@code null}. All values * must be of type {@link TypedValue#TYPE_ATTRIBUTE}. * @param values The base set of attribute values, must be equal in * length to {@code attrs}. All values must be of type * {@link TypedValue#TYPE_ATTRIBUTE}. * @param attrs The desired attributes to be retrieved. * @return Returns a TypedArray holding an array of the attribute * values. Be sure to call {@link TypedArray#recycle()} * when done with it. * @hide */ public TypedArray resolveAttributes(int[] values, int[] attrs) { @NonNull public TypedArray resolveAttributes(@NonNull int[] values, @NonNull int[] attrs) { final int len = attrs.length; if (values != null && len != values.length) { if (values == null || len != values.length) { throw new IllegalArgumentException( "Base attribute values must be null or the same length as attrs"); "Base attribute values must the same length as attrs"); } final TypedArray array = TypedArray.obtain(Resources.this, len); Loading
graphics/java/android/graphics/drawable/AnimatedStateListDrawable.java +1 −1 Original line number Diff line number Diff line Loading @@ -361,7 +361,7 @@ public class AnimatedStateListDrawable extends StateListDrawable { super.applyTheme(theme); final AnimatedStateListState state = mState; if (state == null || !state.canApplyTheme()) { if (state == null || state.mAnimThemeAttrs == null) { return; } Loading
graphics/java/android/graphics/drawable/ClipDrawable.java +1 −1 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ public class ClipDrawable extends Drawable implements Drawable.Callback { super.applyTheme(t); final ClipState state = mState; if (state == null) { if (state == null || state.mThemeAttrs == null) { return; } Loading
graphics/java/android/graphics/drawable/RotateDrawable.java +11 −8 Original line number Diff line number Diff line Loading @@ -427,6 +427,7 @@ public class RotateDrawable extends Drawable implements Drawable.Callback { return; } if (state.mThemeAttrs != null) { final TypedArray a = t.resolveAttributes(state.mThemeAttrs, R.styleable.RotateDrawable); try { updateStateFromTypedArray(a); Loading @@ -436,10 +437,12 @@ public class RotateDrawable extends Drawable implements Drawable.Callback { } finally { a.recycle(); } } if (state.mDrawable != null && state.mDrawable.canApplyTheme()) { state.mDrawable.applyTheme(t); } } private void inflateChildElements(Resources r, XmlPullParser parser, AttributeSet attrs, Loading
graphics/java/android/graphics/drawable/ScaleDrawable.java +1 −1 Original line number Diff line number Diff line Loading @@ -114,7 +114,7 @@ public class ScaleDrawable extends Drawable implements Drawable.Callback { return; } if (state.mThemeAttrs == null) { if (state.mThemeAttrs != null) { final TypedArray a = t.resolveAttributes(state.mThemeAttrs, R.styleable.ScaleDrawable); try { updateStateFromTypedArray(a); Loading