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:
@@ -33,16 +33,10 @@ import java.util.Optional;
|
||||
/** Controller of the On-device recognition preference. */
|
||||
public class OnDeviceRecognitionPreferenceController extends BasePreferenceController {
|
||||
|
||||
private static final String KEY_ON_DEVICE_RECOGNITION = "on_device_recognition_settings";
|
||||
|
||||
private static final String TAG = "OnDeviceRecognitionPreferenceController";
|
||||
|
||||
private Optional<Intent> mIntent;
|
||||
|
||||
public OnDeviceRecognitionPreferenceController(Context context) {
|
||||
this(context, KEY_ON_DEVICE_RECOGNITION);
|
||||
}
|
||||
|
||||
public OnDeviceRecognitionPreferenceController(Context context, String preferenceKey) {
|
||||
super(context, preferenceKey);
|
||||
}
|
||||
@@ -57,10 +51,6 @@ public class OnDeviceRecognitionPreferenceController extends BasePreferenceContr
|
||||
: CONDITIONALLY_UNAVAILABLE;
|
||||
}
|
||||
|
||||
public String getPreferenceKey() {
|
||||
return KEY_ON_DEVICE_RECOGNITION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateState(Preference preference) {
|
||||
super.updateState(preference);
|
||||
@@ -140,4 +130,4 @@ public class OnDeviceRecognitionPreferenceController extends BasePreferenceContr
|
||||
|
||||
return new Intent(Intent.ACTION_MAIN).setComponent(chosenRecognizer.mSettings);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user