Program: 184705
Project: 184705
Buggy source:
/** 
 * Implemented to support onPreferenceChangeListener to look for preference changes.
 * @param preference is the preference to be changed
 * @param objValue should be the value of the selection, NOT its localizeddisplay value.
 */
public boolean onPreferenceChange(Preference preference,Object objValue){
  if (preference == mButtonDTMF) {
    int index=mButtonDTMF.findIndexOfValue((String)objValue);
    Settings.System.putInt(mPhone.getContext().getContentResolver(),Settings.System.DTMF_TONE_TYPE_WHEN_DIALING,index);
  }
 else   if (preference == mButtonTTY) {
    handleTTYChange(preference,objValue);
  }
 else   if (preference == mVoicemailProviders) {
    final String currentProviderKey=getCurrentVoicemailProviderKey();
    final String newProviderKey=(String)objValue;
    if (DBG)     log("String_Node_Str" + newProviderKey + "String_Node_Str"+ mPreviousVMProviderKey);
    if (mPreviousVMProviderKey.equals(newProviderKey)) {
      if (DBG)       log("String_Node_Str");
      return true;
    }
    updateVMPreferenceWidgets(newProviderKey);
    mPreviousVMProviderKey=currentProviderKey;
    updateVMPreferenceWidgets(newProviderKey);
    final VoiceMailProviderSettings newProviderSettings=loadSettingsForVoiceMailProvider(newProviderKey);
    if (newProviderSettings == null) {
      if (DBG)       log("String_Node_Str");
      mVMProviderSettingsForced=true;
      simulatePreferenceClick(mVoicemailSettings);
    }
 else {
      if (DBG)       log("String_Node_Str");
      mChangingVMorFwdDueToProviderChange=true;
      saveVoiceMailAndForwardingNumber(newProviderKey,newProviderSettings);
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Implemented to support onPreferenceChangeListener to look for preference changes.
 * @param preference is the preference to be changed
 * @param objValue should be the value of the selection, NOT its localizeddisplay value.
 */
public boolean onPreferenceChange(Preference preference,Object objValue){
  if (preference == mButtonDTMF) {
    int index=mButtonDTMF.findIndexOfValue((String)objValue);
    Settings.System.putInt(mPhone.getContext().getContentResolver(),Settings.System.DTMF_TONE_TYPE_WHEN_DIALING,index);
  }
 else   if (preference == mButtonTTY) {
    handleTTYChange(preference,objValue);
  }
 else   if (preference == mVoicemailProviders) {
    final String currentProviderKey=getCurrentVoicemailProviderKey();
    final String newProviderKey=(String)objValue;
    if (DBG)     log("String_Node_Str" + newProviderKey + "String_Node_Str"+ mPreviousVMProviderKey);
    if (mPreviousVMProviderKey.equals(newProviderKey)) {
      if (DBG)       log("String_Node_Str");
      return true;
    }
    updateVMPreferenceWidgets(newProviderKey);
    mPreviousVMProviderKey=currentProviderKey;
    final VoiceMailProviderSettings newProviderSettings=loadSettingsForVoiceMailProvider(newProviderKey);
    if (newProviderSettings == null) {
      if (DBG)       log("String_Node_Str");
      mVMProviderSettingsForced=true;
      simulatePreferenceClick(mVoicemailSettings);
    }
 else {
      if (DBG)       log("String_Node_Str");
      mChangingVMorFwdDueToProviderChange=true;
      saveVoiceMailAndForwardingNumber(newProviderKey,newProviderSettings);
    }
  }
  return true;
}