From 6ad584877575b4904b9f180c399cf9661be7fd28 Mon Sep 17 00:00:00 2001 From: Matthew Fritze Date: Mon, 17 Apr 2017 07:55:41 -0700 Subject: [PATCH] Remove accessibility duplicates in settings search Merge for: ag/2148817 Bug: 33701673 Test: make RunSettingsRoboTests Change-Id: Idda6d2f98cb8d2cb91a9a4721b2ef84921f9056a --- res/xml/accessibility_magnification_settings.xml | 1 + .../accessibility/MagnificationPreferenceFragment.java | 10 ++++++++++ .../settings/search/BaseSearchIndexProviderTest.java | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/res/xml/accessibility_magnification_settings.xml b/res/xml/accessibility_magnification_settings.xml index 0f3c1190839..4083360a396 100644 --- a/res/xml/accessibility_magnification_settings.xml +++ b/res/xml/accessibility_magnification_settings.xml @@ -14,6 +14,7 @@ limitations under the License. --> getNonIndexableKeys(Context context) { + List keys = super.getNonIndexableKeys(context); + keys.add(PREFERENCE_TITLE_KEY); + return keys; + } }; } diff --git a/tests/robotests/src/com/android/settings/search/BaseSearchIndexProviderTest.java b/tests/robotests/src/com/android/settings/search/BaseSearchIndexProviderTest.java index 61750931e07..87eeced306c 100644 --- a/tests/robotests/src/com/android/settings/search/BaseSearchIndexProviderTest.java +++ b/tests/robotests/src/com/android/settings/search/BaseSearchIndexProviderTest.java @@ -60,7 +60,7 @@ public class BaseSearchIndexProviderTest { @Test public void getNonIndexableKeys_noPreferenceController_shouldReturnEmptyList() { - assertThat(mIndexProvider.getNonIndexableKeys(mContext)).isEqualTo(Collections.EMPTY_LIST); + assertThat(mIndexProvider.getNonIndexableKeys(mContext)).isEmpty(); } @Test