diff --git a/res/values/strings.xml b/res/values/strings.xml index cd152b6ee75..26961c816ab 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -5512,46 +5512,44 @@ Results - wifi wi-fi network connection - text message texting messages messaging - cellular cell carrier wireless data 4g 3g 2g lte - wifi wi-fi call calling + wifi, wi-fi, network connection + text message, texting, messages, messaging + cellular, cell carrier, wireless, data, 4g, 3g, 2g, lte + wifi, wi-fi, call, calling launcher - screen touchscreen - dim screen touchscreen battery - dim screen touchscreen battery - - dark theme night mode dim screen invert brightness - background personalize customize display + screen, touchscreen + dim screen, touchscreen, battery + dim screen, touchscreen, battery + dark theme, night mode, dim screen, invert brightness + background, personalize, customize display text size - project cast - space disk hard drive device usage - power usage charge - spelling dictionary spellcheck auto-correct - recognizer input speech speak language hands-free hand free recognition offensive word audio history bluetooth headset - rate language default speak speaking tts accessibility reader blind - clock military - reset restore factory - wipe delete restore clear remove + project, cast + space, disk, hard drive, device usage + power usage, charge + spelling, dictionary, spellcheck, auto-correct + recognizer, input, speech, speak, language, hands-free, hand free recognition offensive word audio history bluetooth headset + rate, language, default, speak, speaking, tts, accessibility, screen reader, blind + clock, military + reset, restore, factory + wipe, delete, restore, clear, remove printer speaker beep - dont don\u2019t disturb interrupt interruption break + dont don\u2019t disturb, interrupt, interruption, break RAM - nearby location history reporting + nearby, location, history, reporting accuracy account - restriction restrict restricted - text correction correct sound vibrate auto language gesture suggest suggestion theme offensive word type emoji international - reset preferences default - emergency ice app default - phone dialer default - apps download applications system - apps permissions security - apps default - ignore optimizations doze app standby - vibrant rgb srgb color natural standard - - slide password pattern pin + restriction, restrict, restricted + text correction, correct, sound, vibrate, auto, language, gesture, suggest, suggestion, theme, offensive, word, type, emoji, international + reset, preferences, default + emergency, ice, app, default + phone, dialer, default + apps, download, applications, system + apps, permissions, security + apps, default + ignore optimizations, doze, app standby + vibrant, rgb, srgb, color, natural, standard + slide to unlock, password, pattern, pin @@ -6616,7 +6614,7 @@ Screen zoom - display density screen zoom scale scaling + display density, screen zoom, scale, scaling Choose how zoomed you want the screen using the slider below the preview image. diff --git a/src/com/android/settings/search/Index.java b/src/com/android/settings/search/Index.java index 73386fb2749..3fd06a26031 100644 --- a/src/com/android/settings/search/Index.java +++ b/src/com/android/settings/search/Index.java @@ -150,7 +150,9 @@ public class Index { private static final String EMPTY = ""; private static final String NON_BREAKING_HYPHEN = "\u2011"; + private static final String LIST_DELIMITERS = "[,]\\s*"; private static final String HYPHEN = "-"; + private static final String SPACE = " "; private static final String FIELD_NAME_SEARCH_INDEX_DATA_PROVIDER = "SEARCH_INDEX_DATA_PROVIDER"; @@ -1002,12 +1004,13 @@ public class Index { final String normalizedSummaryOn = normalizeString(updatedSummaryOn); final String normalizedSummaryOff = normalizeString(updatedSummaryOff); + final String spaceDelimitedKeywords = normalizeKeywords(keywords); + updateOneRow(database, locale, updatedTitle, normalizedTitle, updatedSummaryOn, normalizedSummaryOn, - updatedSummaryOff, normalizedSummaryOff, entries, - className, screenTitle, iconResId, - rank, keywords, intentAction, intentTargetPackage, intentTargetClass, enabled, - key, userId); + updatedSummaryOff, normalizedSummaryOff, entries, className, screenTitle, iconResId, + rank, spaceDelimitedKeywords, intentAction, intentTargetPackage, intentTargetClass, + enabled, key, userId); } private static String normalizeHyphen(String input) { @@ -1021,11 +1024,14 @@ public class Index { return REMOVE_DIACRITICALS_PATTERN.matcher(normalized).replaceAll("").toLowerCase(); } - private void updateOneRow(SQLiteDatabase database, String locale, - String updatedTitle, String normalizedTitle, - String updatedSummaryOn, String normalizedSummaryOn, - String updatedSummaryOff, String normalizedSummaryOff, String entries, - String className, String screenTitle, int iconResId, int rank, String keywords, + private static String normalizeKeywords(String input) { + return (input != null) ? input.replaceAll(LIST_DELIMITERS, SPACE) : EMPTY; + } + + private void updateOneRow(SQLiteDatabase database, String locale, String updatedTitle, + String normalizedTitle, String updatedSummaryOn, String normalizedSummaryOn, + String updatedSummaryOff, String normalizedSummaryOff, String entries, String className, + String screenTitle, int iconResId, int rank, String spaceDelimitedKeywords, String intentAction, String intentTargetPackage, String intentTargetClass, boolean enabled, String key, int userId) { @@ -1050,7 +1056,7 @@ public class Index { values.put(IndexColumns.DATA_SUMMARY_OFF, updatedSummaryOff); values.put(IndexColumns.DATA_SUMMARY_OFF_NORMALIZED, normalizedSummaryOff); values.put(IndexColumns.DATA_ENTRIES, entries); - values.put(IndexColumns.DATA_KEYWORDS, keywords); + values.put(IndexColumns.DATA_KEYWORDS, spaceDelimitedKeywords); values.put(IndexColumns.CLASS_NAME, className); values.put(IndexColumns.SCREEN_TITLE, screenTitle); values.put(IndexColumns.INTENT_ACTION, intentAction);