Made following changes to Settings:

- Moved the Voice Input setting from Digital assistant app to Languages & input.
- Bundled Voice Input and Text-to-speech settings together under Speech
  category.

Bug: 218609449

Test: refactoring CL. Existing unit tests still pass.
Change-Id: I3107a410ed35685f5f1081cbe448b105b5c79c24
This commit is contained in:
Qi Cao
2022-01-27 14:51:35 -08:00
parent 0ee078d37a
commit 17ff2b25a5
8 changed files with 81 additions and 60 deletions

View File

@@ -44,8 +44,9 @@ public class LanguageAndInputSettings extends DashboardFragment {
private static final String TAG = "LangAndInputSettings";
private static final String KEY_KEYBOARDS_CATEGORY = "keyboards_category";
private static final String KEY_SPEECH_CATEGORY = "speech_category";
private static final String KEY_TEXT_TO_SPEECH = "tts_settings_summary";
private static final String KEY_POINTER_AND_TTS_CATEGORY = "pointer_and_tts_category";
private static final String KEY_POINTER_CATEGORY = "pointer_category";
@Override
public int getMetricsCategory() {
@@ -98,15 +99,22 @@ public class LanguageAndInputSettings extends DashboardFragment {
Arrays.asList(virtualKeyboardPreferenceController,
physicalKeyboardPreferenceController)));
// Pointer and Tts
// Speech
final DefaultVoiceInputPreferenceController defaultVoiceInputPreferenceController =
new DefaultVoiceInputPreferenceController(context, lifecycle);
final TtsPreferenceController ttsPreferenceController =
new TtsPreferenceController(context, KEY_TEXT_TO_SPEECH);
controllers.add(defaultVoiceInputPreferenceController);
controllers.add(ttsPreferenceController);
controllers.add(new PreferenceCategoryController(context,
KEY_SPEECH_CATEGORY).setChildren(
Arrays.asList(defaultVoiceInputPreferenceController, ttsPreferenceController)));
// Pointer
final PointerSpeedController pointerController = new PointerSpeedController(context);
controllers.add(pointerController);
controllers.add(new PreferenceCategoryController(context,
KEY_POINTER_AND_TTS_CATEGORY).setChildren(
Arrays.asList(pointerController, ttsPreferenceController)));
KEY_POINTER_CATEGORY).setChildren(Arrays.asList(pointerController)));
// Input Assistance
controllers.add(new SpellCheckerPreferenceController(context));