Merge "Trim text from autofillvalue when checking for empty." into oc-dev

This commit is contained in:
TreeHugger Robot
2017-06-16 22:50:42 +00:00
committed by Android (Google) Code Review

View File

@@ -141,7 +141,10 @@ public final class AutofillValue implements Parcelable {
* @hide
*/
public boolean isEmpty() {
return isText() && ((CharSequence) mValue).length() == 0;
if (!isText()) return false;
final CharSequence text = (CharSequence) mValue;
return text == null || TextUtils.getTrimmedLength(text) == 0;
}
/////////////////////////////////////