Program: 198998
Project: 198998
Buggy source:
void enqueueNotificationInternal(final String pkg,final String opPkg,final int callingUid,final int callingPid,final String tag,final int id,final Notification notification,int[] idOut,int incomingUserId){
  if (DBG) {
    Slog.v(TAG,"String_Node_Str" + pkg + "String_Node_Str"+ id+ "String_Node_Str"+ notification);
  }
  checkCallerIsSystemOrSameApp(pkg);
  final boolean isSystemNotification=isUidSystem(callingUid) || ("String_Node_Str".equals(pkg));
  final int userId=ActivityManager.handleIncomingUser(callingPid,callingUid,incomingUserId,true,false,"String_Node_Str",pkg);
  final UserHandle user=new UserHandle(userId);
  if (!isSystemNotification) {
synchronized (mNotificationList) {
      int count=0;
      final int N=mNotificationList.size();
      for (int i=0; i < N; i++) {
        final NotificationRecord r=mNotificationList.get(i);
        if (r.sbn.getPackageName().equals(pkg) && r.sbn.getUserId() == userId) {
          count++;
          if (count >= MAX_PACKAGE_NOTIFICATIONS) {
            Slog.e(TAG,"String_Node_Str" + count + "String_Node_Str"+ pkg);
            return;
          }
        }
      }
    }
  }
  if (!pkg.equals("String_Node_Str") || Log.isLoggable("String_Node_Str",Log.VERBOSE)) {
    EventLogTags.writeNotificationEnqueue(callingUid,callingPid,pkg,id,tag,userId,notification.toString());
  }
  if (pkg == null || notification == null) {
    throw new IllegalArgumentException("String_Node_Str" + pkg + "String_Node_Str"+ id+ "String_Node_Str"+ notification);
  }
  if (notification.icon != 0) {
    if (notification.contentView == null) {
      throw new IllegalArgumentException("String_Node_Str" + pkg + "String_Node_Str"+ id+ "String_Node_Str"+ notification);
    }
  }
  mHandler.post(new Runnable(){
    @Override public void run(){
      notification.priority=clamp(notification.priority,Notification.PRIORITY_MIN,Notification.PRIORITY_MAX);
      if (0 != (notification.flags & Notification.FLAG_HIGH_PRIORITY)) {
        if (notification.priority < Notification.PRIORITY_MAX) {
          notification.priority=Notification.PRIORITY_MAX;
        }
      }
 else       if (SCORE_ONGOING_HIGHER && 0 != (notification.flags & Notification.FLAG_ONGOING_EVENT)) {
        if (notification.priority < Notification.PRIORITY_HIGH) {
          notification.priority=Notification.PRIORITY_HIGH;
        }
      }
      final int score=notification.priority * NOTIFICATION_PRIORITY_MULTIPLIER;
      final StatusBarNotification n=new StatusBarNotification(pkg,opPkg,id,tag,callingUid,callingPid,score,notification,user);
      NotificationRecord r=new NotificationRecord(n,score);
      NotificationRecord old=mNotificationsByKey.get(n.getKey());
      if (old != null) {
        r.copyRankingInformation(old);
      }
      if (!mSignalExtractors.isEmpty()) {
        for (        NotificationSignalExtractor extractor : mSignalExtractors) {
          try {
            RankingReconsideration recon=extractor.process(r);
            scheduleRankingReconsideration(recon);
          }
 catch (          Throwable t) {
            Slog.w(TAG,"String_Node_Str",t);
          }
        }
      }
      if (ENABLE_BLOCKED_NOTIFICATIONS && !noteNotificationOp(pkg,callingUid)) {
        if (!isSystemNotification) {
          r.score=JUNK_SCORE;
          Slog.e(TAG,"String_Node_Str" + pkg + "String_Node_Str");
        }
      }
      if (r.score < SCORE_DISPLAY_THRESHOLD) {
        return;
      }
synchronized (mNotificationList) {
        int index=indexOfNotificationLocked(n.getKey());
        if (index < 0) {
          mNotificationList.add(r);
          mUsageStats.registerPostedByApp(r);
        }
 else {
          old=mNotificationList.get(index);
          mNotificationList.set(index,r);
          mUsageStats.registerUpdatedByApp(r,old);
          notification.flags|=old.getNotification().flags & Notification.FLAG_FOREGROUND_SERVICE;
          mNotificationsByKey.remove(old.sbn.getKey());
          r.isUpdate=true;
        }
        mNotificationsByKey.put(n.getKey(),r);
        applyZenModeLocked(r);
        Collections.sort(mNotificationList,mRankingComparator);
        if (notification.icon != 0) {
          mListeners.notifyPostedLocked(n);
        }
 else {
          Slog.e(TAG,"String_Node_Str" + notification);
          if (old != null && !old.isCanceled) {
            mListeners.notifyRemovedLocked(n);
          }
          Slog.e(TAG,"String_Node_Str" + n.getPackageName());
        }
        if ((notification.flags & Notification.FLAG_FOREGROUND_SERVICE) != 0) {
          notification.flags|=Notification.FLAG_ONGOING_EVENT | Notification.FLAG_NO_CLEAR;
        }
        buzzBeepBlinkLocked(r);
      }
    }
  }
);
  idOut[0]=id;
}

