Fix off-by-one error in computeEllipsis

In the Truncate.MIDDLE case, when the line is less than half the layout
width, the computeEllipsis logic could go past the left edge of the
string. This patch fixes the off-by-one and avoids the resulting index
out of bounds crash, and also changes the behavior so that when
ellipsizing at the middle, the string to the end of the paragraph is
taken into account.

Bug: 18508627
Change-Id: I24be09c23a5aa158791a9717419307613b8a22e8
1 file changed