commit | 28a64381b67d72fcc8b994343507ed9c5821df53 | [log] [tgz] |
---|---|---|
author | Sunny Goyal <sunnygoyal@google.com> | Wed Oct 19 07:53:43 2016 +0100 |
committer | Sunny Goyal <sunnygoyal@google.com> | Wed Oct 19 07:54:22 2016 +0100 |
tree | f4339400ae765f628c1d32abd4ffc9943f11591f | |
parent | a833b6d720b60f189572efd2a7af0ac6f5d20a52 [diff] |
Fixing text search where a word starting with lower case was not being matched Bug: 32249413 Change-Id: I0f5e24052759a734fe0df3bd3d0bf2e7ef7f2713
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 @@ 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 @@ 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) {