summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorqqzhou <qqzhou@codeaurora.org>2014-07-28 18:39:18 +0800
committerSteve Kondik <steve@cyngn.com>2015-11-16 19:53:26 -0800
commit0566f841a3909c341bd27677d9ae4f6fd17ae80d (patch)
tree6b9cbe279c9f9cd823e5ca82bc21054e4be84c53 /tests
parent8275cbea265770a52cbd86cfa30ab93354ec9f5c (diff)
downloadandroid_packages_apps_Dialer-0566f841a3909c341bd27677d9ae4f6fd17ae80d.tar.gz
android_packages_apps_Dialer-0566f841a3909c341bd27677d9ae4f6fd17ae80d.tar.bz2
android_packages_apps_Dialer-0566f841a3909c341bd27677d9ae4f6fd17ae80d.zip
Dialer: add to support multi-language smart search
- use the new API to realize multi-language smart search for contact name. - change the match rules for number, use fuzzy match rules. Change-Id: I9eed29efe06e2b0d37f57b299ab41a7f1b5f475b
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/dialer/database/SmartDialPrefixTest.java2
-rw-r--r--tests/src/com/android/dialer/dialpad/SmartDialNameMatcherTest.java6
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/src/com/android/dialer/database/SmartDialPrefixTest.java b/tests/src/com/android/dialer/database/SmartDialPrefixTest.java
index 9cb842e56..796303d78 100644
--- a/tests/src/com/android/dialer/database/SmartDialPrefixTest.java
+++ b/tests/src/com/android/dialer/database/SmartDialPrefixTest.java
@@ -163,7 +163,7 @@ public class SmartDialPrefixTest extends AndroidTestCase {
private ArrayList<ContactNumber> getLooseMatchesFromDb(String query) {
final SmartDialNameMatcher nameMatcher = new SmartDialNameMatcher(query,
- SmartDialPrefix.getMap());
+ SmartDialPrefix.getMap(), getContext());
return mTestHelper.getLooseMatches(query, nameMatcher);
}
diff --git a/tests/src/com/android/dialer/dialpad/SmartDialNameMatcherTest.java b/tests/src/com/android/dialer/dialpad/SmartDialNameMatcherTest.java
index c1365f5cf..b0dc91d2c 100644
--- a/tests/src/com/android/dialer/dialpad/SmartDialNameMatcherTest.java
+++ b/tests/src/com/android/dialer/dialpad/SmartDialNameMatcherTest.java
@@ -30,7 +30,7 @@ import java.util.ArrayList;
import junit.framework.TestCase;
@SmallTest
-public class SmartDialNameMatcherTest extends TestCase {
+public class SmartDialNameMatcherTest extends AndroidTestCase {
private static final String TAG = "SmartDialNameMatcherTest";
public void testMatches() {
@@ -239,7 +239,7 @@ public class SmartDialNameMatcherTest extends TestCase {
private void checkMatchesNumber(String number, String query, boolean expectedMatches,
boolean matchNanp, int matchStart, int matchEnd) {
- final SmartDialNameMatcher matcher = new SmartDialNameMatcher(query);
+ final SmartDialNameMatcher matcher = new SmartDialNameMatcher(query, getContext());
final SmartDialMatchPosition pos = matcher.matchesNumber(number, query, matchNanp);
assertEquals(expectedMatches, pos != null);
if (expectedMatches) {
@@ -250,7 +250,7 @@ public class SmartDialNameMatcherTest extends TestCase {
private void checkMatches(String displayName, String query, boolean expectedMatches,
int... expectedMatchPositions) {
- final SmartDialNameMatcher matcher = new SmartDialNameMatcher(query);
+ final SmartDialNameMatcher matcher = new SmartDialNameMatcher(query, getContext());
final ArrayList<SmartDialMatchPosition> matchPositions =
new ArrayList<SmartDialMatchPosition>();
final boolean matches = matcher.matchesCombination(