Revert "Don't consider resources < 0 as invalid"

This reverts commit fbcf20819182107fcf1d3fb894881754e2fbb7f6.

Reason for revert: Breaks all window animations

Bug: 78264055
Change-Id: Iaa09626ad8dc26a3fde1ecc402dc2bd28df99627
diff --git a/services/core/java/com/android/server/wm/AppTransition.java b/services/core/java/com/android/server/wm/AppTransition.java
index d6e6c70..c6f156b 100644
--- a/services/core/java/com/android/server/wm/AppTransition.java
+++ b/services/core/java/com/android/server/wm/AppTransition.java
@@ -81,7 +81,6 @@
 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 +554,16 @@
     }
 
     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;
@@ -572,7 +571,7 @@
 
     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;
@@ -583,16 +582,16 @@
     }
 
     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;