Misc clean up in search

- Remove updateFromClassNameResource() because it's just a no-op method.
- Simplify SearchIndexResources
- Update some pref pages to have unique keys.

Change-Id: I51e542d9947aafd046861ce7be0b4c7213fcd01d
Fixes: 64951285
Test: UniquePreferenceKeyTest
Test: robotest
Bug: 67852637
This commit is contained in:
Fan Zhang
2017-10-26 15:56:41 -07:00
parent 73bce67552
commit 823dde54c7
57 changed files with 124 additions and 127 deletions

View File

@@ -15,6 +15,7 @@
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:key="accessibility_settings_screen"
android:title="@string/accessibility_settings"
android:persistent="true">

View File

@@ -16,11 +16,13 @@
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/ambient_display_screen_title">
xmlns:android="http://schemas.android.com/apk/res/android"
android:key="ambient_display_preference_screen"
android:title="@string/ambient_display_screen_title">
<PreferenceCategory
android:title="@string/ambient_display_category_triggers">
android:key="ambient_display_category_when_to_show"
android:title="@string/ambient_display_category_triggers">
<SwitchPreference
android:key="ambient_display_always_on"
@@ -39,7 +41,8 @@
</PreferenceCategory>
<PreferenceCategory>
<PreferenceCategory
android:key="ambient_display_category_notification">
<SwitchPreference
android:key="ambient_display_notification"

View File

@@ -18,6 +18,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:key="apps_and_notification_screen"
android:title="@string/app_and_notification_dashboard_title">
<PreferenceCategory

View File

@@ -18,6 +18,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:key="app_default_settings_screen"
android:title="@string/app_default_dashboard_title">
<Preference

View File

@@ -16,6 +16,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:key="connected_devices_screen"
android:title="@string/connected_devices_dashboard_title">
<com.android.settings.widget.MasterSwitchPreference

View File

@@ -14,11 +14,14 @@
limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="data_usage_screen"
android:title="@string/data_usage_summary_title">
<PreferenceCategory
android:key="data_usage_category"
android:title="@string/usage">
<com.android.settings.SummaryPreference

View File

@@ -16,6 +16,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:key="data_usage_cellular_screen"
android:title="@string/data_usage_summary_title">
<com.android.settings.datausage.TemplatePreferenceCategory

View File

@@ -16,6 +16,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:key="data_usage_wifi_screen"
android:title="@string/data_usage_summary_title">
<com.android.settings.datausage.TemplatePreferenceCategory

View File

@@ -17,6 +17,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:key="date_time_settings_screen"
android:title="@string/date_and_time"
settings:keywords="@string/keywords_date_and_time">

View File

@@ -15,6 +15,7 @@
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:key="device_info_pref_screen"
android:title="@string/about_settings">
<!-- System update settings - launches activity -->

View File

@@ -16,6 +16,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:key="device_status_screen"
android:title="@string/device_status_activity_title">
<Preference

View File

@@ -17,6 +17,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:key="display_settings_screen"
android:title="@string/display_settings"
settings:keywords="@string/keywords_display">

View File

@@ -15,9 +15,11 @@
limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:title="@string/double_tap_power_for_camera_title">
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:key="gesture_double_tap_power_screen"
android:title="@string/double_tap_power_for_camera_title">
<com.android.settings.widget.VideoPreference
android:key="gesture_double_tap_power_video"

View File

@@ -15,19 +15,21 @@
limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:title="@string/ambient_display_title">
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:key="gesture_double_tap_screen_screen"
android:title="@string/ambient_display_title">
<com.android.settings.widget.VideoPreference
android:key="gesture_double_tap_screen_video"
app:animation="@raw/gesture_ambient_tap"
app:preview="@drawable/gesture_ambient_tap"/>
app:preview="@drawable/gesture_ambient_tap" />
<SwitchPreference
android:key="gesture_double_tap_screen"
android:title="@string/ambient_display_title"
android:summary="@string/ambient_display_summary"
app:keywords="@string/keywords_gesture"/>
app:keywords="@string/keywords_gesture" />
</PreferenceScreen>

