summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2016-10-19 06:53:43 (GMT)
committerSunny Goyal <sunnygoyal@google.com>2016-10-19 06:54:22 (GMT)
commit28a64381b67d72fcc8b994343507ed9c5821df53 (patch)
treef4339400ae765f628c1d32abd4ffc9943f11591f
parenta833b6d720b60f189572efd2a7af0ac6f5d20a52 (diff)
downloadandroid_packages_apps_Trebuchet-28a64381b67d72fcc8b994343507ed9c5821df53.zip
android_packages_apps_Trebuchet-28a64381b67d72fcc8b994343507ed9c5821df53.tar.gz
android_packages_apps_Trebuchet-28a64381b67d72fcc8b994343507ed9c5821df53.tar.bz2
Fixing text search where a word starting with lower case was
not being matched Bug: 32249413 Change-Id: I0f5e24052759a734fe0df3bd3d0bf2e7ef7f2713
-rw-r--r--src/com/android/launcher3/allapps/DefaultAppSearchAlgorithm.java2
-rw-r--r--tests/src/com/android/launcher3/allapps/DefaultAppSearchAlgorithmTest.java4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/launcher3/allapps/DefaultAppSearchAlgorithm.java b/src/com/android/launcher3/allapps/DefaultAppSearchAlgorithm.java
index ac22dd2..06cf9aa 100644
--- a/src/com/android/launcher3/allapps/DefaultAppSearchAlgorithm.java
+++ b/src/com/android/launcher3/allapps/DefaultAppSearchAlgorithm.java
@@ -115,7 +115,7 @@ public class DefaultAppSearchAlgorithm {
return prevType != Character.UPPERCASE_LETTER;
case Character.LOWERCASE_LETTER:
// Break point if previous was not a letter.
- return prevType > Character.OTHER_LETTER;
+ return prevType > Character.OTHER_LETTER || prevType <= Character.UNASSIGNED;
case Character.DECIMAL_DIGIT_NUMBER:
case Character.LETTER_NUMBER:
case Character.OTHER_NUMBER:
diff --git a/tests/src/com/android/launcher3/allapps/DefaultAppSearchAlgorithmTest.java b/tests/src/com/android/launcher3/allapps/DefaultAppSearchAlgorithmTest.java
index 4d0a7a9..18570de 100644
--- a/tests/src/com/android/launcher3/allapps/DefaultAppSearchAlgorithmTest.java
+++ b/tests/src/com/android/launcher3/allapps/DefaultAppSearchAlgorithmTest.java
@@ -67,6 +67,10 @@ public class DefaultAppSearchAlgorithmTest extends InstrumentationTestCase {
assertTrue(mAlgorithm.matches(getInfo("Q"), "q"));
assertTrue(mAlgorithm.matches(getInfo(" Q"), "q"));
+
+ // match lower case words
+ assertTrue(mAlgorithm.matches(getInfo("elephant"), "e"));
+
}
private AppInfo getInfo(String title) {