Program: 88237
Project: 88237
Buggy source:
private void showVoiceWarningDialog(final boolean swipe,IBinder token,final boolean configurationChanging){
  AlertDialog.Builder builder=new AlertDialog.Builder(mContext);
  builder.setCancelable(true);
  builder.setIcon(R.drawable.ic_mic_dialog);
  builder.setPositiveButton(android.R.string.ok,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int whichButton){
      mVoiceInput.logKeyboardWarningDialogOk();
      reallyStartListening(swipe,configurationChanging);
    }
  }
);
  builder.setNegativeButton(android.R.string.cancel,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int whichButton){
      mVoiceInput.logKeyboardWarningDialogCancel();
    }
  }
);
  if (mLocaleSupportedForVoiceInput) {
    String message=mContext.getString(R.string.voice_warning_may_not_understand) + "String_Node_Str" + mContext.getString(R.string.voice_warning_how_to_turn_off);
    builder.setMessage(message);
  }
 else {
    String message=mContext.getString(R.string.voice_warning_locale_not_supported) + "String_Node_Str" + mContext.getString(R.string.voice_warning_may_not_understand)+ "String_Node_Str"+ mContext.getString(R.string.voice_warning_how_to_turn_off);
    builder.setMessage(message);
  }
  builder.setTitle(R.string.voice_warning_title);
  mVoiceWarningDialog=builder.create();
  Window window=mVoiceWarningDialog.getWindow();
  WindowManager.LayoutParams lp=window.getAttributes();
  lp.token=token;
  lp.type=WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG;
  window.setAttributes(lp);
  window.addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
  mVoiceInput.logKeyboardWarningDialogShown();
  mVoiceWarningDialog.show();
}

Fixed version (ground truth):
private void showVoiceWarningDialog(final boolean swipe,IBinder token,final boolean configurationChanging){
  if (mVoiceWarningDialog != null && mVoiceWarningDialog.isShowing()) {
    return;
  }
  AlertDialog.Builder builder=new AlertDialog.Builder(mContext);
  builder.setCancelable(true);
  builder.setIcon(R.drawable.ic_mic_dialog);
  builder.setPositiveButton(android.R.string.ok,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int whichButton){
      mVoiceInput.logKeyboardWarningDialogOk();
      reallyStartListening(swipe,configurationChanging);
    }
  }
);
  builder.setNegativeButton(android.R.string.cancel,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int whichButton){
      mVoiceInput.logKeyboardWarningDialogCancel();
      switchToLastInputMethod();
    }
  }
);
  builder.setOnCancelListener(new DialogInterface.OnCancelListener(){
    @Override public void onCancel(    DialogInterface arg0){
      mVoiceInput.logKeyboardWarningDialogCancel();
      switchToLastInputMethod();
    }
  }
);
  if (mLocaleSupportedForVoiceInput) {
    String message=mContext.getString(R.string.voice_warning_may_not_understand) + "String_Node_Str" + mContext.getString(R.string.voice_warning_how_to_turn_off);
    builder.setMessage(message);
  }
 else {
    String message=mContext.getString(R.string.voice_warning_locale_not_supported) + "String_Node_Str" + mContext.getString(R.string.voice_warning_may_not_understand)+ "String_Node_Str"+ mContext.getString(R.string.voice_warning_how_to_turn_off);
    builder.setMessage(message);
  }
  builder.setTitle(R.string.voice_warning_title);
  mVoiceWarningDialog=builder.create();
  Window window=mVoiceWarningDialog.getWindow();
  WindowManager.LayoutParams lp=window.getAttributes();
  lp.token=token;
  lp.type=WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG;
  window.setAttributes(lp);
  window.addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
  mVoiceInput.logKeyboardWarningDialogShown();
  mVoiceWarningDialog.show();
}