Update view when a contact is removed.

The existing code did not update a contact if it was already in the
cache and it was not find by the update query: this means that when a
contact is deleted or a number is removed from a contact, the call log
will not get updated until the entire data is invalidated.

This commit changes the way this is handled: extract two helper methods
for looking up SIP addresses and phone numbers; these functions will
return null in case an error occurs, but ContactInfo.EMPTY if no contact
is associated with a phone number. The returned info is used to update
the cache, even if no match was found, making it possible to update the
call log contact information when a contact is deleted or a phone number
removed.

As a further optimization, this code also takes care of only requesting
a redraw if the contact information has actually changed. This requires
a new equals method (and matching hashCode) on the ContactInfo class.

Bug: 5055883
Change-Id: I2cd930ca8dc935f62a43988abde44cd62cc99a1c
1 file changed