Program: 191403
Project: 191403
Buggy source:
public void onClick(final View v){
  if (!(v instanceof ExpandableNotificationRow)) {
    Log.e(TAG,"String_Node_Str");
    return;
  }
  final ExpandableNotificationRow row=(ExpandableNotificationRow)v;
  final StatusBarNotification sbn=row.getStatusBarNotification();
  if (sbn == null) {
    Log.e(TAG,"String_Node_Str");
    return;
  }
  if (row.getSettingsRow() != null && row.getSettingsRow().isVisible()) {
    row.animateTranslateNotification(0);
    return;
  }
  Notification notification=sbn.getNotification();
  final PendingIntent intent=notification.contentIntent != null ? notification.contentIntent : notification.fullScreenIntent;
  final String notificationKey=sbn.getKey();
  row.setJustClicked(true);
  DejankUtils.postAfterTraversal(new Runnable(){
    @Override public void run(){
      row.setJustClicked(false);
    }
  }
);
  final boolean keyguardShowing=mStatusBarKeyguardViewManager.isShowing();
  final boolean afterKeyguardGone=intent.isActivity() && PreviewInflater.wouldLaunchResolverActivity(mContext,intent.getIntent(),mCurrentUserId);
  dismissKeyguardThenExecute(new OnDismissAction(){
    public boolean onDismiss(){
      if (mHeadsUpManager != null && mHeadsUpManager.isHeadsUp(notificationKey)) {
        HeadsUpManager.setIsClickedNotification(row,true);
        mHeadsUpManager.releaseImmediately(notificationKey);
      }
      StatusBarNotification parentToCancel=null;
      if (shouldAutoCancel(sbn) && mGroupManager.isOnlyChildInGroup(sbn)) {
        StatusBarNotification summarySbn=mGroupManager.getLogicalGroupSummary(sbn).getStatusBarNotification();
        if (shouldAutoCancel(summarySbn)) {
          parentToCancel=summarySbn;
        }
      }
      final StatusBarNotification parentToCancelFinal=parentToCancel;
      new Thread(){
        @Override public void run(){
          try {
            if (keyguardShowing && !afterKeyguardGone) {
              ActivityManagerNative.getDefault().keyguardWaitingForActivityDrawn();
            }
            ActivityManagerNative.getDefault().resumeAppSwitches();
          }
 catch (          RemoteException e) {
          }
          if (intent != null) {
            if (intent.isActivity()) {
              final int userId=intent.getCreatorUserHandle().getIdentifier();
              if (mLockPatternUtils.isSeparateProfileChallengeEnabled(userId) && mKeyguardManager.isDeviceLocked(userId)) {
                if (startWorkChallengeIfNecessary(userId,intent.getIntentSender(),notificationKey)) {
                  return;
                }
              }
            }
            try {
              intent.send(null,0,null,null,null,null,getActivityOptions());
            }
 catch (            PendingIntent.CanceledException e) {
              Log.w(TAG,"String_Node_Str" + e);
            }
            if (intent.isActivity()) {
              mAssistManager.hideAssist();
              overrideActivityPendingAppTransition(keyguardShowing && !afterKeyguardGone);
            }
          }
          try {
            mBarService.onNotificationClick(notificationKey);
          }
 catch (          RemoteException ex) {
          }
          if (parentToCancelFinal != null) {
            mHandler.post(new Runnable(){
              @Override public void run(){
                Runnable removeRunnable=new Runnable(){
                  @Override public void run(){
                    performRemoveNotification(parentToCancelFinal,true);
                  }
                }
;
                if (isCollapsing()) {
                  addPostCollapseAction(removeRunnable);
                }
 else {
                  removeRunnable.run();
                }
              }
            }
);
          }
        }
      }
.start();
      animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL,true,true);
      visibilityChanged(false);
      return true;
    }
  }
,afterKeyguardGone);
}

