Merge "Launcher3: Can't search out local app by Chinese"

This commit is contained in:
Sunny Goyal
2017-07-12 17:37:47 +00:00
committed by Gerrit Code Review
2 changed files with 6 additions and 1 deletions
@@ -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;
}
}
}
@@ -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) {