Merge "Fix a pseudo race condition in TtsEngineSettingsFragment." into ics-mr1

This commit is contained in:
Justin Ho
2012-01-20 14:40:04 -08:00
committed by Android (Google) Code Review

View File

@@ -155,13 +155,22 @@ public class TtsEnginePreference extends Preference {
} }
}); });
if (mVoiceCheckData != null) {
mSettingsIcon.setEnabled(mRadioButton.isChecked());
}
return view; return view;
} }
public void setVoiceDataDetails(Intent data) { public void setVoiceDataDetails(Intent data) {
mVoiceCheckData = data; mVoiceCheckData = data;
// This might end up running before getView aboive, in which
// case mSettingsIcon && mRadioButton will be null. In this case
// getView will set the right values.
if (mSettingsIcon != null && mRadioButton != null) {
mSettingsIcon.setEnabled(mRadioButton.isChecked()); mSettingsIcon.setEnabled(mRadioButton.isChecked());
} }
}
private void onRadioButtonClicked(CompoundButton buttonView, boolean isChecked) { private void onRadioButtonClicked(CompoundButton buttonView, boolean isChecked) {
if (mPreventRadioButtonCallbacks) { if (mPreventRadioButtonCallbacks) {