commit | 7c35c64a9d5ca913fb160df63c033000915639f8 | [log] [tgz] |
---|---|---|
author | Sunny Goyal <sunnygoyal@google.com> | Wed Jul 12 17:37:47 2017 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Wed Jul 12 17:37:47 2017 +0000 |
tree | f67eaddd9e3d1c128b15a25a5c102e7c4169cabc | |
parent | a80a70f2f8c5e32e7b1ec6c78c4f7c3b3500102e [diff] | |
parent | ad19a3225d1558eb4d9f77e3d92f8baca5f59c66 [diff] |
Merge "Launcher3: Can't search out local app by Chinese"
diff --git a/src/com/android/launcher3/allapps/DefaultAppSearchAlgorithm.java b/src/com/android/launcher3/allapps/DefaultAppSearchAlgorithm.java index 06cf9aa..136d369 100644 --- a/src/com/android/launcher3/allapps/DefaultAppSearchAlgorithm.java +++ b/src/com/android/launcher3/allapps/DefaultAppSearchAlgorithm.java
@@ -130,7 +130,8 @@ // Always a break point for a symbol return true; default: - return false; + // Always a break point at first character + return prevType == Character.UNASSIGNED; } } }
diff --git a/tests/src/com/android/launcher3/allapps/DefaultAppSearchAlgorithmTest.java b/tests/src/com/android/launcher3/allapps/DefaultAppSearchAlgorithmTest.java index 18570de..e9c2ebc 100644 --- a/tests/src/com/android/launcher3/allapps/DefaultAppSearchAlgorithmTest.java +++ b/tests/src/com/android/launcher3/allapps/DefaultAppSearchAlgorithmTest.java
@@ -71,6 +71,10 @@ // match lower case words assertTrue(mAlgorithm.matches(getInfo("elephant"), "e")); + assertTrue(mAlgorithm.matches(getInfo("电子邮件"), "电")); + assertTrue(mAlgorithm.matches(getInfo("电子邮件"), "电子")); + assertFalse(mAlgorithm.matches(getInfo("电子邮件"), "子")); + assertFalse(mAlgorithm.matches(getInfo("电子邮件"), "邮件")); } private AppInfo getInfo(String title) {