Add test and fix null keys in search providers.

- Add keys to some screens.
- Remove dynamic saved network/turst agent from search provider.
- Remove dynamic print services from printsettings.

Bug: 69384409
Test: atest
Change-Id: I62dce27d52585badb2a8953a05084e35dbae2f7d
This commit is contained in:
Fan Zhang
2017-11-16 09:56:03 -08:00
parent bd6fcdbd2b
commit 7d5c9ace64
15 changed files with 115 additions and 191 deletions

View File

@@ -22,6 +22,7 @@ import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.Display;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.PreviewSeekBarPreferenceFragment;
import com.android.settings.R;
@@ -48,7 +49,7 @@ public class ScreenZoomSettings extends PreviewSeekBarPreferenceFragment impleme
mActivityLayoutResId = R.layout.screen_zoom_activity;
// This should be replaced once the final preview sample screen is in place.
mPreviewSampleResIds = new int[]{R.layout.screen_zoom_preview_1,
mPreviewSampleResIds = new int[] {R.layout.screen_zoom_preview_1,
R.layout.screen_zoom_preview_2,
R.layout.screen_zoom_preview_settings};
@@ -60,8 +61,8 @@ public class ScreenZoomSettings extends PreviewSeekBarPreferenceFragment impleme
// connect to the window manager service. Just use the current
// density and don't let the user change anything.
final int densityDpi = getResources().getDisplayMetrics().densityDpi;
mValues = new int[] { densityDpi };
mEntries = new String[] { getString(DisplayDensityUtils.SUMMARY_DEFAULT) };
mValues = new int[] {densityDpi};
mEntries = new String[] {getString(DisplayDensityUtils.SUMMARY_DEFAULT)};
mInitialIndex = 0;
mDefaultDensity = densityDpi;
} else {
@@ -109,10 +110,12 @@ public class ScreenZoomSettings extends PreviewSeekBarPreferenceFragment impleme
public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
new BaseSearchIndexProvider() {
@Override
public List<SearchIndexableRaw> getRawDataToIndex(Context context, boolean enabled) {
public List<SearchIndexableRaw> getRawDataToIndex(Context context,
boolean enabled) {
final Resources res = context.getResources();
final SearchIndexableRaw data = new SearchIndexableRaw(context);
data.title = res.getString(R.string.screen_zoom_title);
data.key = "screen_zoom_settings";
data.screenTitle = res.getString(R.string.screen_zoom_title);
data.keywords = res.getString(R.string.screen_zoom_keywords);