Reverse a recently-introduced incorrect check for multi-character
ellipsis in Layout.java. The check was introduced in
Id1dfdc503f87fabed2447d55ab2107eee0eccd08.
Test: bit CtsTextTestCases:*
Test: bit FrameworksCoreTests:android.text.
Change-Id: I79198be0bd202a303f8db02a235c2af3b76abf32
final String ellipsisString = TextUtils.getEllipsisString(method);
final int ellipsisStringLen = ellipsisString.length();
+ // Use the ellipsis string only if there are that at least as many characters to replace.
+ final boolean useEllipsisString = ellipsisCount >= ellipsisStringLen;
for (int i = 0; i < ellipsisCount; i++) {
final char c;
- if (i < ellipsisStringLen && ellipsisCount <= ellipsisStringLen) {
+ if (useEllipsisString && i < ellipsisStringLen) {
c = ellipsisString.charAt(i);
} else {
c = TextUtils.ELLIPSIS_FILLER;