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

Commit 98b27030 authored by Santos Cordon's avatar Santos Cordon
Browse files

Add toString & equals helper methods to PhoneAccount.java

Bug: 16292368
Change-Id: I5dd2bcd2d65e856107ac2f80958e8b408abcec0b
parent 3bd60f44
Loading
Loading
Loading
Loading
+22 −0
Original line number Original line Diff line number Diff line
@@ -124,6 +124,28 @@ public class PhoneAccount implements Parcelable {
                Objects.hashCode(mHandle) + mCapabilities;
                Objects.hashCode(mHandle) + mCapabilities;
    }
    }


    @Override
    public String toString() {
        return new StringBuilder().append(mComponentName)
                    .append(", ")
                    .append(mId)
                    .append(", ")
                    .append(Log.pii(mHandle))
                    .append(", ")
                    .append(String.valueOf(mCapabilities))
                    .toString();
    }

    /**
     * TODO: Change this to just be equals() and use Set<> in Telecomm code instead of Lists.
     * @hide
     */
    public boolean equalsComponentAndId(PhoneAccount other) {
        return other != null &&
                Objects.equals(other.getComponentName(), getComponentName()) &&
                Objects.equals(other.getId(), getId());
    }

    //
    //
    // Parcelable implementation.
    // Parcelable implementation.
    //
    //