Add dynamic Preferences indexing (part 2)

- change the Index SQL model. Add a new "enabled" column.
- use that column for issuing a more restrictive search query
- change the SearchIndexProvider API to pass the "enable" state
- apply it to Bluetooth settings
- refactor the list of indexable resources (SearchIndexableResources)

Change-Id: Ic900fb27cb12a285a80d953aa1aa88f0070cd986
This commit is contained in:
Fabrice Di Meglio
2014-03-20 19:52:29 -07:00
parent 30eb2d3dd1
commit 51bfee595c
9 changed files with 641 additions and 464 deletions

View File

@@ -39,18 +39,23 @@ public interface Indexable {
*
* See {@link android.provider.SearchIndexableResource}
*
* @param context the context
*
* @param context the context.
* @param enabled hint telling if the data needs to be considered into the search results
* or not.
* @return a list of {@link android.provider.SearchIndexableResource} references.
* Can be null.
*/
List<SearchIndexableResource> getXmlResourcesToIndex(Context context);
List<SearchIndexableResource> getXmlResourcesToIndex(Context context, boolean enabled);
/**
* Return a list of raw data for indexing. See {@link SearchIndexableRaw}
*
* @param context the context
* @param context the context.
* @param enabled hint telling if the data needs to be considered into the search results
* or not.
* @return a list of {@link SearchIndexableRaw} references. Can be null.
*/
List<SearchIndexableRaw> getRawDataToIndex(Context context);
List<SearchIndexableRaw> getRawDataToIndex(Context context, boolean enabled);
}
}