Tweak behavior of encodeHex

The Hex.encodeHex() function takes a "zeroTerminated" argument
that means, "when you see a zero byte, end the string".  This is
being used on Collator keys, which are opaque binary blobs, and
not guaranteed to have a specific format.

This change makes the code work like the framework's DatabaseUtils
functions (getCollationKey/getKeyLen) which will remove the zero
termination if it exists, but otherwise retain the string in its
entirety.  This still breaks encapsulation, but is incrementally
closer to correct behavior.

Because ICU happens to return collation keys that look like C strings,
this yields no actual change.  All Contacts provider tests behave
as they did before the change, and the "nicknames" table (which
contains hexified collation keys) is unchanged.

Change-Id: Ibf5f31132f4d3119d416b8af7765f9c6eca5b841
1 file changed