Remove Language and Input duplicates

Change the keys in the Language and Input screen for the
gesture and tts-output settings so they can be disabled
in search. Then change the preference controllers to take
a key as input to avoid crashes on the other screens with
these settings.

Test: make RunSettingsRoboTests
Bug: 33701673
Change-Id: Ifeb2a2d34a3efded3f0a9ba02ac76fd6f8ffd087
Merged-In: I8bc0776131fcac5a6edf7e8271bc53252c2fc719
This commit is contained in:
Matthew Fritze
2017-04-11 16:35:48 -07:00
parent 3b2d98c714
commit b97a1bffa8
31 changed files with 204 additions and 92 deletions

View File

@@ -58,6 +58,14 @@ public class LanguageAndInputSettings extends DashboardFragment {
private static final String TAG = "LangAndInputSettings";
private static final String KEY_TEXT_TO_SPEECH = "tts_settings_summary";
private static final String KEY_ASSIST = "gesture_assist_input_summary";
private static final String KEY_SWIPE_DOWN = "gesture_swipe_down_fingerprint_input_summary";
private static final String KEY_DOUBLE_TAP_POWER = "gesture_double_tap_power_input_summary";
private static final String KEY_DOUBLE_TWIST = "gesture_double_twist_input_summary";
private static final String KEY_DOUBLE_TAP_SCREEN = "gesture_double_tap_screen_input_summary";
private static final String KEY_PICK_UP = "gesture_pick_up_input_summary";
private AmbientDisplayConfiguration mAmbientDisplayConfig;
@Override
@@ -110,14 +118,16 @@ public class LanguageAndInputSettings extends DashboardFragment {
controllers.add(gameControllerPreferenceController);
// Gestures
controllers.add(new AssistGesturePreferenceController(context, lifecycle));
controllers.add(new SwipeToNotificationPreferenceController(context, lifecycle));
controllers.add(new DoubleTwistPreferenceController(context, lifecycle));
controllers.add(new DoubleTapPowerPreferenceController(context, lifecycle));
controllers.add(new PickupGesturePreferenceController(
context, lifecycle, ambientDisplayConfiguration, UserHandle.myUserId()));
controllers.add(new DoubleTapScreenPreferenceController(
context, lifecycle, ambientDisplayConfiguration, UserHandle.myUserId()));
controllers.add(new AssistGesturePreferenceController(context, lifecycle, KEY_ASSIST));
controllers.add(new SwipeToNotificationPreferenceController(context, lifecycle,
KEY_SWIPE_DOWN));
controllers.add(new DoubleTwistPreferenceController(context, lifecycle, KEY_DOUBLE_TWIST));
controllers.add(new DoubleTapPowerPreferenceController(context, lifecycle,
KEY_DOUBLE_TAP_POWER));
controllers.add(new PickupGesturePreferenceController(context, lifecycle,
ambientDisplayConfiguration, UserHandle.myUserId(), KEY_PICK_UP));
controllers.add(new DoubleTapScreenPreferenceController(context, lifecycle,
ambientDisplayConfiguration, UserHandle.myUserId(), KEY_DOUBLE_TAP_SCREEN));
controllers.add(new DefaultAutofillPreferenceController(context));
return controllers;
}
@@ -179,5 +189,20 @@ public class LanguageAndInputSettings extends DashboardFragment {
return buildPreferenceControllers(context, null,
new AmbientDisplayConfiguration(context));
}
@Override
public List<String> getNonIndexableKeys(Context context) {
List<String> keys = super.getNonIndexableKeys(context);
// Duplicates in summary and details pages.
keys.add(KEY_TEXT_TO_SPEECH);
keys.add(KEY_ASSIST);
keys.add(KEY_SWIPE_DOWN);
keys.add(KEY_DOUBLE_TAP_POWER);
keys.add(KEY_DOUBLE_TWIST);
keys.add(KEY_DOUBLE_TAP_SCREEN);
keys.add(KEY_PICK_UP);
return keys;
}
};
}