speech: Remove hard-coded preference key from the controllers

OnDeviceRecognitionPreferenceController and TtsPreferenceController
had their preference keys hard-coded which was breaking
AccessibilitySettingsTest. The key is now left to be read
from the super constructor.

Bug: 283449837
Test: Manual, already existing robotests
Change-Id: Ibe11a2134fffea0a081ca9f5e2f9441911574efa
This commit is contained in:
Aleksandar Kiridzic
2023-05-19 21:11:19 +01:00
parent 03e8dbca58
commit 30fd927eba
3 changed files with 7 additions and 24 deletions

View File

@@ -26,15 +26,9 @@ import com.android.settings.core.BasePreferenceController;
public class TtsPreferenceController extends BasePreferenceController {
private static final String KEY_TEXT_TO_SPEECH = "tts_settings_summary";
@VisibleForTesting
TtsEngines mTtsEngines;
public TtsPreferenceController(Context context) {
this(context, KEY_TEXT_TO_SPEECH);
}
public TtsPreferenceController(Context context, String key) {
super(context, key);
mTtsEngines = new TtsEngines(context);
@@ -46,8 +40,4 @@ public class TtsPreferenceController extends BasePreferenceController {
mContext.getResources().getBoolean(R.bool.config_show_tts_settings_summary)
? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
}
public String getPreferenceKey() {
return KEY_TEXT_TO_SPEECH;
}
}
}