Loading src/com/android/launcher3/allapps/DefaultAppSearchAlgorithm.java +2 −1 Original line number Diff line number Diff line Loading @@ -130,7 +130,8 @@ public class DefaultAppSearchAlgorithm { // Always a break point for a symbol return true; default: return false; // Always a break point at first character return prevType == Character.UNASSIGNED; } } } tests/src/com/android/launcher3/allapps/DefaultAppSearchAlgorithmTest.java +4 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,10 @@ public class DefaultAppSearchAlgorithmTest extends InstrumentationTestCase { // 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) { Loading Loading
src/com/android/launcher3/allapps/DefaultAppSearchAlgorithm.java +2 −1 Original line number Diff line number Diff line Loading @@ -130,7 +130,8 @@ public class DefaultAppSearchAlgorithm { // Always a break point for a symbol return true; default: return false; // Always a break point at first character return prevType == Character.UNASSIGNED; } } }
tests/src/com/android/launcher3/allapps/DefaultAppSearchAlgorithmTest.java +4 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,10 @@ public class DefaultAppSearchAlgorithmTest extends InstrumentationTestCase { // 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) { Loading