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

Commit 5a49329a authored by Etan Cohen's avatar Etan Cohen
Browse files

[AWARE] Make PeerHandle comparable/hashable

Add public equals()/hash() methods to PeerHandle. Allows the handle to
be used across multiple calls/sessions.

(cherry-pick of commit 4454bda0)

Bug: 68931709
Test: builds, unit test, integration test
Change-Id: Id06659a640931585893f21b9ee04982d921fe511
Merged-In: I87df50edb948a7afc90e496165013235ddca1e48
parent b76e9845
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -32,4 +32,22 @@ public class PeerHandle {

    /** @hide */
    public int peerId;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }

        if (!(o instanceof PeerHandle)) {
            return false;
        }

        return peerId == ((PeerHandle) o).peerId;
    }

    @Override
    public int hashCode() {
        return peerId;
    }
}