Make TopLevelSettings un-searchable and direct result to relevant page.

Fixes: 149372187
Test: manual & robotest
Change-Id: I9daca03d1c11a262f8e3b55bb46aabbc035ece96
This commit is contained in:
Edgar Wang
2020-02-14 17:58:38 +08:00
parent fe83913c03
commit 77de405a5d
16 changed files with 36 additions and 9 deletions

View File

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

View File

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

View File

@@ -18,6 +18,7 @@
<PreferenceScreen <PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto" xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="apps_and_notification_screen"
android:title="@string/app_and_notification_dashboard_title" android:title="@string/app_and_notification_dashboard_title"
settings:initialExpandedChildrenCount="4"> settings:initialExpandedChildrenCount="4">
<!-- the initial count should include the dynamic tiles --> <!-- the initial count should include the dynamic tiles -->

View File

@@ -17,6 +17,7 @@
<PreferenceScreen <PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto" xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="connected_devices_screen"
android:title="@string/connected_devices_dashboard_title"> android:title="@string/connected_devices_dashboard_title">
<com.android.settings.slices.SlicePreference <com.android.settings.slices.SlicePreference

View File

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

View File

@@ -17,7 +17,9 @@
<PreferenceScreen <PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto" xmlns:settings="http://schemas.android.com/apk/res-auto"
android:title="@string/location_settings_title"> android:key="location_settings"
android:title="@string/location_settings_title"
settings:keywords="@string/keywords_location">
<PreferenceCategory <PreferenceCategory
android:key="recent_location_requests" android:key="recent_location_requests"

View File

@@ -18,6 +18,7 @@
<PreferenceScreen <PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto" xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="my_device_info_pref_screen"
android:title="@string/about_settings"> android:title="@string/about_settings">
<com.android.settingslib.widget.LayoutPreference <com.android.settingslib.widget.LayoutPreference

View File

@@ -17,6 +17,7 @@
<PreferenceScreen <PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto" xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="network_and_internet_screen"
android:title="@string/network_dashboard_title" android:title="@string/network_dashboard_title"
settings:initialExpandedChildrenCount="5"> settings:initialExpandedChildrenCount="5">

View File

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

View File

@@ -18,6 +18,7 @@
<PreferenceScreen <PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto" xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="privacy_dashboard_page"
android:title="@string/privacy_dashboard_title" android:title="@string/privacy_dashboard_title"
settings:initialExpandedChildrenCount="4"> settings:initialExpandedChildrenCount="4">

View File

@@ -18,6 +18,7 @@
<PreferenceScreen <PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto" xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="security_dashboard_page"
android:title="@string/security_settings_title" android:title="@string/security_settings_title"
settings:initialExpandedChildrenCount="9"> settings:initialExpandedChildrenCount="9">

View File

@@ -18,6 +18,7 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto" xmlns:settings="http://schemas.android.com/apk/res-auto"
android:title="@string/sound_settings" android:title="@string/sound_settings"
android:key="sound_settings"
settings:keywords="@string/keywords_sounds" settings:keywords="@string/keywords_sounds"
settings:initialExpandedChildrenCount="9"> settings:initialExpandedChildrenCount="9">

View File

@@ -17,6 +17,7 @@
<PreferenceScreen <PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto" xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="system_dashboard_screen"
android:title="@string/header_category_system" android:title="@string/header_category_system"
settings:initialExpandedChildrenCount="4"> settings:initialExpandedChildrenCount="4">

View File

@@ -53,7 +53,6 @@
android:icon="@drawable/ic_homepage_battery" android:icon="@drawable/ic_homepage_battery"
android:fragment="com.android.settings.fuelgauge.PowerUsageSummary" android:fragment="com.android.settings.fuelgauge.PowerUsageSummary"
android:order="-90" android:order="-90"
settings:keywords="@string/keywords_battery"
settings:controller="com.android.settings.fuelgauge.TopLevelBatteryPreferenceController"/> settings:controller="com.android.settings.fuelgauge.TopLevelBatteryPreferenceController"/>
<Preference <Preference
@@ -80,7 +79,6 @@
android:icon="@drawable/ic_homepage_storage" android:icon="@drawable/ic_homepage_storage"
android:order="-60" android:order="-60"
android:fragment="com.android.settings.deviceinfo.StorageSettings" android:fragment="com.android.settings.deviceinfo.StorageSettings"
settings:keywords="@string/keywords_display"
settings:controller="com.android.settings.deviceinfo.TopLevelStoragePreferenceController"/> settings:controller="com.android.settings.deviceinfo.TopLevelStoragePreferenceController"/>
<Preference <Preference
@@ -98,7 +96,6 @@
android:icon="@drawable/ic_homepage_location" android:icon="@drawable/ic_homepage_location"
android:order="-50" android:order="-50"
android:fragment="com.android.settings.location.LocationSettings" android:fragment="com.android.settings.location.LocationSettings"
settings:keywords="@string/keywords_location"
settings:controller="com.android.settings.location.TopLevelLocationPreferenceController"/> settings:controller="com.android.settings.location.TopLevelLocationPreferenceController"/>
<Preference <Preference
@@ -117,7 +114,6 @@
android:icon="@drawable/ic_homepage_accounts" android:icon="@drawable/ic_homepage_accounts"
android:order="-30" android:order="-30"
android:fragment="com.android.settings.accounts.AccountDashboardFragment" android:fragment="com.android.settings.accounts.AccountDashboardFragment"
settings:keywords="@string/keywords_accounts"
settings:controller="com.android.settings.accounts.TopLevelAccountEntryPreferenceController"/> settings:controller="com.android.settings.accounts.TopLevelAccountEntryPreferenceController"/>
<Preference <Preference

View File

@@ -550,6 +550,13 @@ public class StorageSettings extends SettingsPreferenceFragment implements Index
final List<SearchIndexableRaw> result = new ArrayList<>(); final List<SearchIndexableRaw> result = new ArrayList<>();
SearchIndexableRaw data = new SearchIndexableRaw(context); SearchIndexableRaw data = new SearchIndexableRaw(context);
data.title = context.getString(R.string.storage_settings);
data.key = "storage_settings";
data.screenTitle = context.getString(R.string.storage_settings);
data.keywords = context.getString(R.string.keywords_storage_settings);
result.add(data);
data = new SearchIndexableRaw(context);
data.title = context.getString(R.string.internal_storage); data.title = context.getString(R.string.internal_storage);
data.key = "storage_settings_internal_storage"; data.key = "storage_settings_internal_storage";
data.screenTitle = context.getString(R.string.storage_settings); data.screenTitle = context.getString(R.string.storage_settings);

View File

@@ -100,5 +100,12 @@ public class TopLevelSettings extends DashboardFragment implements
} }
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER = public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
new BaseSearchIndexProvider(R.xml.top_level_settings); new BaseSearchIndexProvider(R.xml.top_level_settings) {
@Override
protected boolean isPageSearchEnabled(Context context) {
// Never searchable, all entries in this page are already indexed elsewhere.
return false;
}
};
} }