Program: 194960
Project: 194960
Buggy source:
/** 
 * Updates expanded, dimmed and locked states of notification rows.
 */
protected void updateRowStates(){
  int maxKeyguardNotifications=getMaxKeyguardNotifications();
  mKeyguardIconOverflowContainer.getIconsView().removeAllViews();
  ArrayList<Entry> activeNotifications=mNotificationData.getActiveNotifications();
  final int N=activeNotifications.size();
  int visibleNotifications=0;
  boolean onKeyguard=mState == StatusBarState.KEYGUARD;
  for (int i=0; i < N; i++) {
    NotificationData.Entry entry=activeNotifications.get(i);
    if (onKeyguard) {
      entry.row.setExpansionDisabled(true);
    }
 else {
      entry.row.setExpansionDisabled(false);
      if (!entry.row.isUserLocked()) {
        boolean top=(i == 0);
        entry.row.setSystemExpanded(top);
      }
    }
    boolean isInvisibleChild=!mGroupManager.isVisible(entry.notification);
    boolean showOnKeyguard=shouldShowOnKeyguard(entry.notification);
    if ((isLockscreenPublicMode() && !mShowLockscreenNotifications) || (onKeyguard && (visibleNotifications >= maxKeyguardNotifications || !showOnKeyguard || isInvisibleChild))) {
      entry.row.setVisibility(View.GONE);
      if (onKeyguard && showOnKeyguard && !isInvisibleChild) {
        mKeyguardIconOverflowContainer.getIconsView().addNotification(entry);
      }
    }
 else {
      boolean wasGone=entry.row.getVisibility() == View.GONE;
      entry.row.setVisibility(View.VISIBLE);
      if (!isInvisibleChild) {
        if (wasGone) {
          mStackScroller.generateAddAnimation(entry.row,true);
        }
        visibleNotifications++;
      }
    }
  }
  if (onKeyguard && mKeyguardIconOverflowContainer.getIconsView().getChildCount() > 0) {
    mKeyguardIconOverflowContainer.setVisibility(View.VISIBLE);
  }
 else {
    mKeyguardIconOverflowContainer.setVisibility(View.GONE);
  }
  mStackScroller.changeViewPosition(mKeyguardIconOverflowContainer,mStackScroller.getChildCount() - 3);
  mStackScroller.changeViewPosition(mEmptyShadeView,mStackScroller.getChildCount() - 2);
  mStackScroller.changeViewPosition(mDismissView,mStackScroller.getChildCount() - 1);
}

Fixed version (ground truth):
/** 
 * Updates expanded, dimmed and locked states of notification rows.
 */
protected void updateRowStates(){
  int maxKeyguardNotifications=getMaxKeyguardNotifications();
  mKeyguardIconOverflowContainer.getIconsView().removeAllViews();
  ArrayList<Entry> activeNotifications=mNotificationData.getActiveNotifications();
  final int N=activeNotifications.size();
  int visibleNotifications=0;
  boolean onKeyguard=mState == StatusBarState.KEYGUARD;
  for (int i=0; i < N; i++) {
    NotificationData.Entry entry=activeNotifications.get(i);
    if (onKeyguard) {
      entry.row.setExpansionDisabled(true);
    }
 else {
      entry.row.setExpansionDisabled(false);
      if (!entry.row.isUserLocked()) {
        boolean top=(i == 0);
        entry.row.setSystemExpanded(top);
      }
    }
    boolean isInvisibleChild=!mGroupManager.isVisible(entry.notification);
    boolean showOnKeyguard=shouldShowOnKeyguard(entry.notification);
    if ((isLockscreenPublicMode() && !mShowLockscreenNotifications) || (onKeyguard && (visibleNotifications >= maxKeyguardNotifications || !showOnKeyguard || isInvisibleChild))) {
      entry.row.setVisibility(View.GONE);
      if (onKeyguard && showOnKeyguard && !isInvisibleChild) {
        mKeyguardIconOverflowContainer.getIconsView().addNotification(entry);
      }
    }
 else {
      boolean wasGone=entry.row.getVisibility() == View.GONE;
      entry.row.setVisibility(View.VISIBLE);
      if (!isInvisibleChild) {
        if (wasGone) {
          mStackScroller.generateAddAnimation(entry.row,true);
        }
        visibleNotifications++;
      }
    }
  }
  if (onKeyguard && mKeyguardIconOverflowContainer.getIconsView().getChildCount() > 0) {
    mKeyguardIconOverflowContainer.setVisibility(View.VISIBLE);
  }
 else {
    mKeyguardIconOverflowContainer.setVisibility(View.GONE);
  }
  mStackScroller.changeViewPosition(mDismissView,mStackScroller.getChildCount() - 1);
  mStackScroller.changeViewPosition(mEmptyShadeView,mStackScroller.getChildCount() - 2);
  mStackScroller.changeViewPosition(mKeyguardIconOverflowContainer,mStackScroller.getChildCount() - 3);
}