am bffe0be3: am 9c92fcd9: Merge "Bug 5727679 - CTS test ViewGroupTest#testGetChildVisibleRect" into ics-mr1

* commit 'bffe0be3af2bd19a392e7d332cbfda9a60b8e057':
  Bug 5727679 - CTS test ViewGroupTest#testGetChildVisibleRect
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 1102a47..0d34b90 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -4190,10 +4190,10 @@
      * {@inheritDoc}
      */
     public boolean getChildVisibleRect(View child, Rect r, android.graphics.Point offset) {
-        // The View is not attached to a window, 'visible' does not make sense, return false
-        if (mAttachInfo == null) return false;
-
-        final RectF rect = mAttachInfo.mTmpTransformRect;
+        // It doesn't make a whole lot of sense to call this on a view that isn't attached,
+        // but for some simple tests it can be useful. If we don't have attach info this
+        // will allocate memory.
+        final RectF rect = mAttachInfo != null ? mAttachInfo.mTmpTransformRect : new RectF();
         rect.set(r);
 
         if (!child.hasIdentityMatrix()) {
@@ -4207,7 +4207,8 @@
 
         if (offset != null) {
             if (!child.hasIdentityMatrix()) {
-                float[] position = mAttachInfo.mTmpTransformLocation;
+                float[] position = mAttachInfo != null ? mAttachInfo.mTmpTransformLocation
+                        : new float[2];
                 position[0] = offset.x;
                 position[1] = offset.y;
                 child.getMatrix().mapPoints(position);