Prevent unstateful edits, empty trimming, INSERT edge cases.

Monkeys found some edge cases that could perform actions
when editor was in an invalid state.  Added validity checks
in about a dozen places to prevent.  Fixes http://b/2121368
and http://b/2115921

Hook up trimming of extra empty fields that users have
left blank, including dropping of entire RawContact if no
valid fields remain.  Also wrote a pile of unit tests to
verify behavior.  Fixes http://b/2112915

Don't CCO when inserting bundles that use CharSequence
instead of Strings.  Don't NPE when inserting bundles and
we encounter a DataKind that the chosen ContactsSource isn't
able to handle.  Fixes http://b/2105737 and http://b/2118580

Insert bundles for INSERT_AND_EDIT cases where user chose
to edit an existing contact.  Fixes http://b/2098856 and
http://b/1645578

Adopted new framework back key API from hackbod.
6 files changed