Fix 2537999: Don't throw exception when SlidingTab has UNSPECIFIED specs

This is try to capture the case where we sometimes see UNSPECIFIED
MeasureSpec in SlidingTab. It should be OK as long as one of the dimensions
is constrained. The log event will give some indication of what's
going on when this happens.

This also fixes a bug where it was possible to not reset the mAnimating flag
in the Phone app.

Change-Id: Ibab1c944ec895a7c19d5a18cc67f6e4db716f685
diff --git a/core/java/com/android/internal/widget/SlidingTab.java b/core/java/com/android/internal/widget/SlidingTab.java
index fd38998..9152729 100644
--- a/core/java/com/android/internal/widget/SlidingTab.java
+++ b/core/java/com/android/internal/widget/SlidingTab.java
@@ -476,7 +476,9 @@
         int heightSpecSize =  MeasureSpec.getSize(heightMeasureSpec);
 
         if (widthSpecMode == MeasureSpec.UNSPECIFIED || heightSpecMode == MeasureSpec.UNSPECIFIED) {
-            throw new RuntimeException(LOG_TAG + " cannot have UNSPECIFIED dimensions");
+            Log.e("SlidingTab", "SlidingTab cannot have UNSPECIFIED MeasureSpec"
+                    +"(wspec=" + widthSpecMode + ", hspec=" + heightSpecMode + ")",
+                    new RuntimeException(LOG_TAG + "stack:"));
         }
 
         mLeftSlider.measure();
@@ -554,6 +556,9 @@
     public void reset(boolean animate) {
         mLeftSlider.reset(animate);
         mRightSlider.reset(animate);
+        if (!animate) {
+            mAnimating = false;
+        }
     }
 
     @Override