Fixed version (ground truth):
public void onClick(final View v){
  if (!(v instanceof ExpandableNotificationRow)) {
    Log.e(TAG,"String_Node_Str");
    return;
  }
  final ExpandableNotificationRow row=(ExpandableNotificationRow)v;
  final StatusBarNotification sbn=row.getStatusBarNotification();
  if (sbn == null) {
    Log.e(TAG,"String_Node_Str");
    return;
  }
  if (row.getSettingsRow() != null && row.getSettingsRow().isVisible()) {
    row.animateTranslateNotification(0);
    return;
  }
  Notification notification=sbn.getNotification();
  final PendingIntent intent=notification.contentIntent != null ? notification.contentIntent : notification.fullScreenIntent;
  final String notificationKey=sbn.getKey();
  row.setJustClicked(true);
  DejankUtils.postAfterTraversal(new Runnable(){
    @Override public void run(){
      row.setJustClicked(false);
    }
  }
);
  final boolean keyguardShowing=mStatusBarKeyguardViewManager.isShowing();
  final boolean afterKeyguardGone=intent.isActivity() && PreviewInflater.wouldLaunchResolverActivity(mContext,intent.getIntent(),mCurrentUserId);
  dismissKeyguardThenExecute(new OnDismissAction(){
    public boolean onDismiss(){
      if (mHeadsUpManager != null && mHeadsUpManager.isHeadsUp(notificationKey)) {
        if (isPanelFullyCollapsed()) {
          HeadsUpManager.setIsClickedNotification(row,true);
        }
        mHeadsUpManager.releaseImmediately(notificationKey);
      }
      StatusBarNotification parentToCancel=null;
      if (shouldAutoCancel(sbn) && mGroupManager.isOnlyChildInGroup(sbn)) {
        StatusBarNotification summarySbn=mGroupManager.getLogicalGroupSummary(sbn).getStatusBarNotification();
        if (shouldAutoCancel(summarySbn)) {
          parentToCancel=summarySbn;
        }
      }
      final StatusBarNotification parentToCancelFinal=parentToCancel;
      new Thread(){
        @Override public void run(){
          try {
            if (keyguardShowing && !afterKeyguardGone) {
              ActivityManagerNative.getDefault().keyguardWaitingForActivityDrawn();
            }
            ActivityManagerNative.getDefault().resumeAppSwitches();
          }
 catch (          RemoteException e) {
          }
          if (intent != null) {
            if (intent.isActivity()) {
              final int userId=intent.getCreatorUserHandle().getIdentifier();
              if (mLockPatternUtils.isSeparateProfileChallengeEnabled(userId) && mKeyguardManager.isDeviceLocked(userId)) {
                if (startWorkChallengeIfNecessary(userId,intent.getIntentSender(),notificationKey)) {
                  return;
                }
              }
            }
            try {
              intent.send(null,0,null,null,null,null,getActivityOptions());
            }
 catch (            PendingIntent.CanceledException e) {
              Log.w(TAG,"String_Node_Str" + e);
            }
            if (intent.isActivity()) {
              mAssistManager.hideAssist();
              overrideActivityPendingAppTransition(keyguardShowing && !afterKeyguardGone);
            }
          }
          try {
            mBarService.onNotificationClick(notificationKey);
          }
 catch (          RemoteException ex) {
          }
          if (parentToCancelFinal != null) {
            mHandler.post(new Runnable(){
              @Override public void run(){
                Runnable removeRunnable=new Runnable(){
                  @Override public void run(){
                    performRemoveNotification(parentToCancelFinal,true);
                  }
                }
;
                if (isCollapsing()) {
                  addPostCollapseAction(removeRunnable);
                }
 else {
                  removeRunnable.run();
                }
              }
            }
);
          }
        }
      }
.start();
      animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL,true,true);
      visibilityChanged(false);
      return true;
    }
  }
,afterKeyguardGone);
}