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

Commit 6943f7c4 authored by Roshan Pius's avatar Roshan Pius Committed by Android Git Automerger
Browse files

am affda16a: am 17b2a31a: am 0eb4da60: am 1cb0de17: Merge "Correct the...

am affda16a: am 17b2a31a: am 0eb4da60: am 1cb0de17: Merge "Correct the comparison done in removeAdapter." into mnc-dev

* commit 'affda16a':
  Correct the comparison done in removeAdapter.
parents 7aafe379 affda16a
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -48,6 +48,12 @@ final class ConnectionServiceAdapter implements DeathRecipient {
    }

    void addAdapter(IConnectionServiceAdapter adapter) {
        for (IConnectionServiceAdapter it : mAdapters) {
            if (it.asBinder() == adapter.asBinder()) {
                Log.w(this, "Ignoring duplicate adapter addition.");
                return;
            }
        }
        if (mAdapters.add(adapter)) {
            try {
                adapter.asBinder().linkToDeath(this, 0);
@@ -58,8 +64,13 @@ final class ConnectionServiceAdapter implements DeathRecipient {
    }

    void removeAdapter(IConnectionServiceAdapter adapter) {
        if (adapter != null && mAdapters.remove(adapter)) {
        if (adapter != null) {
            for (IConnectionServiceAdapter it : mAdapters) {
                if (it.asBinder() == adapter.asBinder() && mAdapters.remove(it)) {
                    adapter.asBinder().unlinkToDeath(this, 0);
                    break;
                }
            }
        }
    }