Program: 184865
Project: 184865
Buggy source:
void updateInCallNotification(){
  int resId;
  if (DBG)   log("String_Node_Str");
  if (mPhone.getState() != Phone.State.OFFHOOK) {
    return;
  }
  final boolean hasActiveCall=!mPhone.getForegroundCall().isIdle();
  final boolean hasHoldingCall=!mPhone.getBackgroundCall().isIdle();
  boolean enhancedVoicePrivacy=PhoneApp.getInstance().notifier.getCdmaVoicePrivacyState();
  if (!hasActiveCall && hasHoldingCall) {
    if (enhancedVoicePrivacy) {
      resId=android.R.drawable.stat_sys_vp_phone_call_on_hold;
    }
 else {
      resId=android.R.drawable.stat_sys_phone_call_on_hold;
    }
  }
 else   if (PhoneApp.getInstance().showBluetoothIndication()) {
    if (enhancedVoicePrivacy) {
      resId=com.android.internal.R.drawable.stat_sys_vp_phone_call_bluetooth;
    }
 else {
      resId=com.android.internal.R.drawable.stat_sys_phone_call_bluetooth;
    }
  }
 else {
    if (enhancedVoicePrivacy) {
      resId=android.R.drawable.stat_sys_vp_phone_call;
    }
 else {
      resId=android.R.drawable.stat_sys_phone_call;
    }
  }
  if (DBG)   log("String_Node_Str" + resId);
  mInCallResId=resId;
  int expandedViewIcon=mInCallResId;
  Call currentCall=hasActiveCall ? mPhone.getForegroundCall() : mPhone.getBackgroundCall();
  Connection currentConn=currentCall.getEarliestConnection();
  Notification notification=new Notification();
  notification.icon=mInCallResId;
  notification.contentIntent=PendingIntent.getActivity(mContext,0,PhoneApp.createInCallIntent(),0);
  notification.flags|=Notification.FLAG_ONGOING_EVENT;
  RemoteViews contentView=new RemoteViews(mContext.getPackageName(),R.layout.ongoing_call_notification);
  contentView.setImageViewResource(R.id.icon,expandedViewIcon);
  if (currentConn != null) {
    long callDurationMsec=currentConn.getDurationMillis();
    long chronometerBaseTime=SystemClock.elapsedRealtime() - callDurationMsec;
    String expandedViewLine1;
    if (hasHoldingCall && !hasActiveCall) {
      expandedViewLine1=mContext.getString(R.string.notification_on_hold);
    }
 else {
      expandedViewLine1=mContext.getString(R.string.notification_ongoing_call_format);
    }
    if (DBG)     log("String_Node_Str" + expandedViewLine1 + "String_Node_Str");
    contentView.setChronometer(R.id.text1,chronometerBaseTime,expandedViewLine1,true);
  }
 else   if (DBG) {
    log("String_Node_Str");
  }
  String expandedViewLine2="String_Node_Str";
  if (PhoneUtils.isConferenceCall(currentCall)) {
    expandedViewLine2=mContext.getString(R.string.card_title_conf_call);
  }
 else {
    PhoneUtils.CallerInfoToken cit=PhoneUtils.startGetCallerInfo(mContext,currentCall,this,contentView);
    expandedViewLine2=PhoneUtils.getCompactNameFromCallerInfo(cit.currentInfo,mContext);
  }
  if (DBG)   log("String_Node_Str" + expandedViewLine2 + "String_Node_Str");
  contentView.setTextViewText(R.id.text2,expandedViewLine2);
  notification.contentView=contentView;
  if (DBG)   log("String_Node_Str" + notification);
  mNotificationMgr.notify(IN_CALL_NOTIFICATION,notification);
  updateSpeakerNotification();
  updateMuteNotification();
}

Fixed version (ground truth):
void updateInCallNotification(){
  int resId;
  if (DBG)   log("String_Node_Str");
  if (mPhone.getState() != Phone.State.OFFHOOK) {
    return;
  }
  final boolean hasActiveCall=!mPhone.getForegroundCall().isIdle();
  final boolean hasHoldingCall=!mPhone.getBackgroundCall().isIdle();
  boolean enhancedVoicePrivacy=PhoneApp.getInstance().notifier.getCdmaVoicePrivacyState();
  if (DBG)   log("String_Node_Str" + enhancedVoicePrivacy);
  if (!hasActiveCall && hasHoldingCall) {
    if (enhancedVoicePrivacy) {
      resId=android.R.drawable.stat_sys_vp_phone_call_on_hold;
    }
 else {
      resId=android.R.drawable.stat_sys_phone_call_on_hold;
    }
  }
 else   if (PhoneApp.getInstance().showBluetoothIndication()) {
    if (enhancedVoicePrivacy) {
      resId=com.android.internal.R.drawable.stat_sys_vp_phone_call_bluetooth;
    }
 else {
      resId=com.android.internal.R.drawable.stat_sys_phone_call_bluetooth;
    }
  }
 else {
    if (enhancedVoicePrivacy) {
      resId=android.R.drawable.stat_sys_vp_phone_call;
    }
 else {
      resId=android.R.drawable.stat_sys_phone_call;
    }
  }
  if (DBG)   log("String_Node_Str" + resId);
  mInCallResId=resId;
  int expandedViewIcon=mInCallResId;
  Call currentCall=hasActiveCall ? mPhone.getForegroundCall() : mPhone.getBackgroundCall();
  Connection currentConn=currentCall.getEarliestConnection();
  Notification notification=new Notification();
  notification.icon=mInCallResId;
  notification.contentIntent=PendingIntent.getActivity(mContext,0,PhoneApp.createInCallIntent(),0);
  notification.flags|=Notification.FLAG_ONGOING_EVENT;
  RemoteViews contentView=new RemoteViews(mContext.getPackageName(),R.layout.ongoing_call_notification);
  contentView.setImageViewResource(R.id.icon,expandedViewIcon);
  if (currentConn != null) {
    long callDurationMsec=currentConn.getDurationMillis();
    long chronometerBaseTime=SystemClock.elapsedRealtime() - callDurationMsec;
    String expandedViewLine1;
    if (hasHoldingCall && !hasActiveCall) {
      expandedViewLine1=mContext.getString(R.string.notification_on_hold);
    }
 else {
      expandedViewLine1=mContext.getString(R.string.notification_ongoing_call_format);
    }
    if (DBG)     log("String_Node_Str" + expandedViewLine1 + "String_Node_Str");
    contentView.setChronometer(R.id.text1,chronometerBaseTime,expandedViewLine1,true);
  }
 else   if (DBG) {
    log("String_Node_Str");
  }
  String expandedViewLine2="String_Node_Str";
  if (PhoneUtils.isConferenceCall(currentCall)) {
    expandedViewLine2=mContext.getString(R.string.card_title_conf_call);
  }
 else {
    PhoneUtils.CallerInfoToken cit=PhoneUtils.startGetCallerInfo(mContext,currentCall,this,contentView);
    expandedViewLine2=PhoneUtils.getCompactNameFromCallerInfo(cit.currentInfo,mContext);
  }
  if (DBG)   log("String_Node_Str" + expandedViewLine2 + "String_Node_Str");
  contentView.setTextViewText(R.id.text2,expandedViewLine2);
  notification.contentView=contentView;
  if (DBG)   log("String_Node_Str" + notification);
  mNotificationMgr.notify(IN_CALL_NOTIFICATION,notification);
  updateSpeakerNotification();
  updateMuteNotification();
}