Program: 184819
Project: 184819
Buggy source:
@Override protected void onCreate(Bundle icicle){
  super.onCreate(icicle);
  mPhone=PhoneFactory.getDefaultPhone();
  addPreferencesFromResource(R.xml.call_feature_setting);
  mAudioManager=(AudioManager)getSystemService(Context.AUDIO_SERVICE);
  PreferenceScreen prefSet=getPreferenceScreen();
  mSubMenuVoicemailSettings=(EditPhoneNumberPreference)findPreference(BUTTON_VOICEMAIL_KEY);
  if (mSubMenuVoicemailSettings != null) {
    mSubMenuVoicemailSettings.setParentActivity(this,VOICEMAIL_PREF_ID,this);
    mSubMenuVoicemailSettings.setDialogOnClosedListener(this);
    mSubMenuVoicemailSettings.setDialogTitle(R.string.voicemail_settings_number_label);
  }
  mButtonDTMF=(ListPreference)findPreference(BUTTON_DTMF_KEY);
  mButtonAutoRetry=(CheckBoxPreference)findPreference(BUTTON_RETRY_KEY);
  mButtonHAC=(CheckBoxPreference)findPreference(BUTTON_HAC_KEY);
  mButtonTTY=(ListPreference)findPreference(BUTTON_TTY_KEY);
  mVoicemailProviders=(ListPreference)findPreference(BUTTON_VOICEMAIL_PROVIDER_KEY);
  mVoicemailProviders.setOnPreferenceChangeListener(this);
  mVoicemailSettings=(PreferenceScreen)findPreference(BUTTON_VOICEMAIL_SETTING_KEY);
  initVoiceMailProviders();
  if (getResources().getBoolean(R.bool.dtmf_type_enabled)) {
    mButtonDTMF.setOnPreferenceChangeListener(this);
  }
 else {
    prefSet.removePreference(mButtonDTMF);
    mButtonDTMF=null;
  }
  if (getResources().getBoolean(R.bool.auto_retry_enabled)) {
    mButtonAutoRetry.setOnPreferenceChangeListener(this);
  }
 else {
    prefSet.removePreference(mButtonAutoRetry);
    mButtonAutoRetry=null;
  }
  if (getResources().getBoolean(R.bool.hac_enabled)) {
    mButtonHAC.setOnPreferenceChangeListener(this);
  }
 else {
    prefSet.removePreference(mButtonHAC);
    mButtonHAC=null;
  }
  if (getResources().getBoolean(R.bool.tty_enabled)) {
    mButtonTTY.setOnPreferenceChangeListener(this);
    ttyHandler=new TTYHandler();
  }
 else {
    prefSet.removePreference(mButtonTTY);
    mButtonTTY=null;
  }
  if (!getResources().getBoolean(R.bool.world_phone)) {
    prefSet.removePreference(prefSet.findPreference(BUTTON_CDMA_OPTIONS));
    prefSet.removePreference(prefSet.findPreference(BUTTON_GSM_UMTS_OPTIONS));
    if (mPhone.getPhoneName().equals("String_Node_Str")) {
      prefSet.removePreference(prefSet.findPreference(BUTTON_FDN_KEY));
      addPreferencesFromResource(R.xml.cdma_call_options);
    }
 else {
      addPreferencesFromResource(R.xml.gsm_umts_call_options);
    }
  }
  mContactListIntent=new Intent(Intent.ACTION_GET_CONTENT);
  mContactListIntent.setType(android.provider.Contacts.Phones.CONTENT_ITEM_TYPE);
  if (icicle == null) {
    if (getIntent().getAction().equals(ACTION_ADD_VOICEMAIL)) {
      if (mVMProvidersData.size() > 1) {
        simulatePreferenceClick(mVoicemailProviders);
      }
 else {
        mSubMenuVoicemailSettings.showPhoneNumberDialog();
      }
    }
  }
  updateVoiceNumberField();
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle icicle){
  super.onCreate(icicle);
  mPhone=PhoneFactory.getDefaultPhone();
  addPreferencesFromResource(R.xml.call_feature_setting);
  mAudioManager=(AudioManager)getSystemService(Context.AUDIO_SERVICE);
  PreferenceScreen prefSet=getPreferenceScreen();
  mSubMenuVoicemailSettings=(EditPhoneNumberPreference)findPreference(BUTTON_VOICEMAIL_KEY);
  if (mSubMenuVoicemailSettings != null) {
    mSubMenuVoicemailSettings.setParentActivity(this,VOICEMAIL_PREF_ID,this);
    mSubMenuVoicemailSettings.setDialogOnClosedListener(this);
    mSubMenuVoicemailSettings.setDialogTitle(R.string.voicemail_settings_number_label);
  }
  mButtonDTMF=(ListPreference)findPreference(BUTTON_DTMF_KEY);
  mButtonAutoRetry=(CheckBoxPreference)findPreference(BUTTON_RETRY_KEY);
  mButtonHAC=(CheckBoxPreference)findPreference(BUTTON_HAC_KEY);
  mButtonTTY=(ListPreference)findPreference(BUTTON_TTY_KEY);
  mVoicemailProviders=(ListPreference)findPreference(BUTTON_VOICEMAIL_PROVIDER_KEY);
  if (mVoicemailProviders != null) {
    mVoicemailProviders.setOnPreferenceChangeListener(this);
    mVoicemailSettings=(PreferenceScreen)findPreference(BUTTON_VOICEMAIL_SETTING_KEY);
    initVoiceMailProviders();
  }
  if (getResources().getBoolean(R.bool.dtmf_type_enabled)) {
    mButtonDTMF.setOnPreferenceChangeListener(this);
  }
 else {
    prefSet.removePreference(mButtonDTMF);
    mButtonDTMF=null;
  }
  if (getResources().getBoolean(R.bool.auto_retry_enabled)) {
    mButtonAutoRetry.setOnPreferenceChangeListener(this);
  }
 else {
    prefSet.removePreference(mButtonAutoRetry);
    mButtonAutoRetry=null;
  }
  if (getResources().getBoolean(R.bool.hac_enabled)) {
    mButtonHAC.setOnPreferenceChangeListener(this);
  }
 else {
    prefSet.removePreference(mButtonHAC);
    mButtonHAC=null;
  }
  if (getResources().getBoolean(R.bool.tty_enabled)) {
    mButtonTTY.setOnPreferenceChangeListener(this);
    ttyHandler=new TTYHandler();
  }
 else {
    prefSet.removePreference(mButtonTTY);
    mButtonTTY=null;
  }
  if (!getResources().getBoolean(R.bool.world_phone)) {
    prefSet.removePreference(prefSet.findPreference(BUTTON_CDMA_OPTIONS));
    prefSet.removePreference(prefSet.findPreference(BUTTON_GSM_UMTS_OPTIONS));
    if (mPhone.getPhoneName().equals("String_Node_Str")) {
      prefSet.removePreference(prefSet.findPreference(BUTTON_FDN_KEY));
      addPreferencesFromResource(R.xml.cdma_call_options);
    }
 else {
      addPreferencesFromResource(R.xml.gsm_umts_call_options);
    }
  }
  mContactListIntent=new Intent(Intent.ACTION_GET_CONTENT);
  mContactListIntent.setType(android.provider.Contacts.Phones.CONTENT_ITEM_TYPE);
  if (icicle == null) {
    if (getIntent().getAction().equals(ACTION_ADD_VOICEMAIL) && mVoicemailProviders != null) {
      if (mVMProvidersData.size() > 1) {
        simulatePreferenceClick(mVoicemailProviders);
      }
 else {
        mSubMenuVoicemailSettings.showPhoneNumberDialog();
      }
    }
  }
  updateVoiceNumberField();
}