Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6fc7e38b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Don't consider resources < 0 as invalid" into pi-dev

parents 56487413 fbcf2081
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ 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;
@@ -555,16 +556,16 @@ public class AppTransition implements Dump {
    }

    Animation loadAnimationAttr(LayoutParams lp, int animAttr) {
        int anim = 0;
        int anim = ResourceId.ID_NULL;
        Context context = mContext;
        if (animAttr >= 0) {
        if (ResourceId.isValid(animAttr)) {
            AttributeCache.Entry ent = getCachedAnimations(lp);
            if (ent != null) {
                context = ent.context;
                anim = ent.array.getResourceId(animAttr, 0);
            }
        }
        if (anim != 0) {
        if (ResourceId.isValid(anim)) {
            return AnimationUtils.loadAnimation(context, anim);
        }
        return null;
@@ -572,7 +573,7 @@ public class AppTransition implements Dump {

    Animation loadAnimationRes(LayoutParams lp, int resId) {
        Context context = mContext;
        if (resId >= 0) {
        if (ResourceId.isValid(resId)) {
            AttributeCache.Entry ent = getCachedAnimations(lp);
            if (ent != null) {
                context = ent.context;
@@ -583,16 +584,16 @@ public class AppTransition implements Dump {
    }

    private Animation loadAnimationRes(String packageName, int resId) {
        int anim = 0;
        int anim = ResourceId.ID_NULL;
        Context context = mContext;
        if (resId >= 0) {
        if (ResourceId.isValid(resId)) {
            AttributeCache.Entry ent = getCachedAnimations(packageName, resId);
            if (ent != null) {
                context = ent.context;
                anim = resId;
            }
        }
        if (anim != 0) {
        if (ResourceId.isValid(anim)) {
            return AnimationUtils.loadAnimation(context, anim);
        }
        return null;