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

Commit 0223ffb4 authored by Felipe Leme's avatar Felipe Leme
Browse files

Improved some toString() methods.

- Never display AutoFillValue.text, because it could be sensitive.
- Simplified AutoFilllId.

Fixes: 35171960

Test: manual verification
Test: CtsAutoFillServiceTestCases passes

Change-Id: I0853cabb695b842c947b0ae007e344f5d8385395
parent fb0f3602
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -93,11 +93,11 @@ public final class AutoFillId implements Parcelable {
    public String toString() {
        if (!DEBUG) return super.toString();

        final StringBuilder builder = new StringBuilder("FieldId [viewId=").append(mViewId);
        final StringBuilder builder = new StringBuilder().append(mViewId);
        if (mVirtual) {
            builder.append(", virtualId=").append(mVirtualId);
            builder.append(":").append(mVirtualId);
        }
        return builder.append(']').toString();
        return builder.toString();
    }

    @Override
+5 −2
Original line number Diff line number Diff line
@@ -104,8 +104,11 @@ public final class AutoFillValue implements Parcelable {
    public String toString() {
        if (!DEBUG) return super.toString();

        return "AutoFillValue[text=" + mText + ", listIndex=" + mListIndex + ", toggle=" + mToggle
                + "]";
        if (mText != null) {
            return mText.length() + "_chars";
        }

        return "[listIndex=" + mListIndex + ", toggle=" + mToggle + "]";
    }

    /////////////////////////////////////
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ public final class Helper {
    static StringBuilder append(StringBuilder builder, Bundle bundle) {
        if (bundle == null) {
            builder.append("N/A");
        } else if (!DEBUG) {
        } else if (!VERBOSE) {
            builder.append(REDACTED);
        } else {
            final Set<String> keySet = bundle.keySet();
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ final class Helper {
    static void append(StringBuilder builder, Bundle bundle) {
        if (bundle == null) {
            builder.append("N/A");
        } else if (!DEBUG) {
        } else if (!VERBOSE) {
            builder.append(REDACTED);
        } else {
            final Set<String> keySet = bundle.keySet();