Fix failure to save a new contact with a photo.
When saving a new contact, we don't know the raw-contact id and
therefore use a "random" negative number. If the new contact has a
photo, we attempt to save it at a bogus path generated from this id.
This manifests as a NullPointerException due to a bug in our
exception-handling code. However, fixing this bug isn't enough
because we still need the photo to save properly.
To achieve this, we check for a negative raw-contact id before saving
the photo. If we detect one, we replace it with the newly-generated
id that we just obtained when we first saved the raw-contact.
Bug: 5937734
Change-Id: Icba2be0e21885fcb418ea9c8c12ebc9820f33bfd
1 file changed