diff options
author | qqzhou <qqzhou@codeaurora.org> | 2014-07-28 18:39:18 +0800 |
---|---|---|
committer | Matt Garnes <matt@cyngn.com> | 2014-11-13 17:47:21 -0800 |
commit | 4f18efcd8c58bfa828241f7020b836cb997f0cb2 (patch) | |
tree | edabb3fdd3856fba7e0d1cb97dea0f9c7500d054 /tests | |
parent | 31549f2a37398799a5ab6ca758a4b74c6233953a (diff) | |
download | android_packages_apps_Dialer-4f18efcd8c58bfa828241f7020b836cb997f0cb2.tar.gz android_packages_apps_Dialer-4f18efcd8c58bfa828241f7020b836cb997f0cb2.tar.bz2 android_packages_apps_Dialer-4f18efcd8c58bfa828241f7020b836cb997f0cb2.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.java | 2 | ||||
-rw-r--r-- | tests/src/com/android/dialer/dialpad/SmartDialNameMatcherTest.java | 6 |
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( |