Add keywords to Slices

Attach the keywords used for Settings search to Slices.
Their primary use is helping match synonyms for presenters
which display slices without explicit Uri requests, like a launcher.

This changes:
- Updates database scheme
- Adds to SliceData object
- Grab keywords in the SliceDataConverter
- Set keywords on all slices

Test: robotests
Change-Id: I16c40d2380ffddaf0a87fb1b9cd58e95573b308f
Fixes: 78306195
This commit is contained in:
Matthew Fritze
2018-04-19 14:50:55 -07:00
parent 3bdd65e255
commit 47a44e8fa4
17 changed files with 130 additions and 18 deletions

View File

@@ -36,7 +36,7 @@ public class SlicesDatabaseHelper extends SQLiteOpenHelper {
private static final String DATABASE_NAME = "slices_index.db";
private static final String SHARED_PREFS_TAG = "slices_shared_prefs";
private static final int DATABASE_VERSION = 1;
private static final int DATABASE_VERSION = 2;
public interface Tables {
String TABLE_SLICES_INDEX = "slices_index";
@@ -63,6 +63,11 @@ public class SlicesDatabaseHelper extends SQLiteOpenHelper {
*/
String SCREENTITLE = "screentitle";
/**
* String with a comma separated list of keywords relating to the Slice.
*/
String KEYWORDS = "keywords";
/**
* Resource ID for the icon of the setting. Should be 0 for no icon.
*/
@@ -101,6 +106,8 @@ public class SlicesDatabaseHelper extends SQLiteOpenHelper {
", " +
IndexColumns.SCREENTITLE +
", " +
IndexColumns.KEYWORDS +
", " +
IndexColumns.ICON_RESOURCE +
", " +
IndexColumns.FRAGMENT +
@@ -109,7 +116,7 @@ public class SlicesDatabaseHelper extends SQLiteOpenHelper {
", " +
IndexColumns.PLATFORM_SLICE +
", " +
IndexColumns.SLICE_TYPE+
IndexColumns.SLICE_TYPE +
");";
private final Context mContext;