diff options
author | Dmitri Plotnikov <dplotnikov@google.com> | 2010-10-14 14:17:18 -0700 |
---|---|---|
committer | Dmitri Plotnikov <dplotnikov@google.com> | 2010-10-14 14:17:18 -0700 |
commit | 093b6446d0c63b8d725324ea41369b76ace153df (patch) | |
tree | 4971bb7b28fa217d208229f780ca5d2b31fb992e /tests | |
parent | 72c7667755dfabba69a2afa479185a3ab458e948 (diff) | |
download | packages_providers_ContactsProvider-093b6446d0c63b8d725324ea41369b76ace153df.zip packages_providers_ContactsProvider-093b6446d0c63b8d725324ea41369b76ace153df.tar.gz packages_providers_ContactsProvider-093b6446d0c63b8d725324ea41369b76ace153df.tar.bz2 |
Fixing the trigger for aggregated presence.
Aggregated presence was not updated properly
when presence was changed to NULL.
Added a test that covers the specific situation.
Bug: 3069107
Change-Id: I52396db7c9006e9f18ec6b7c51b22ba09c0ae480
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/android/providers/contacts/ContactsProvider2Test.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/src/com/android/providers/contacts/ContactsProvider2Test.java b/tests/src/com/android/providers/contacts/ContactsProvider2Test.java index 5114894..5b40485 100644 --- a/tests/src/com/android/providers/contacts/ContactsProvider2Test.java +++ b/tests/src/com/android/providers/contacts/ContactsProvider2Test.java @@ -1345,6 +1345,34 @@ public class ContactsProvider2Test extends BaseContactsProvider2Test { assertStoredValuesWithProjection(contactUri, values); } + public void testStatusUpdateUpdateToNull() { + long rawContactId = createRawContact(); + insertImHandle(rawContactId, Im.PROTOCOL_AIM, null, "aim"); + + long contactId = queryContactId(rawContactId); + Uri contactUri = ContentUris.withAppendedId(Contacts.CONTENT_URI, contactId); + + ContentValues values = new ContentValues(); + Uri statusUri = + insertStatusUpdate(Im.PROTOCOL_AIM, null, "aim", StatusUpdates.AVAILABLE, "Available", + StatusUpdates.CAPABILITY_HAS_CAMERA); + long statusId = ContentUris.parseId(statusUri); + + values.put(Contacts.CONTACT_PRESENCE, StatusUpdates.AVAILABLE); + values.put(Contacts.CONTACT_STATUS, "Available"); + assertStoredValuesWithProjection(contactUri, values); + + values.clear(); + values.putNull(StatusUpdates.PRESENCE); + mResolver.update(StatusUpdates.CONTENT_URI, values, + StatusUpdates.DATA_ID + "=" + statusId, null); + + values.clear(); + values.putNull(Contacts.CONTACT_PRESENCE); + values.put(Contacts.CONTACT_STATUS, "Available"); + assertStoredValuesWithProjection(contactUri, values); + } + public void testStatusUpdateWithTimestamp() { long rawContactId = createRawContact(); insertImHandle(rawContactId, Im.PROTOCOL_AIM, null, "aim"); |