Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eaf72e87 authored by Felipe Leme's avatar Felipe Leme Committed by android-build-merger
Browse files

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

am: 2de4d6bc

Change-Id: I8eb50d5191b2393011c297671bd5d3c65e1beb7e
parents b5e0a5be 2de4d6bc
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -141,7 +141,10 @@ public final class AutofillValue implements Parcelable {
     * @hide
     * @hide
     */
     */
    public boolean isEmpty() {
    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;
    }
    }


    /////////////////////////////////////
    /////////////////////////////////////