Fixed version (ground truth):
void enqueueNotificationInternal(final String pkg,final String opPkg,final int callingUid,final int callingPid,final String tag,final int id,final Notification notification,int[] idOut,int incomingUserId){
  if (DBG) {
    Slog.v(TAG,"String_Node_Str" + pkg + "String_Node_Str"+ id+ "String_Node_Str"+ notification);
  }
  checkCallerIsSystemOrSameApp(pkg);
  final boolean isSystemNotification=isUidSystem(callingUid) || ("String_Node_Str".equals(pkg));
  final int userId=ActivityManager.handleIncomingUser(callingPid,callingUid,incomingUserId,true,false,"String_Node_Str",pkg);
  final UserHandle user=new UserHandle(userId);
  if (!isSystemNotification) {
synchronized (mNotificationList) {
      int count=0;
      final int N=mNotificationList.size();
      for (int i=0; i < N; i++) {
        final NotificationRecord r=mNotificationList.get(i);
        if (r.sbn.getPackageName().equals(pkg) && r.sbn.getUserId() == userId) {
          count++;
          if (count >= MAX_PACKAGE_NOTIFICATIONS) {
            Slog.e(TAG,"String_Node_Str" + count + "String_Node_Str"+ pkg);
            return;
          }
        }
      }
    }
  }
  if (!pkg.equals("String_Node_Str") || Log.isLoggable("String_Node_Str",Log.VERBOSE)) {
    EventLogTags.writeNotificationEnqueue(callingUid,callingPid,pkg,id,tag,userId,notification.toString());
  }
  if (pkg == null || notification == null) {
    throw new IllegalArgumentException("String_Node_Str" + pkg + "String_Node_Str"+ id+ "String_Node_Str"+ notification);
  }
  if (notification.icon != 0) {
    if (notification.contentView == null) {
      throw new IllegalArgumentException("String_Node_Str" + pkg + "String_Node_Str"+ id+ "String_Node_Str"+ notification);
    }
  }
  mHandler.post(new Runnable(){
    @Override public void run(){
      notification.priority=clamp(notification.priority,Notification.PRIORITY_MIN,Notification.PRIORITY_MAX);
      if (0 != (notification.flags & Notification.FLAG_HIGH_PRIORITY)) {
        if (notification.priority < Notification.PRIORITY_MAX) {
          notification.priority=Notification.PRIORITY_MAX;
        }
      }
 else       if (SCORE_ONGOING_HIGHER && 0 != (notification.flags & Notification.FLAG_ONGOING_EVENT)) {
        if (notification.priority < Notification.PRIORITY_HIGH) {
          notification.priority=Notification.PRIORITY_HIGH;
        }
      }
      final int score=notification.priority * NOTIFICATION_PRIORITY_MULTIPLIER;
      final StatusBarNotification n=new StatusBarNotification(pkg,opPkg,id,tag,callingUid,callingPid,score,notification,user);
      NotificationRecord r=new NotificationRecord(n,score);
      NotificationRecord old=mNotificationsByKey.get(n.getKey());
      if (old != null) {
        r.copyRankingInformation(old);
      }
      if (!mSignalExtractors.isEmpty()) {
        for (        NotificationSignalExtractor extractor : mSignalExtractors) {
          try {
            RankingReconsideration recon=extractor.process(r);
            scheduleRankingReconsideration(recon);
          }
 catch (          Throwable t) {
            Slog.w(TAG,"String_Node_Str",t);
          }
        }
      }
      if (ENABLE_BLOCKED_NOTIFICATIONS && !noteNotificationOp(pkg,callingUid)) {
        if (!isSystemNotification) {
          r.score=JUNK_SCORE;
          Slog.e(TAG,"String_Node_Str" + pkg + "String_Node_Str");
        }
      }
      if (r.score < SCORE_DISPLAY_THRESHOLD) {
        return;
      }
synchronized (mNotificationList) {
        int index=indexOfNotificationLocked(n.getKey());
        if (index < 0) {
          mNotificationList.add(r);
          mUsageStats.registerPostedByApp(r);
        }
 else {
          old=mNotificationList.get(index);
          mNotificationList.set(index,r);
          mUsageStats.registerUpdatedByApp(r,old);
          notification.flags|=old.getNotification().flags & Notification.FLAG_FOREGROUND_SERVICE;
          mNotificationsByKey.remove(old.sbn.getKey());
          r.isUpdate=true;
        }
        mNotificationsByKey.put(n.getKey(),r);
        if ((notification.flags & Notification.FLAG_FOREGROUND_SERVICE) != 0) {
          notification.flags|=Notification.FLAG_ONGOING_EVENT | Notification.FLAG_NO_CLEAR;
        }
        applyZenModeLocked(r);
        Collections.sort(mNotificationList,mRankingComparator);
        if (notification.icon != 0) {
          mListeners.notifyPostedLocked(n);
        }
 else {
          Slog.e(TAG,"String_Node_Str" + notification);
          if (old != null && !old.isCanceled) {
            mListeners.notifyRemovedLocked(n);
          }
          Slog.e(TAG,"String_Node_Str" + n.getPackageName());
        }
        buzzBeepBlinkLocked(r);
      }
    }
  }
);
  idOut[0]=id;
}