Fix issue #3302006: Cannot see the dialog lunched from a transparent activity.

The activity manager was not performing the layout pass on the new window,
because its app token was still hidden, because the activity manager / window
manager were still waiting for it to be ready to show.

Just ignore whether the app token is hidden for this case.

Also fixes some problems with animations, and tweaks the ViewConfiguration
values for xlarge screens.

Change-Id: Icbe9c77ba8127d1e02df2d6f27b8e86ec842e50a
diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java
index 6b41ce5..edad494 100644
--- a/core/java/android/view/ViewConfiguration.java
+++ b/core/java/android/view/ViewConfiguration.java
@@ -17,6 +17,7 @@
 package android.view;
 
 import android.content.Context;
+import android.content.res.Configuration;
 import android.util.DisplayMetrics;
 import android.util.SparseArray;
 
@@ -217,22 +218,29 @@
     private ViewConfiguration(Context context) {
         final DisplayMetrics metrics = context.getResources().getDisplayMetrics();
         final float density = metrics.density;
+        final float sizeAndDensity;
+        if (context.getResources().getConfiguration().isLayoutSizeAtLeast(
+                Configuration.SCREENLAYOUT_SIZE_XLARGE)) {
+            sizeAndDensity = density * 1.5f;
+        } else {
+            sizeAndDensity = density;
+        }
 
-        mEdgeSlop = (int) (density * EDGE_SLOP + 0.5f);
-        mFadingEdgeLength = (int) (density * FADING_EDGE_LENGTH + 0.5f);
+        mEdgeSlop = (int) (sizeAndDensity * EDGE_SLOP + 0.5f);
+        mFadingEdgeLength = (int) (sizeAndDensity * FADING_EDGE_LENGTH + 0.5f);
         mMinimumFlingVelocity = (int) (density * MINIMUM_FLING_VELOCITY + 0.5f);
         mMaximumFlingVelocity = (int) (density * MAXIMUM_FLING_VELOCITY + 0.5f);
         mScrollbarSize = (int) (density * SCROLL_BAR_SIZE + 0.5f);
-        mTouchSlop = (int) (density * TOUCH_SLOP + 0.5f);
-        mPagingTouchSlop = (int) (density * PAGING_TOUCH_SLOP + 0.5f);
-        mDoubleTapSlop = (int) (density * DOUBLE_TAP_SLOP + 0.5f);
-        mWindowTouchSlop = (int) (density * WINDOW_TOUCH_SLOP + 0.5f);
+        mTouchSlop = (int) (sizeAndDensity * TOUCH_SLOP + 0.5f);
+        mPagingTouchSlop = (int) (sizeAndDensity * PAGING_TOUCH_SLOP + 0.5f);
+        mDoubleTapSlop = (int) (sizeAndDensity * DOUBLE_TAP_SLOP + 0.5f);
+        mWindowTouchSlop = (int) (sizeAndDensity * WINDOW_TOUCH_SLOP + 0.5f);
 
         // Size of the screen in bytes, in ARGB_8888 format
         mMaximumDrawingCacheSize = 4 * metrics.widthPixels * metrics.heightPixels;
 
-        mOverscrollDistance = (int) (density * OVERSCROLL_DISTANCE + 0.5f);
-        mOverflingDistance = (int) (density * OVERFLING_DISTANCE + 0.5f);
+        mOverscrollDistance = (int) (sizeAndDensity * OVERSCROLL_DISTANCE + 0.5f);
+        mOverflingDistance = (int) (sizeAndDensity * OVERFLING_DISTANCE + 0.5f);
     }
 
     /**
diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java
index ad101f8..8a9b78b 100644
--- a/core/java/android/view/ViewRoot.java
+++ b/core/java/android/view/ViewRoot.java
@@ -1133,7 +1133,7 @@
                 if (DEBUG_LAYOUT) Log.v(TAG, "Ooops, something changed!  mWidth="
                         + mWidth + " measuredWidth=" + host.getMeasuredWidth()
                         + " mHeight=" + mHeight
-                        + " measuredHeight" + host.getMeasuredHeight()
+                        + " measuredHeight=" + host.getMeasuredHeight()
                         + " coveredInsetsChanged=" + contentInsetsChanged);
 
                  // Ask host how big it wants to be
diff --git a/core/res/res/anim/activity_close_enter.xml b/core/res/res/anim/activity_close_enter.xml
index d525127..4260c08 100644
--- a/core/res/res/anim/activity_close_enter.xml
+++ b/core/res/res/anim/activity_close_enter.xml
@@ -18,14 +18,14 @@
 -->
 
 <set xmlns:android="http://schemas.android.com/apk/res/android"
-		android:zAdjustment="normal"
+		android:zAdjustment="top"
         android:shareInterpolator="false">
     <scale android:fromXScale="0.975" android:toXScale="1.0"
             android:fromYScale="0.975" android:toYScale="1.0"
             android:pivotX="50%p" android:pivotY="50%p"
             android:interpolator="@interpolator/decelerate_quint"
             android:duration="@android:integer/config_activityDefaultDur" />
-    <alpha android:fromAlpha=".75" android:toAlpha="1.0"
+    <alpha android:fromAlpha="0.0" android:toAlpha="1.0"
             android:interpolator="@interpolator/decelerate_cubic"
             android:duration="@android:integer/config_activityDefaultDur"/>
 </set>
\ No newline at end of file
diff --git a/core/res/res/anim/activity_close_exit.xml b/core/res/res/anim/activity_close_exit.xml
index ab7adcb..8c97ee8 100644
--- a/core/res/res/anim/activity_close_exit.xml
+++ b/core/res/res/anim/activity_close_exit.xml
@@ -18,14 +18,11 @@
 -->
 
 <set xmlns:android="http://schemas.android.com/apk/res/android"
-		android:zAdjustment="top"
+		android:zAdjustment="normal"
         android:shareInterpolator="false">
     <scale android:fromXScale="1.0" android:toXScale="1.075"
             android:fromYScale="1.0" android:toYScale="1.075"
             android:pivotX="50%p" android:pivotY="50%p"
             android:interpolator="@interpolator/decelerate_quint"
             android:duration="@android:integer/config_activityDefaultDur" />
-    <alpha android:fromAlpha="1.0" android:toAlpha="0.0"
-            android:interpolator="@interpolator/decelerate_cubic"
-            android:duration="@android:integer/config_activityDefaultDur"/>
 </set>
\ No newline at end of file
diff --git a/core/res/res/anim/activity_open_enter.xml b/core/res/res/anim/activity_open_enter.xml
index 90f8520..5f6ac68 100644
--- a/core/res/res/anim/activity_open_enter.xml
+++ b/core/res/res/anim/activity_open_enter.xml
@@ -18,14 +18,11 @@
 -->
 
 <set xmlns:android="http://schemas.android.com/apk/res/android"
-		android:zAdjustment="top"
+		android:zAdjustment="normal"
         android:shareInterpolator="false">
     <scale android:fromXScale="1.125" android:toXScale="1.0"
             android:fromYScale="1.125" android:toYScale="1.0"
             android:pivotX="50%p" android:pivotY="50%p"
             android:interpolator="@interpolator/decelerate_quint"
             android:duration="@android:integer/config_activityDefaultDur" />
-    <alpha android:fromAlpha="0.0" android:toAlpha="1.0"
-            android:interpolator="@interpolator/decelerate_cubic"
-            android:duration="@android:integer/config_activityDefaultDur"/>
 </set>
\ No newline at end of file
diff --git a/core/res/res/anim/activity_open_exit.xml b/core/res/res/anim/activity_open_exit.xml
index 30a1dec..08b22b9 100644
--- a/core/res/res/anim/activity_open_exit.xml
+++ b/core/res/res/anim/activity_open_exit.xml
@@ -18,14 +18,14 @@
 -->
 
 <set xmlns:android="http://schemas.android.com/apk/res/android"
-		android:zAdjustment="normal"
+		android:zAdjustment="top"
         android:shareInterpolator="false">
     <scale android:fromXScale="1.0" android:toXScale="0.975"
             android:fromYScale="1.0" android:toYScale="0.975"
             android:pivotX="50%p" android:pivotY="50%p"
             android:interpolator="@interpolator/linear"
             android:duration="@android:integer/config_activityDefaultDur" />
-    <alpha android:fromAlpha="1.0" android:toAlpha="0.75"
+    <alpha android:fromAlpha="1.0" android:toAlpha="0.0"
             android:interpolator="@interpolator/decelerate_cubic"
             android:duration="@android:integer/config_activityDefaultDur"/>
 </set>
\ No newline at end of file
diff --git a/core/res/res/anim/task_open_enter.xml b/core/res/res/anim/task_open_enter.xml
index e3e8585..b3b3fd1 100644
--- a/core/res/res/anim/task_open_enter.xml
+++ b/core/res/res/anim/task_open_enter.xml
@@ -18,7 +18,7 @@
 -->
 
 <set xmlns:android="http://schemas.android.com/apk/res/android"
-        android:shareInterpolator="false">
+        android:detachWallpaper="true" android:shareInterpolator="false">
     <scale android:fromXScale="1.0" android:toXScale="1.0"
             android:fromYScale=".9" android:toYScale="1.0"
             android:pivotX="50%p" android:pivotY="50%p"
diff --git a/core/res/res/anim/task_open_exit.xml b/core/res/res/anim/task_open_exit.xml
index 5f03516..763b581 100644
--- a/core/res/res/anim/task_open_exit.xml
+++ b/core/res/res/anim/task_open_exit.xml
@@ -18,7 +18,7 @@
 -->
 
 <set xmlns:android="http://schemas.android.com/apk/res/android"
-        android:shareInterpolator="false">
+        android:detachWallpaper="true" android:shareInterpolator="false">
     <scale android:fromXScale="1.0" android:toXScale="1.0"
             android:fromYScale="1.0" android:toYScale="0.0"
             android:pivotX="50%p" android:pivotY="50%p"