Trim text from autofillvalue when checking for empty.

Test: VirtualContainerActivityTest#testSaveDialogNotShownWhenBackIsPressed
Fixes: 62667931

Change-Id: I7e673eedd39fff7af89c694d0bfc5a495f14ea26
This commit is contained in:
Felipe Leme
2017-06-16 13:24:32 -07:00
parent 6f87503ed8
commit c5d4e068f2

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;
}
/////////////////////////////////////