Program: 36935
Project: 36935
Buggy source:
/** 
 * The call has transitioned to another state. We can now visually update the view with extra info or perform required actions.
 * @param newStatus the new interaction state to which we should act.
 * @see SipConstants for the possible states.
 */
private void onCallStatusUpdate(String newStatus){
  mRemoteLogger.d(TAG + "String_Node_Str" + newStatus);
switch (newStatus) {
case CALL_MEDIA_AVAILABLE_MESSAGE:
    onCallStatusUpdate(CALL_STOP_RINGBACK_MESSAGE);
  break;
case CALL_CONNECTED_MESSAGE:
toggleCallStateButtonVisibility(TYPE_CONNECTED_CALL);
mStateView.setText(R.string.call_connected);
mCallStartTime=System.currentTimeMillis();
mCallHandler.postDelayed(mCallDurationRunnable,0);
mConnected=true;
mHasConnected=true;
mIncomingCallIsRinging=false;
mProximityHelper.updateWakeLock();
break;
case CALL_DISCONNECTED_MESSAGE:
onCallStatusUpdate(CALL_STOP_RINGBACK_MESSAGE);
if (!mHasConnected) {
mStateView.setText(R.string.call_unreachable);
}
 else {
mStateView.setText(R.string.call_ended);
}
mAudioManager.setSpeakerphoneOn(false);
mCallHandler.removeCallbacks(mCallDurationRunnable);
mConnected=false;
mIncomingCallIsRinging=false;
playRingtone(false);
vibrate(false);
finishWithDelay();
break;
case CALL_PUT_ON_HOLD_ACTION:
mCallHandler.removeCallbacks(mCallDurationRunnable);
mCallDurationView.setVisibility(View.INVISIBLE);
mStateView.setText(R.string.call_on_hold);
break;
case CALL_UNHOLD_ACTION:
mCallHandler.postDelayed(mCallDurationRunnable,0);
mCallDurationView.setVisibility(View.VISIBLE);
mStateView.setText(R.string.call_connected);
break;
case CALL_RINGING_OUT_MESSAGE:
mStateView.setText(R.string.call_outgoing);
findViewById(R.id.button_speaker).setEnabled(false);
findViewById(R.id.button_microphone).setEnabled(false);
break;
case CALL_RINGING_IN_MESSAGE:
mStateView.setText(R.string.call_incoming);
break;
case SERVICE_STOPPED:
mConnected=false;
mIncomingCallIsRinging=false;
finishWithDelay();
break;
}
}

Fixed version (ground truth):
/** 
 * The call has transitioned to another state. We can now visually update the view with extra info or perform required actions.
 * @param newStatus the new interaction state to which we should act.
 * @see SipConstants for the possible states.
 */
private void onCallStatusUpdate(String newStatus){
  mRemoteLogger.d(TAG + "String_Node_Str" + newStatus);
switch (newStatus) {
case CALL_MEDIA_AVAILABLE_MESSAGE:
    onCallStatusUpdate(CALL_STOP_RINGBACK_MESSAGE);
  break;
case CALL_CONNECTED_MESSAGE:
toggleCallStateButtonVisibility(TYPE_CONNECTED_CALL);
mStateView.setText(R.string.call_connected);
mCallStartTime=System.currentTimeMillis();
mCallHandler.postDelayed(mCallDurationRunnable,0);
mConnected=true;
mHasConnected=true;
mIncomingCallIsRinging=false;
mProximityHelper.updateWakeLock();
break;
case CALL_DISCONNECTED_MESSAGE:
onCallStatusUpdate(CALL_STOP_RINGBACK_MESSAGE);
if (!mHasConnected && !mSelfHangup) {
mStateView.setText(R.string.call_unreachable);
}
 else {
mStateView.setText(R.string.call_ended);
}
mAudioManager.setSpeakerphoneOn(false);
mCallHandler.removeCallbacks(mCallDurationRunnable);
mConnected=false;
mIncomingCallIsRinging=false;
playRingtone(false);
vibrate(false);
finishWithDelay();
break;
case CALL_PUT_ON_HOLD_ACTION:
mCallHandler.removeCallbacks(mCallDurationRunnable);
mCallDurationView.setVisibility(View.INVISIBLE);
mStateView.setText(R.string.call_on_hold);
break;
case CALL_UNHOLD_ACTION:
mCallHandler.postDelayed(mCallDurationRunnable,0);
mCallDurationView.setVisibility(View.VISIBLE);
mStateView.setText(R.string.call_connected);
break;
case CALL_RINGING_OUT_MESSAGE:
mStateView.setText(R.string.call_outgoing);
findViewById(R.id.button_speaker).setEnabled(false);
findViewById(R.id.button_microphone).setEnabled(false);
break;
case CALL_RINGING_IN_MESSAGE:
mStateView.setText(R.string.call_incoming);
break;
case SERVICE_STOPPED:
mConnected=false;
mIncomingCallIsRinging=false;
finishWithDelay();
break;
}
}