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

Commit cd018f51 authored by Todd Kennedy's avatar Todd Kennedy Committed by android-build-merger
Browse files

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

am: 6fc7e38b

Change-Id: I649f0e947771a9d8d1c74bbbb2aed8ae5bd3b960
parents 74db9b7b 6fc7e38b
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;