Merge "Launcher3: Can't search out local app by Chinese" am: 7c35c64a9d am: fa5511133a am: 788000b0ec
am: 29e4a28f8c

Change-Id: I2ffeab12ebdd4422fb92c263fa7de927bf8bd506
diff --git a/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java b/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java
index 8a0fd46..4303302 100644
--- a/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java
+++ b/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithm.java
@@ -132,7 +132,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/search/DefaultAppSearchAlgorithmTest.java b/tests/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithmTest.java
index 20b23b0..58dc0c4 100644
--- a/tests/src/com/android/launcher3/allapps/search/DefaultAppSearchAlgorithmTest.java
+++ b/tests/src/com/android/launcher3/allapps/search/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) {