Fixed several bugs where the dismissview was not reachable.

Also fixes a bug where the maxExpandHeight was not correctly updated
and where notifications were wrongfully generated.
Finally it fixes an issue where initially the height of the panel was
not correct.

Bug: 17096130
Change-Id: I0f4a05187f31eef5cbbe364bfceb8806b5092cdf
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
index 7d64325..fe754a9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
@@ -274,13 +274,21 @@
     protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
         super.onLayout(changed, left, top, right, bottom);
         boolean updateExpandHeight = mMaxExpandHeight == 0 && !mWasReset;
-        mMaxExpandHeight = mPrivateLayout.getMaxHeight();
+        updateMaxExpandHeight();
         if (updateExpandHeight) {
             applyExpansionToLayout();
         }
         mWasReset = false;
     }
 
+    private void updateMaxExpandHeight() {
+        int intrinsicBefore = getIntrinsicHeight();
+        mMaxExpandHeight = mPrivateLayout.getMaxHeight();
+        if (intrinsicBefore != getIntrinsicHeight()) {
+            notifyHeightChanged();
+        }
+    }
+
     public void setSensitive(boolean sensitive) {
         mSensitive = sensitive;
     }