View File

@@ -15,19 +15,21 @@
limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:title="@string/double_twist_for_camera_mode_title">
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:key="gesture_double_twist_screen"
android:title="@string/double_twist_for_camera_mode_title">
<com.android.settings.widget.VideoPreference
android:key="gesture_double_twist_video"
app:animation="@raw/gesture_twist"
app:preview="@drawable/gesture_twist"/>
app:preview="@drawable/gesture_twist" />
<SwitchPreference
android:key="gesture_double_twist"
android:title="@string/double_twist_for_camera_mode_title"
android:summary="@string/double_twist_for_camera_mode_summary"
app:keywords="@string/keywords_gesture"/>
app:keywords="@string/keywords_gesture" />
</PreferenceScreen>

View File

@@ -16,7 +16,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:key="dream_overview_screen"
android:title="@string/screensaver_settings_title" >
<com.android.settings.widget.GearPreference
@@ -31,7 +31,8 @@
<!-- Layout preference doesn't obey allowDividerAbove, so put it in a PreferenceCategory -->
<PreferenceCategory>
<PreferenceCategory
android:key="dream_start_now_category">
<com.android.settings.applications.LayoutPreference
android:key="dream_start_now_button_container"
android:selectable="false"

View File

@@ -17,6 +17,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:key="gesture_settings_screen"
android:title="@string/gesture_preference_title" >
<Preference

View File

@@ -18,6 +18,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:key="language_and_input_settings_screen"
android:title="@string/language_settings" >
<Preference
@@ -27,6 +28,7 @@
android:fragment="com.android.settings.localepicker.LocaleListEditor"/>
<PreferenceCategory
android:key="keyboards_category"
android:title="@string/keyboard_and_input_methods_category">
<Preference
android:key="virtual_keyboard_pref"
@@ -40,6 +42,7 @@
</PreferenceCategory>
<PreferenceCategory
android:key="input_assistance_category"
android:title="@string/input_assistance">
<!-- Spell checker preference title, summary and fragment will be set programmatically. -->
<!-- Note: Mark this as persistent="false" to remove unnecessarily saved shared preference.
@@ -62,7 +65,8 @@
android:title="@string/user_dict_settings_title"/>
</PreferenceCategory>
<PreferenceCategory>
<PreferenceCategory
android:key="pointer_and_tts_category">
<com.android.settings.PointerSpeedPreference
android:key="pointer_speed"

View File

@@ -29,6 +29,7 @@
android:fragment="com.android.settings.localepicker.LocaleListEditor"/>
<PreferenceCategory
android:key="keyboards_category"
android:title="@string/keyboard_and_input_methods_category">
<Preference
android:key="virtual_keyboard_pref"
@@ -42,6 +43,7 @@
</PreferenceCategory>
<PreferenceCategory
android:key="input_assistance_category"
android:title="@string/input_assistance">
<!-- Spell checker preference title, summary and fragment will be set programmatically. -->
<!-- Note: Mark this as persistent="false" to remove unnecessarily saved shared preference.
@@ -64,7 +66,8 @@
android:title="@string/user_dict_settings_title"/>
</PreferenceCategory>
<PreferenceCategory>
<PreferenceCategory
android:key="pointer_and_tts_category">
<com.android.settings.PointerSpeedPreference
android:key="pointer_speed"

View File

@@ -17,6 +17,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:key="manage_assist_screen"
android:title="@string/assist_and_voice_input_title">
<com.android.settings.widget.GearPreference

View File

