diff options
author | Fabrice Di Meglio <fdimeglio@google.com> | 2014-03-12 19:24:43 -0700 |
---|---|---|
committer | Fabrice Di Meglio <fdimeglio@google.com> | 2014-03-19 14:56:09 -0700 |
commit | fa7dc240e978b1b77bb5c80a78cd1f8c77648301 (patch) | |
tree | 43fdab96935705e1d3b04d58c8f6bb6b916e2cc9 /src/com/android/settings/WallpaperTypeSettings.java | |
parent | 72c6f3f9b86a185c33a9e97ed67057d9836de913 (diff) | |
download | packages_apps_Settings-fa7dc240e978b1b77bb5c80a78cd1f8c77648301.zip packages_apps_Settings-fa7dc240e978b1b77bb5c80a78cd1f8c77648301.tar.gz packages_apps_Settings-fa7dc240e978b1b77bb5c80a78cd1f8c77648301.tar.bz2 |
Add external Preferences indexing
- define SettingsSearchIndexablesProvider as an internal
SearchIndexablesProvider
- protect access thru using android.permission.READ_SEARCH_INDEXABLES
- update WallpaperTypeSettings and WifiSettings for taking care of
the new model
- update the Dashboard for taking care about external Icons for the
search result
- update sqlite model/version for taking care about Intents
(enable launching external applications for showing the settings)
Change-Id: I2e38599327e6480f1754f52666becce0884cee9d
Diffstat (limited to 'src/com/android/settings/WallpaperTypeSettings.java')
-rw-r--r-- | src/com/android/settings/WallpaperTypeSettings.java | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/com/android/settings/WallpaperTypeSettings.java b/src/com/android/settings/WallpaperTypeSettings.java index f46315a..7dc5e4d 100644 --- a/src/com/android/settings/WallpaperTypeSettings.java +++ b/src/com/android/settings/WallpaperTypeSettings.java @@ -24,9 +24,9 @@ import android.content.pm.ResolveInfo; import android.os.Bundle; import android.preference.Preference; import android.preference.PreferenceScreen; -import com.android.settings.indexer.Indexable; -import com.android.settings.indexer.IndexableData; -import com.android.settings.indexer.IndexableRef; +import android.provider.SearchIndexableResource; +import com.android.settings.search.Indexable; +import com.android.settings.search.SearchIndexableRaw; import java.util.ArrayList; import java.util.List; @@ -64,16 +64,16 @@ public class WallpaperTypeSettings extends SettingsPreferenceFragment implements } } - public static final IndexDataProvider INDEX_DATA_PROVIDER = - new IndexDataProvider() { + public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER = + new SearchIndexProvider() { @Override - public List<IndexableRef> getRefsToIndex(Context context) { + public List<SearchIndexableResource> getXmlResourcesToIndex(Context context) { return null; } @Override - public List<IndexableData> getRawDataToIndex(Context context) { - final List<IndexableData> result = new ArrayList<IndexableData>(); + public List<SearchIndexableRaw> getRawDataToIndex(Context context) { + final List<SearchIndexableRaw> result = new ArrayList<SearchIndexableRaw>(); final Intent intent = new Intent(Intent.ACTION_SET_WALLPAPER); final PackageManager pm = context.getPackageManager(); @@ -82,17 +82,14 @@ public class WallpaperTypeSettings extends SettingsPreferenceFragment implements // Add indexable data for each of the matching activities for (ResolveInfo info : rList) { - Intent prefIntent = new Intent(intent); - prefIntent.setComponent(new ComponentName( - info.activityInfo.packageName, info.activityInfo.name)); CharSequence label = info.loadLabel(pm); if (label == null) label = info.activityInfo.packageName; - IndexableData data = new IndexableData(); + SearchIndexableRaw data = new SearchIndexableRaw(context); data.title = label.toString(); - data.fragmentTitle = context.getResources().getString( + data.screenTitle = context.getResources().getString( R.string.wallpaper_settings_fragment_title); - data.intentAction = intent.getAction(); + data.intentAction = Intent.ACTION_SET_WALLPAPER; data.intentTargetPackage = info.activityInfo.packageName; data.intentTargetClass = info.activityInfo.name; result.add(data); |