Correctly invalidate views that transition from opaque to non-opaque.
Bug #3337037

Change-Id: I31397273a31b6004e2e3801866122bcbb3ebee5d
diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java
index 2c6ec71..ad101f8 100644
--- a/core/java/android/view/ViewRoot.java
+++ b/core/java/android/view/ViewRoot.java
@@ -710,8 +710,10 @@
             // object is not initialized to its backing store, but soon it
             // will be (assuming the window is visible).
             attachInfo.mSurface = mSurface;
-            attachInfo.mUse32BitDrawingCache = PixelFormat.formatHasAlpha(lp.format) ||
-                    lp.format == PixelFormat.RGBX_8888;
+            // We used to use the following condition to choose 32 bits drawing caches:
+            // PixelFormat.hasAlpha(lp.format) || lp.format == PixelFormat.RGBX_8888
+            // However, windows are now always 32 bits by default, so choose 32 bits
+            attachInfo.mUse32BitDrawingCache = true;
             attachInfo.mHasWindowFocus = false;
             attachInfo.mWindowVisibility = viewVisibility;
             attachInfo.mRecomputeGlobalAttributes = false;