Launcher3: Can't search out local app by Chinese

Description:
Chinese content type is Character.OTHER_LETTER.
When key matches,it check the content type. And
if type is Character.OTHER_LETTER, it doesn't
support search and break.

When the content type is Character.OTHER_LETTER,
make it work normally.

Bug: 63534074
Change-Id: I3713f24c9206fe16a8da2a23e6c90d68079dd533
This commit is contained in:
yingrenw 2017-07-06 18:37:35 +08:00 committed by Sunny Goyal
parent ea36114e4b
commit a9f4bffbfc
2 changed files with 6 additions and 1 deletions

View File

@ -132,7 +132,8 @@ public class DefaultAppSearchAlgorithm implements SearchAlgorithm {
// Always a break point for a symbol
return true;
default:
return false;
// Always a break point at first character
return prevType == Character.UNASSIGNED;
}
}
}

View File

@ -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) {