Fix Cancelling a text action activity deletes the selected text

The implementation of onActivityResult in TextView did not check the
result code, hence treating the cancelled activity result as a
replacement by empty text.

Also added tests to catch this case and basic usage.

Bug: 21183019
Change-Id: Ibdafe89474dd69c5b70c67ec98fed46656f9fdcf
2 files changed