@@ -17,6 +17,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:key="network_and_internet_screen"
android:title="@string/network_dashboard_title">
<com.android.settings.widget.MasterSwitchPreference
@@ -28,7 +29,7 @@
android:order="-30">
<intent
android:action="android.settings.WIFI_SETTINGS"
android:targetClass="Settings$WifiSettingsActivity"/>
android:targetClass="Settings$WifiSettingsActivity" />
</com.android.settings.widget.MasterSwitchPreference>
<com.android.settingslib.RestrictedPreference
@@ -44,7 +45,7 @@
<intent
android:action="android.intent.action.MAIN"
android:targetPackage="com.android.phone"
android:targetClass="com.android.phone.MobileNetworkSettings"/>
android:targetClass="com.android.phone.MobileNetworkSettings" />
</com.android.settingslib.RestrictedPreference>
<com.android.settingslib.RestrictedPreference
@@ -55,7 +56,7 @@
android:order="-5"
android:summary="@string/summary_placeholder"
settings:userRestriction="no_config_tethering"
settings:useAdminDisabledSummary="true"/>
settings:useAdminDisabledSummary="true" />
<com.android.settingslib.RestrictedPreference
android:fragment="com.android.settings.vpn2.VpnSettings"
@@ -65,25 +66,25 @@
android:order="0"
android:summary="@string/summary_placeholder"
settings:userRestriction="no_config_vpn"
settings:useAdminDisabledSummary="true"/>
settings:useAdminDisabledSummary="true" />
<com.android.settingslib.RestrictedPreference
android:key="manage_mobile_plan"
android:title="@string/manage_mobile_plan_title"
android:persistent="false"
settings:userRestriction="no_config_mobile_networks"
settings:useAdminDisabledSummary="true"/>
settings:useAdminDisabledSummary="true" />
<SwitchPreference
android:key="toggle_airplane"
android:title="@string/airplane_mode"
android:icon="@drawable/ic_airplanemode_active"
android:disableDependentsState="true"
android:order="5"/>
android:order="5" />
<Preference
android:fragment="com.android.settings.ProxySelector"
android:key="proxy_settings"
android:title="@string/proxy_settings_title"/>
android:title="@string/proxy_settings_title" />
</PreferenceScreen>

View File

@@ -13,7 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:key="physical_keyboard_screen"
android:title="@string/physical_keyboard_title">
<!-- Additional preference screens are inserted here programmatically
with low order values to set the key map of each attached keyboard. -->

View File

@@ -17,6 +17,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:key="power_usage_advanced_screen"
android:title="@string/advanced_battery_title"
settings:keywords="@string/keywords_battery">

View File

@@ -17,6 +17,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:key="power_usage_summary_screen"
android:title="@string/power_usage_summary_title"
settings:keywords="@string/keywords_battery">

View File

@@ -14,21 +14,21 @@
limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:key="print_settings_screen"
android:title="@string/print_settings_title"
settings:keywords="@string/keywords_printing">
<PreferenceCategory
android:key="print_jobs_category"
android:title="@string/print_print_jobs"
android:order="0" />
<PreferenceCategory
android:key="print_services_category"
android:title="@string/print_settings_title"
settings:keywords="@string/keywords_printing">
<PreferenceCategory
android:key="print_jobs_category"
android:title="@string/print_print_jobs"
android:order="0">
</PreferenceCategory>
<PreferenceCategory
android:key="print_services_category"
android:title="@string/print_settings_title"
android:order="1">
</PreferenceCategory>
android:order="1" />
</PreferenceScreen>

View File

@@ -16,6 +16,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:key="security_lockscreen_settings_screen"
android:title="@string/lockscreen_settings_title">
<com.android.settings.notification.RestrictedDropDownPreference

View File

@@ -16,6 +16,7 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:key="security_settings_chooser_screen"
android:title="@string/security_settings_title">
<PreferenceCategory

View File

@@ -15,6 +15,7 @@
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:key="security_settings_encrypted_screen"
android:title="@string/security_settings_title">
<PreferenceCategory

View File

@@ -16,6 +16,7 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:key="security_settings_lockscreen_screen"
android:title="@string/security_settings_title">
<PreferenceCategory

View File

@@ -16,6 +16,7 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:key="security_settings_lockscreen_profile_screen"
android:title="@string/security_settings_title">
<com.android.settingslib.RestrictedPreference

View File

