use of com.android.settings.dashboard.DashboardFeatureProvider in project android_packages_apps_Settings by omnirom.
the class SettingsSearchIndexablesProvider method getInjectionIndexableRawData.
@VisibleForTesting
List<SearchIndexableRaw> getInjectionIndexableRawData(Context context) {
final DashboardFeatureProvider dashboardFeatureProvider = FeatureFactory.getFactory(context).getDashboardFeatureProvider(context);
final List<SearchIndexableRaw> rawList = new ArrayList<>();
final String currentPackageName = context.getPackageName();
for (DashboardCategory category : dashboardFeatureProvider.getAllCategories()) {
if (mSearchEnabledByCategoryKeyMap.containsKey(category.key) && !mSearchEnabledByCategoryKeyMap.get(category.key)) {
Log.i(TAG, "Skip indexing category: " + category.key);
continue;
}
for (Tile tile : category.getTiles()) {
if (!isEligibleForIndexing(currentPackageName, tile)) {
continue;
}
final SearchIndexableRaw raw = new SearchIndexableRaw(context);
final CharSequence title = tile.getTitle(context);
raw.title = TextUtils.isEmpty(title) ? null : title.toString();
if (TextUtils.isEmpty(raw.title)) {
continue;
}
raw.key = dashboardFeatureProvider.getDashboardKeyForTile(tile);
final CharSequence summary = tile.getSummary(context);
raw.summaryOn = TextUtils.isEmpty(summary) ? null : summary.toString();
raw.summaryOff = raw.summaryOn;
raw.className = CATEGORY_KEY_TO_PARENT_MAP.get(tile.getCategory());
rawList.add(raw);
}
}
return rawList;
}
Aggregations