Fix inflating of animations.

Need to define attributes for animation set, to have correct indices.

Also small fixes elsewhere.

Change-Id: If596147e8aee4ebffe4e184872070341eff6df73
diff --git a/core/java/android/view/animation/AnimationSet.java b/core/java/android/view/animation/AnimationSet.java
index 58373bc..2cf8ea8 100644
--- a/core/java/android/view/animation/AnimationSet.java
+++ b/core/java/android/view/animation/AnimationSet.java
@@ -89,19 +89,19 @@
 
         if (context.getApplicationInfo().targetSdkVersion >=
                 Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
-            if (a.hasValue(com.android.internal.R.styleable.Animation_duration)) {
+            if (a.hasValue(com.android.internal.R.styleable.AnimationSet_duration)) {
                 mFlags |= PROPERTY_DURATION_MASK;
             }
-            if (a.hasValue(com.android.internal.R.styleable.Animation_fillBefore)) {
+            if (a.hasValue(com.android.internal.R.styleable.AnimationSet_fillBefore)) {
                 mFlags |= PROPERTY_FILL_BEFORE_MASK;
             }
-            if (a.hasValue(com.android.internal.R.styleable.Animation_fillAfter)) {
+            if (a.hasValue(com.android.internal.R.styleable.AnimationSet_fillAfter)) {
                 mFlags |= PROPERTY_FILL_AFTER_MASK;
             }
-            if (a.hasValue(com.android.internal.R.styleable.Animation_repeatMode)) {
+            if (a.hasValue(com.android.internal.R.styleable.AnimationSet_repeatMode)) {
                 mFlags |= PROPERTY_REPEAT_MODE_MASK;
             }
-            if (a.hasValue(com.android.internal.R.styleable.Animation_startOffset)) {
+            if (a.hasValue(com.android.internal.R.styleable.AnimationSet_startOffset)) {
                 mFlags |= PROPERTY_START_OFFSET_MASK;
             }
         }
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index f90d67b..0fbb19a 100755
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -3949,10 +3949,6 @@
     <!-- ========================== -->
     <eat-comment />
 
-    <declare-styleable name="AnimationSet">
-        <attr name="shareInterpolator" format="boolean" />
-    </declare-styleable>
-
     <declare-styleable name="Animation">
         <!-- Defines the interpolator used to smooth the animation movement in time. -->
         <attr name="interpolator" />
@@ -4002,6 +3998,15 @@
         <attr name="detachWallpaper" format="boolean" />
     </declare-styleable>
 
+    <declare-styleable name="AnimationSet">
+        <attr name="shareInterpolator" format="boolean" />
+        <attr name="fillBefore" />
+        <attr name="fillAfter" />
+        <attr name="duration" />
+        <attr name="startOffset" />
+        <attr name="repeatMode" />
+    </declare-styleable>
+
     <declare-styleable name="RotateAnimation">
         <attr name="fromDegrees" />
         <attr name="toDegrees" />
diff --git a/services/java/com/android/server/wm/ScreenRotationAnimation.java b/services/java/com/android/server/wm/ScreenRotationAnimation.java
index 3c475a0..e25638f 100644
--- a/services/java/com/android/server/wm/ScreenRotationAnimation.java
+++ b/services/java/com/android/server/wm/ScreenRotationAnimation.java
@@ -304,8 +304,12 @@
         }
 
         if (!mStarted) {
-            mEnterAnimation.setStartTime(now);
-            mExitAnimation.setStartTime(now);
+            if (mEnterAnimation != null) {
+                mEnterAnimation.setStartTime(now);
+            }
+            if (mExitAnimation != null) {
+                mExitAnimation.setStartTime(now);
+            }
             mStarted = true;
         }
 
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 211c4da..df9698e 100644
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -774,7 +774,7 @@
             // The window manager only throws security exceptions, so let's
             // log all others.
             if (!(e instanceof SecurityException)) {
-                Slog.e(TAG, "Window Manager Crash", e);
+                Log.wtf(TAG, "Window Manager Crash", e);
             }
             throw e;
         }
@@ -7096,7 +7096,7 @@
                 }
             }
         } catch (RuntimeException e) {
-            Slog.e(TAG, "Unhandled exception while force removing for memory", e);
+            Log.wtf(TAG, "Unhandled exception while force removing for memory", e);
         }
         
         try {
@@ -7131,7 +7131,7 @@
             }
         } catch (RuntimeException e) {
             mInLayout = false;
-            Slog.e(TAG, "Unhandled exception while layout out windows", e);
+            Log.wtf(TAG, "Unhandled exception while laying out windows", e);
         }
     }
 
@@ -8397,7 +8397,7 @@
                 }
             }
         } catch (RuntimeException e) {
-            Slog.e(TAG, "Unhandled exception in Window Manager", e);
+            Log.wtf(TAG, "Unhandled exception in Window Manager", e);
         }
 
         Surface.closeTransaction();
@@ -9179,7 +9179,7 @@
             if (windows == null || windows.contains(w)) {
                 pw.print("  Window #"); pw.print(i); pw.print(' ');
                         pw.print(w); pw.println(":");
-                w.dump(pw, "    ", dumpAll);
+                w.dump(pw, "    ", dumpAll || windows != null);
             }
         }
         if (mInputMethodDialogs.size() > 0) {