diff options
author | Makoto Onuki <omakoto@google.com> | 2012-06-18 10:33:42 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-06-18 10:33:42 -0700 |
commit | fa078d353c83d7739d7e175af418a255e837fe92 (patch) | |
tree | d772cdb1e1d79f0e07d83e0011ffa4d030101b7b /tests | |
parent | 64ee95a3e48d6f83e338764650c53a915b778cdf (diff) | |
parent | 4c3a04572ead6ad9f0cfc20a34db3252fdb31201 (diff) | |
download | packages_providers_ContactsProvider-fa078d353c83d7739d7e175af418a255e837fe92.zip packages_providers_ContactsProvider-fa078d353c83d7739d7e175af418a255e837fe92.tar.gz packages_providers_ContactsProvider-fa078d353c83d7739d7e175af418a255e837fe92.tar.bz2 |
am 4c3a0457: Support new query parameters introduced in Iaab5c38a
* commit '4c3a04572ead6ad9f0cfc20a34db3252fdb31201':
Support new query parameters introduced in Iaab5c38a
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/android/providers/contacts/ContactsProvider2Test.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/src/com/android/providers/contacts/ContactsProvider2Test.java b/tests/src/com/android/providers/contacts/ContactsProvider2Test.java index aa34b1a..5706925 100644 --- a/tests/src/com/android/providers/contacts/ContactsProvider2Test.java +++ b/tests/src/com/android/providers/contacts/ContactsProvider2Test.java @@ -1172,6 +1172,41 @@ public class ContactsProvider2Test extends BaseContactsProvider2Test { assertStoredValues(filterUri6, new ContentValues[] {values1, values2, values3} ); } + public void testPhonesFilterSearchParams() { + final long rid1 = createRawContactWithName("Dad", null); + insertPhoneNumber(rid1, "123-456-7890"); + + final long rid2 = createRawContactWithName("Mam", null); + insertPhoneNumber(rid2, "323-123-4567"); + + // By default, "dad" will match both the display name and the phone number. + // Because "dad" is "323" after the dialpad conversion, it'll match "Mam" too. + assertStoredValues( + Phone.CONTENT_FILTER_URI.buildUpon().appendPath("dad").build(), + cv(Phone.DISPLAY_NAME, "Dad", Phone.NUMBER, "123-456-7890"), + cv(Phone.DISPLAY_NAME, "Mam", Phone.NUMBER, "323-123-4567") + ); + assertStoredValues( + Phone.CONTENT_FILTER_URI.buildUpon().appendPath("dad") + .appendQueryParameter(Phone.SEARCH_PHONE_NUMBER_KEY, "0") + .build(), + cv(Phone.DISPLAY_NAME, "Dad", Phone.NUMBER, "123-456-7890") + ); + + assertStoredValues( + Phone.CONTENT_FILTER_URI.buildUpon().appendPath("dad") + .appendQueryParameter(Phone.SEARCH_DISPLAY_NAME_KEY, "0") + .build(), + cv(Phone.DISPLAY_NAME, "Mam", Phone.NUMBER, "323-123-4567") + ); + assertStoredValues( + Phone.CONTENT_FILTER_URI.buildUpon().appendPath("dad") + .appendQueryParameter(Phone.SEARCH_DISPLAY_NAME_KEY, "0") + .appendQueryParameter(Phone.SEARCH_PHONE_NUMBER_KEY, "0") + .build() + ); + } + public void testPhoneLookup() { ContentValues values = new ContentValues(); values.put(RawContacts.CUSTOM_RINGTONE, "d"); |