@@ -15,10 +15,12 @@
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:key="security_settings_misc_screen"
android:title="@string/security_settings_title">
<PreferenceCategory android:title="@string/security_passwords_title"
android:persistent="false">
<PreferenceCategory
android:key="security_settings_misc_category"
android:title="@string/security_passwords_title">
<Preference
android:key="location"
@@ -33,7 +35,8 @@
</PreferenceCategory>
<PreferenceCategory>
<PreferenceCategory
android:key="security_settings_device_admin_category">
<Preference android:key="manage_device_admin"
android:title="@string/manage_device_admin"

View File

@@ -16,6 +16,7 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:key="security_settings_password_screen"
android:title="@string/lock_settings_picker_title">
<PreferenceCategory

View File

@@ -16,6 +16,7 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:key="security_settings_password_profile_screen"
android:title="@string/security_settings_title">
<com.android.settingslib.RestrictedPreference

View File

@@ -17,6 +17,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:key="security_settings_password_sub_screen"
android:title="@string/settings_label">
<com.android.settings.TimeoutListPreference

View File

@@ -16,6 +16,7 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:key="security_settings_pattern_screen"
android:title="@string/lock_settings_picker_title">
<PreferenceCategory

View File

@@ -16,6 +16,7 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:key="security_settings_pattern_profile_screen"
android:title="@string/security_settings_title">
<com.android.settingslib.RestrictedPreference

View File

@@ -17,6 +17,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:key="security_settings_pattern_sub_screen"
android:title="@string/settings_label">
<SwitchPreference

View File

@@ -16,6 +16,7 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:key="security_settings_pin_profile_screen"
android:title="@string/security_settings_title">
<com.android.settingslib.RestrictedPreference

View File

@@ -17,6 +17,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:key="security_settings_pin_sub_screen"
android:title="@string/settings_label">
<com.android.settings.TimeoutListPreference

View File

@@ -17,6 +17,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:key="security_settings_slide_sub_screen"
android:title="@string/settings_label">
<com.android.settingslib.RestrictedPreference

View File

@@ -15,6 +15,7 @@
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:key="security_settings_unencrypted_screen"
android:title="@string/crypt_keeper_settings_title">
<PreferenceCategory

View File

@@ -22,6 +22,7 @@
settings:keywords="@string/keywords_sounds">
<PreferenceCategory
android:key="sound_settings_primary_items_category"
android:order="-100">
<!-- Media volume -->
<com.android.settings.notification.VolumeSeekBarPreference
@@ -93,6 +94,7 @@
<!-- Other sounds -->
<PreferenceCategory
android:key="other_sounds_and_vibrations_category"
android:title="@string/other_sound_category_preference_title"
android:order="-50">

View File

@@ -17,6 +17,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:key="special_app_access_screen"
android:title="@string/special_access">
<Preference

View File

@@ -17,6 +17,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:key="storage_dashboard_screen"
android:title="@string/storage_settings"
android:orderingFromXml="false">
<com.android.settings.deviceinfo.storage.StorageSummaryDonutPreference

View File

@@ -17,6 +17,7 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:key="gesture_swipe_down_fingerprint_screen"
android:title="@string/fingerprint_gesture_screen_title">
<com.android.settings.widget.VideoPreference

View File

@@ -16,6 +16,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:key="system_dashboard_screen"
android:title="@string/header_category_system">
<Preference

View File

@@ -16,6 +16,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:key="tts_settings_screen"
android:title="@string/tts_settings_title">
<PreferenceCategory android:key="tts_engine_section">

View File

@@ -17,6 +17,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:key="user_and_account_settings_screen"
android:title="@string/account_dashboard_title"
settings:keywords="@string/keywords_accounts">

View File

@@ -13,7 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:key="virtual_keyboard_category"
android:title="@string/virtual_keyboard_category">
<!-- Enabled input method list will be populated programmatically here. -->
<Preference

View File

@@ -17,6 +17,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:key="wifi_configure_settings_screen"
android:title="@string/wifi_configure_settings_preference_title">
<SwitchPreference