Program: 184730
Project: 184730
Buggy source:
private void onNewRingingConnection(AsyncResult r){
  Connection c=(Connection)r.result;
  if (DBG)   log("String_Node_Str" + c);
  boolean provisioned=Settings.Secure.getInt(mPhone.getContext().getContentResolver(),Settings.Secure.DEVICE_PROVISIONED,0) != 0;
  if (!provisioned) {
    Log.i(LOG_TAG,"String_Node_Str");
    PhoneUtils.hangupRingingCall(mPhone);
    return;
  }
  if (mPhone.getPhoneType() == Phone.PHONE_TYPE_CDMA) {
    boolean activateState=(mApplication.cdmaOtaScreenState.otaScreenState == OtaUtils.CdmaOtaScreenState.OtaScreenState.OTA_STATUS_ACTIVATION);
    boolean dialogState=(mApplication.cdmaOtaScreenState.otaScreenState == OtaUtils.CdmaOtaScreenState.OtaScreenState.OTA_STATUS_SUCCESS_FAILURE_DLG);
    boolean spcState=mApplication.cdmaOtaProvisionData.inOtaSpcState;
    if (spcState) {
      Log.i(LOG_TAG,"String_Node_Str");
      PhoneUtils.hangupRingingCall(mPhone);
      return;
    }
 else     if (activateState || dialogState) {
      if (dialogState)       mApplication.dismissOtaDialogs();
      mApplication.clearOtaState();
      mApplication.clearInCallScreenMode();
    }
  }
  if (c != null && c.isRinging()) {
    if (mPhone.getPhoneType() == Phone.PHONE_TYPE_CDMA) {
      stopSignalInfoTone();
    }
    Call.State state=c.getState();
    if (VDBG)     log("String_Node_Str" + state);
    if (VDBG)     log("String_Node_Str");
    mApplication.requestWakeState(PhoneApp.WakeState.PARTIAL);
    if (state == Call.State.INCOMING) {
      PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_RINGING);
      startIncomingCallQuery(c);
    }
 else {
      if (VDBG)       log("String_Node_Str");
      new InCallTonePlayer(InCallTonePlayer.TONE_CALL_WAITING).start();
      PhoneUtils.showIncomingCallUi();
    }
  }
  if (VDBG)   log("String_Node_Str");
}

Fixed version (ground truth):
private void onNewRingingConnection(AsyncResult r){
  Connection c=(Connection)r.result;
  if (DBG)   log("String_Node_Str" + c);
  boolean provisioned=Settings.Secure.getInt(mPhone.getContext().getContentResolver(),Settings.Secure.DEVICE_PROVISIONED,0) != 0;
  if (!provisioned) {
    Log.i(LOG_TAG,"String_Node_Str");
    PhoneUtils.hangupRingingCall(mPhone);
    return;
  }
  if (mPhone.getPhoneType() == Phone.PHONE_TYPE_CDMA) {
    boolean activateState=(mApplication.cdmaOtaScreenState.otaScreenState == OtaUtils.CdmaOtaScreenState.OtaScreenState.OTA_STATUS_ACTIVATION);
    boolean dialogState=(mApplication.cdmaOtaScreenState.otaScreenState == OtaUtils.CdmaOtaScreenState.OtaScreenState.OTA_STATUS_SUCCESS_FAILURE_DLG);
    boolean spcState=mApplication.cdmaOtaProvisionData.inOtaSpcState;
    if (spcState) {
      Log.i(LOG_TAG,"String_Node_Str");
      PhoneUtils.hangupRingingCall(mPhone);
      return;
    }
 else     if (activateState || dialogState) {
      if (dialogState)       mApplication.dismissOtaDialogs();
      mApplication.clearOtaState();
      mApplication.clearInCallScreenMode();
    }
  }
  if (c != null && c.isRinging()) {
    if (mPhone.getPhoneType() == Phone.PHONE_TYPE_CDMA) {
      stopSignalInfoTone();
    }
    Call.State state=c.getState();
    if (VDBG)     log("String_Node_Str" + state);
    if (VDBG)     log("String_Node_Str");
    mApplication.requestWakeState(PhoneApp.WakeState.PARTIAL);
    if (state == Call.State.INCOMING) {
      PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_RINGING);
      startIncomingCallQuery(c);
    }
 else {
      if (VDBG)       log("String_Node_Str");
      if (mCallWaitingTonePlayer == null) {
        mCallWaitingTonePlayer=new InCallTonePlayer(InCallTonePlayer.TONE_CALL_WAITING);
        mCallWaitingTonePlayer.start();
      }
      PhoneUtils.showIncomingCallUi();
    }
  }
  if (VDBG)   log("String_Node_Str");
}