Fix some Dashboard top categories not showing for Search

- fix Date & time / Printing / Security

See bug: #12910134 Implement Search into the Settings App

Change-Id: I7e96eb35a6802fde7589ccfe244e71f8be43dea8
This commit is contained in:
Fabrice Di Meglio
2014-07-01 14:32:03 -07:00
parent 299ed6ef88
commit d729029b90
3 changed files with 17 additions and 10 deletions

View File

@@ -380,7 +380,7 @@
<!-- Date & time settings screen title --> <!-- Date & time settings screen title -->
<string name="date_and_time">Date &amp; time settings</string> <string name="date_and_time">Date &amp; time</string>
<!-- The title of the activity to pick a time zone. --> <!-- The title of the activity to pick a time zone. -->
<string name="choose_timezone">Choose time zone</string> <string name="choose_timezone">Choose time zone</string>
<!-- Do not translate. Used as the value for a setting. --> <!-- Do not translate. Used as the value for a setting. -->

View File

@@ -699,7 +699,10 @@ public class SecuritySettings extends SettingsPreferenceFragment
final String screenTitle = res.getString(R.string.security_settings_title); final String screenTitle = res.getString(R.string.security_settings_title);
SearchIndexableRaw data; SearchIndexableRaw data = new SearchIndexableRaw(context);
data.title = screenTitle;
data.screenTitle = screenTitle;
result.add(data);
if (!mIsPrimary) { if (!mIsPrimary) {
int resId = (UserManager.get(context).isLinkedUser()) ? int resId = (UserManager.get(context).isLinkedUser()) ?

View File

@@ -528,8 +528,12 @@ public class PrintSettingsFragment extends SettingsPreferenceFragment
Context.PRINT_SERVICE); Context.PRINT_SERVICE);
String screenTitle = context.getResources().getString(R.string.print_settings); String screenTitle = context.getResources().getString(R.string.print_settings);
SearchIndexableRaw data = new SearchIndexableRaw(context);
data.title = screenTitle;
data.screenTitle = screenTitle;
indexables.add(data);
// Indexing all services, reagardles if enabled. // Indexing all services, regardless if enabled.
List<PrintServiceInfo> services = printManager.getInstalledPrintServices(); List<PrintServiceInfo> services = printManager.getInstalledPrintServices();
final int serviceCount = services.size(); final int serviceCount = services.size();
for (int i = 0; i < serviceCount; i++) { for (int i = 0; i < serviceCount; i++) {
@@ -539,13 +543,13 @@ public class PrintSettingsFragment extends SettingsPreferenceFragment
service.getResolveInfo().serviceInfo.packageName, service.getResolveInfo().serviceInfo.packageName,
service.getResolveInfo().serviceInfo.name); service.getResolveInfo().serviceInfo.name);
SearchIndexableRaw indexable = new SearchIndexableRaw(context); data = new SearchIndexableRaw(context);
indexable.key = componentName.flattenToString(); data.key = componentName.flattenToString();
indexable.title = service.getResolveInfo().loadLabel(packageManager).toString(); data.title = service.getResolveInfo().loadLabel(packageManager).toString();
indexable.summaryOn = context.getString(R.string.print_feature_state_on); data.summaryOn = context.getString(R.string.print_feature_state_on);
indexable.summaryOff = context.getString(R.string.print_feature_state_off); data.summaryOff = context.getString(R.string.print_feature_state_off);
indexable.screenTitle = screenTitle; data.screenTitle = screenTitle;
indexables.add(indexable); indexables.add(data);
} }
return indexables; return indexables;