Cannot switch between multiple TTS engines
That is caused by layout xml changes. The radio button was clickable in old xml resource. But it is not clickable in new xml resource. Therefore we can't receive click callback. Fixed by changing Radio button state when preference is clicked. Fixes: 135285101 Test: manual, make RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.tts" Change-Id: Idd7bf37d9ccbc1b56d41978d19dc05c8a81cc49a
This commit is contained in:
@@ -30,6 +30,8 @@ import androidx.preference.PreferenceViewHolder;
|
||||
|
||||
import com.android.settings.R;
|
||||
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
|
||||
|
||||
public class TtsEnginePreference extends Preference {
|
||||
|
||||
@@ -45,6 +47,7 @@ public class TtsEnginePreference extends Preference {
|
||||
* The shared radio button state, which button is checked etc.
|
||||
*/
|
||||
private final RadioButtonGroupState mSharedState;
|
||||
private RadioButton mRadioButton;
|
||||
|
||||
/**
|
||||
* When true, the change callbacks on the radio button will not
|
||||
@@ -95,6 +98,12 @@ public class TtsEnginePreference extends Preference {
|
||||
mPreventRadioButtonCallbacks = true;
|
||||
rb.setChecked(isChecked);
|
||||
mPreventRadioButtonCallbacks = false;
|
||||
mRadioButton = rb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick() {
|
||||
mRadioButton.setChecked(true);
|
||||
}
|
||||
|
||||
private boolean shouldDisplayDataAlert() {
|
||||
|
Reference in New Issue
Block a user