Fix some long forgottten TTS settings bugs
- Handle radio button clicks correctly - Handle injecting voice data correctly bug:5998256 bug:5938852 bug:5998418 Change-Id: Ib30afa6558e51ac9a88e28c51500ebaad93ad7fe
This commit is contained in:
@@ -16,8 +16,6 @@
|
||||
|
||||
package com.android.settings.tts;
|
||||
|
||||
import com.android.settings.R;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
@@ -31,6 +29,9 @@ import android.widget.CompoundButton;
|
||||
import android.widget.RadioButton;
|
||||
|
||||
|
||||
import com.android.settings.R;
|
||||
|
||||
|
||||
public class TtsEnginePreference extends Preference {
|
||||
|
||||
/**
|
||||
@@ -173,7 +174,8 @@ public class TtsEnginePreference extends Preference {
|
||||
}
|
||||
|
||||
private void onRadioButtonClicked(CompoundButton buttonView, boolean isChecked) {
|
||||
if (mPreventRadioButtonCallbacks) {
|
||||
if (mPreventRadioButtonCallbacks ||
|
||||
(mSharedState.getCurrentChecked() == buttonView)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -63,7 +63,6 @@ public class TtsEngineSettingsFragment extends SettingsPreferenceFragment implem
|
||||
@Override
|
||||
public void run() {
|
||||
mLocalePreference.setEnabled(true);
|
||||
updateVoiceDetails();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -103,6 +102,9 @@ public class TtsEngineSettingsFragment extends SettingsPreferenceFragment implem
|
||||
mInstallVoicesPreference.setEnabled(false);
|
||||
|
||||
mLocalePreference.setEnabled(false);
|
||||
|
||||
updateVoiceDetails();
|
||||
|
||||
mTts = new TextToSpeech(getActivity().getApplicationContext(), mTtsInitListener,
|
||||
getEngineName());
|
||||
}
|
||||
@@ -117,9 +119,10 @@ public class TtsEngineSettingsFragment extends SettingsPreferenceFragment implem
|
||||
final Intent voiceDataDetails = getArguments().getParcelable(
|
||||
TtsEnginePreference.FRAGMENT_ARGS_VOICES);
|
||||
if (DBG) Log.d(TAG, "Parsing voice data details, data: " + voiceDataDetails.toUri(0));
|
||||
ArrayList<String> available = voiceDataDetails.getStringArrayListExtra(
|
||||
|
||||
final ArrayList<String> available = voiceDataDetails.getStringArrayListExtra(
|
||||
TextToSpeech.Engine.EXTRA_AVAILABLE_VOICES);
|
||||
ArrayList<String> unavailable = voiceDataDetails.getStringArrayListExtra(
|
||||
final ArrayList<String> unavailable = voiceDataDetails.getStringArrayListExtra(
|
||||
TextToSpeech.Engine.EXTRA_UNAVAILABLE_VOICES);
|
||||
|
||||
if (available == null){
|
||||
|
Reference in New Issue
Block a user