Fixed a bug where notifications could overlap

If the expanded child was smaller then the collapsed one
the UI could get very weird. We're now measuring the expanded
version at least as big as the collapsed one.

Change-Id: Ibb99c4926121b2affcc181071b5e439f23c8e4f2
Fixes: 28318145
Fixes: 28015447
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java
index 83f68e8..7be50c4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java
@@ -177,6 +177,13 @@
             if (updateContractedHeaderWidth()) {
                 mContractedChild.measure(widthMeasureSpec, heightSpec);
             }
+            if (mExpandedChild != null
+                    && mContractedChild.getMeasuredHeight() > mExpandedChild.getMeasuredHeight()) {
+                // the Expanded child is smaller then the collapsed. Let's remeasure it.
+                heightSpec = MeasureSpec.makeMeasureSpec(mContractedChild.getMeasuredHeight(),
+                        MeasureSpec.EXACTLY);
+                mExpandedChild.measure(widthMeasureSpec, heightSpec);
+            }
         }
         if (mHeadsUpChild != null) {
             int size = Math.min(maxSize, mHeadsUpHeight);