Program: 191605
Project: 191605
Buggy source:
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int ownMaxHeight=mMaxNotificationHeight;
  int heightMode=MeasureSpec.getMode(heightMeasureSpec);
  boolean hasFixedHeight=heightMode == MeasureSpec.EXACTLY;
  boolean isHeightLimited=heightMode == MeasureSpec.AT_MOST;
  int size=MeasureSpec.getSize(heightMeasureSpec);
  if (hasFixedHeight || isHeightLimited) {
    ownMaxHeight=Math.min(ownMaxHeight,size);
  }
  int newHeightSpec=MeasureSpec.makeMeasureSpec(ownMaxHeight,MeasureSpec.AT_MOST);
  int width=MeasureSpec.getSize(widthMeasureSpec);
  if (mOverflowNumber != null) {
    mOverflowNumber.measure(MeasureSpec.makeMeasureSpec(width,MeasureSpec.AT_MOST),newHeightSpec);
  }
  int dividerHeightSpec=MeasureSpec.makeMeasureSpec(mDividerHeight,MeasureSpec.EXACTLY);
  int height=mNotificationHeaderHeight + mNotificatonTopPadding;
  int childCount=Math.min(mChildren.size(),NUMBER_OF_CHILDREN_WHEN_CHILDREN_EXPANDED);
  int collapsedChildren=getMaxAllowedVisibleChildren(true);
  int overflowIndex=childCount > collapsedChildren ? collapsedChildren - 1 : -1;
  for (int i=0; i < childCount; i++) {
    ExpandableNotificationRow child=mChildren.get(i);
    boolean isOverflow=i == overflowIndex;
    child.setSingleLineWidthIndention(isOverflow && mOverflowNumber != null ? mOverflowNumber.getMeasuredWidth() : 0);
    child.measure(widthMeasureSpec,newHeightSpec);
    height+=child.getMeasuredHeight();
    View divider=mDividers.get(i);
    divider.measure(widthMeasureSpec,dividerHeightSpec);
    height+=mDividerHeight;
  }
  mRealHeight=height;
  if (heightMode != MeasureSpec.UNSPECIFIED) {
    height=Math.min(height,size);
  }
  setMeasuredDimension(width,height);
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int ownMaxHeight=mMaxNotificationHeight;
  int heightMode=MeasureSpec.getMode(heightMeasureSpec);
  boolean hasFixedHeight=heightMode == MeasureSpec.EXACTLY;
  boolean isHeightLimited=heightMode == MeasureSpec.AT_MOST;
  int size=MeasureSpec.getSize(heightMeasureSpec);
  if (hasFixedHeight || isHeightLimited) {
    ownMaxHeight=Math.min(ownMaxHeight,size);
  }
  int newHeightSpec=MeasureSpec.makeMeasureSpec(ownMaxHeight,MeasureSpec.AT_MOST);
  int width=MeasureSpec.getSize(widthMeasureSpec);
  if (mOverflowNumber != null) {
    mOverflowNumber.measure(MeasureSpec.makeMeasureSpec(width,MeasureSpec.AT_MOST),newHeightSpec);
  }
  int dividerHeightSpec=MeasureSpec.makeMeasureSpec(mDividerHeight,MeasureSpec.EXACTLY);
  int height=mNotificationHeaderHeight + mNotificatonTopPadding;
  int childCount=Math.min(mChildren.size(),NUMBER_OF_CHILDREN_WHEN_CHILDREN_EXPANDED);
  int collapsedChildren=getMaxAllowedVisibleChildren(true);
  int overflowIndex=childCount > collapsedChildren ? collapsedChildren - 1 : -1;
  for (int i=0; i < childCount; i++) {
    ExpandableNotificationRow child=mChildren.get(i);
    boolean isOverflow=i == overflowIndex;
    child.setSingleLineWidthIndention(isOverflow && mOverflowNumber != null ? mOverflowNumber.getMeasuredWidth() : 0);
    child.measure(widthMeasureSpec,newHeightSpec);
    View divider=mDividers.get(i);
    divider.measure(widthMeasureSpec,dividerHeightSpec);
    if (child.getVisibility() != GONE) {
      height+=child.getMeasuredHeight() + mDividerHeight;
    }
  }
  mRealHeight=height;
  if (heightMode != MeasureSpec.UNSPECIFIED) {
    height=Math.min(height,size);
  }
  setMeasuredDimension(width,height);
}