Program: 192624
Project: 192624
Buggy source:
@Override public void performIdleMaintenance(){
  if (checkCallingPermission(android.Manifest.permission.SET_ACTIVITY_WATCHER) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.SET_ACTIVITY_WATCHER);
  }
synchronized (this) {
    final long now=SystemClock.uptimeMillis();
    final long timeSinceLastIdle=now - mLastIdleTime;
    final long lowRamSinceLastIdle=getLowRamTimeSinceIdle(now);
    mLastIdleTime=now;
    mLowRamTimeSinceLastIdle=0;
    if (mLowRamStartTime != 0) {
      mLowRamStartTime=now;
    }
    StringBuilder sb=new StringBuilder(128);
    sb.append("String_Node_Str");
    TimeUtils.formatDuration(timeSinceLastIdle,sb);
    sb.append("String_Node_Str");
    TimeUtils.formatDuration(lowRamSinceLastIdle,sb);
    Slog.i(TAG,sb.toString());
    boolean doKilling=lowRamSinceLastIdle > (timeSinceLastIdle / 3);
    for (int i=mLruProcesses.size() - 1; i >= 0; i--) {
      ProcessRecord proc=mLruProcesses.get(i);
      if (proc.notCachedSinceIdle) {
        if (proc.setProcState != ActivityManager.PROCESS_STATE_TOP_SLEEPING && proc.setProcState >= ActivityManager.PROCESS_STATE_FOREGROUND_SERVICE && proc.setProcState <= ActivityManager.PROCESS_STATE_SERVICE) {
          if (doKilling && proc.initialIdlePss != 0 && proc.lastPss > ((proc.initialIdlePss * 3) / 2)) {
            sb=new StringBuilder(128);
            sb.append("String_Node_Str");
            sb.append(proc.processName);
            sb.append("String_Node_Str");
            sb.append(proc.lastPss);
            sb.append("String_Node_Str");
            sb.append(proc.lastSwapPss);
            sb.append("String_Node_Str");
            sb.append(proc.initialIdlePss);
            sb.append("String_Node_Str");
            TimeUtils.formatDuration(timeSinceLastIdle,sb);
            sb.append("String_Node_Str");
            TimeUtils.formatDuration(lowRamSinceLastIdle,sb);
            Slog.wtfQuiet(TAG,sb.toString());
            proc.kill("String_Node_Str" + proc.lastPss + "String_Node_Str"+ proc.initialIdlePss+ "String_Node_Str",true);
          }
        }
      }
 else       if (proc.setProcState < ActivityManager.PROCESS_STATE_HOME) {
        proc.notCachedSinceIdle=true;
        proc.initialIdlePss=0;
        proc.nextPssTime=ProcessList.computeNextPssTime(proc.curProcState,true,mTestPssMode,isSleeping(),now);
      }
    }
    mHandler.removeMessages(REQUEST_ALL_PSS_MSG);
    mHandler.sendEmptyMessageDelayed(REQUEST_ALL_PSS_MSG,2 * 60 * 1000);
  }
}

Fixed version (ground truth):
@Override public void performIdleMaintenance(){
  if (checkCallingPermission(android.Manifest.permission.SET_ACTIVITY_WATCHER) != PackageManager.PERMISSION_GRANTED) {
    throw new SecurityException("String_Node_Str" + android.Manifest.permission.SET_ACTIVITY_WATCHER);
  }
synchronized (this) {
    final long now=SystemClock.uptimeMillis();
    final long timeSinceLastIdle=now - mLastIdleTime;
    final long lowRamSinceLastIdle=getLowRamTimeSinceIdle(now);
    mLastIdleTime=now;
    mLowRamTimeSinceLastIdle=0;
    if (mLowRamStartTime != 0) {
      mLowRamStartTime=now;
    }
    StringBuilder sb=new StringBuilder(128);
    sb.append("String_Node_Str");
    TimeUtils.formatDuration(timeSinceLastIdle,sb);
    sb.append("String_Node_Str");
    TimeUtils.formatDuration(lowRamSinceLastIdle,sb);
    Slog.i(TAG,sb.toString());
    boolean doKilling=lowRamSinceLastIdle > (timeSinceLastIdle / 3);
    for (int i=mLruProcesses.size() - 1; i >= 0; i--) {
      ProcessRecord proc=mLruProcesses.get(i);
      if (proc.notCachedSinceIdle) {
        if (proc.setProcState != ActivityManager.PROCESS_STATE_TOP_SLEEPING && proc.setProcState >= ActivityManager.PROCESS_STATE_FOREGROUND_SERVICE && proc.setProcState <= ActivityManager.PROCESS_STATE_SERVICE) {
          if (doKilling && proc.initialIdlePss != 0 && proc.lastPss > ((proc.initialIdlePss * 3) / 2)) {
            sb=new StringBuilder(128);
            sb.append("String_Node_Str");
            sb.append(proc.processName);
            sb.append("String_Node_Str");
            sb.append(proc.lastPss);
            sb.append("String_Node_Str");
            sb.append(proc.lastSwapPss);
            sb.append("String_Node_Str");
            sb.append(proc.initialIdlePss);
            sb.append("String_Node_Str");
            TimeUtils.formatDuration(timeSinceLastIdle,sb);
            sb.append("String_Node_Str");
            TimeUtils.formatDuration(lowRamSinceLastIdle,sb);
            Slog.wtfQuiet(TAG,sb.toString());
            proc.kill("String_Node_Str" + proc.lastPss + "String_Node_Str"+ proc.initialIdlePss+ "String_Node_Str",true);
          }
        }
      }
 else       if (proc.setProcState < ActivityManager.PROCESS_STATE_HOME && proc.setProcState > ActivityManager.PROCESS_STATE_NONEXISTENT) {
        proc.notCachedSinceIdle=true;
        proc.initialIdlePss=0;
        proc.nextPssTime=ProcessList.computeNextPssTime(proc.setProcState,true,mTestPssMode,isSleeping(),now);
      }
    }
    mHandler.removeMessages(REQUEST_ALL_PSS_MSG);
    mHandler.sendEmptyMessageDelayed(REQUEST_ALL_PSS_MSG,2 * 60 * 1000);
  }
}