Merge "Revert "Don't consider resources < 0 as invalid"" into pi-dev
am: 2557f34102
Change-Id: Iff2cbb469b137cbc7cbb258d001d3330451f2221
This commit is contained in:
@@ -82,7 +82,6 @@ import android.app.ActivityManager;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.ResourceId;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
@@ -556,16 +555,16 @@ public class AppTransition implements Dump {
|
||||
}
|
||||
|
||||
Animation loadAnimationAttr(LayoutParams lp, int animAttr) {
|
||||
int anim = ResourceId.ID_NULL;
|
||||
int anim = 0;
|
||||
Context context = mContext;
|
||||
if (ResourceId.isValid(animAttr)) {
|
||||
if (animAttr >= 0) {
|
||||
AttributeCache.Entry ent = getCachedAnimations(lp);
|
||||
if (ent != null) {
|
||||
context = ent.context;
|
||||
anim = ent.array.getResourceId(animAttr, 0);
|
||||
}
|
||||
}
|
||||
if (ResourceId.isValid(anim)) {
|
||||
if (anim != 0) {
|
||||
return AnimationUtils.loadAnimation(context, anim);
|
||||
}
|
||||
return null;
|
||||
@@ -573,7 +572,7 @@ public class AppTransition implements Dump {
|
||||
|
||||
Animation loadAnimationRes(LayoutParams lp, int resId) {
|
||||
Context context = mContext;
|
||||
if (ResourceId.isValid(resId)) {
|
||||
if (resId >= 0) {
|
||||
AttributeCache.Entry ent = getCachedAnimations(lp);
|
||||
if (ent != null) {
|
||||
context = ent.context;
|
||||
@@ -584,16 +583,16 @@ public class AppTransition implements Dump {
|
||||
}
|
||||
|
||||
private Animation loadAnimationRes(String packageName, int resId) {
|
||||
int anim = ResourceId.ID_NULL;
|
||||
int anim = 0;
|
||||
Context context = mContext;
|
||||
if (ResourceId.isValid(resId)) {
|
||||
if (resId >= 0) {
|
||||
AttributeCache.Entry ent = getCachedAnimations(packageName, resId);
|
||||
if (ent != null) {
|
||||
context = ent.context;
|
||||
anim = resId;
|
||||
}
|
||||
}
|
||||
if (ResourceId.isValid(anim)) {
|
||||
if (anim != 0) {
|
||||
return AnimationUtils.loadAnimation(context, anim);
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user