Properly cancel the animation when saving the fragment state.

Bug 33827301

When saving the fragment state, animations should be canceled, not
cleared. When clear() is called, the animation is set to null and
the ViewGroup parent doesn't remove it from its disappearing
children.

Test: manual

Change-Id: Ic65d4adad26085706ddff4d06e167e5df84e981b
diff --git a/fragment/java/android/support/v4/app/FragmentManager.java b/fragment/java/android/support/v4/app/FragmentManager.java
index e7d13ff..ecc24d0 100644
--- a/fragment/java/android/support/v4/app/FragmentManager.java
+++ b/fragment/java/android/support/v4/app/FragmentManager.java
@@ -2355,7 +2355,10 @@
                 final int stateAfterAnimating = fragment.getStateAfterAnimating();
                 final View animatingAway = fragment.getAnimatingAway();
                 fragment.setAnimatingAway(null);
-                animatingAway.clearAnimation();
+                Animation animation = animatingAway.getAnimation();
+                if (animation != null) {
+                    animation.cancel();
+                }
                 moveToState(fragment, stateAfterAnimating, 0, 0, false);
             }
         }