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

Commit 032ab0d8 authored by Winson Chung's avatar Winson Chung
Browse files

Only unlink death recipient if binder was previously added

Bug: 183538974
Test: Presubmit
Change-Id: I255531e409cf666a01306ab486294be49a8f9483
parent 7cd37dcb
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -84,11 +84,15 @@ public class RemoteTransitionHandler implements Transitions.TransitionHandler {
    }

    void removeFiltered(IRemoteTransition remote) {
        remote.asBinder().unlinkToDeath(mTransitionDeathRecipient, 0 /* flags */);
        boolean removed = false;
        for (int i = mFilters.size() - 1; i >= 0; --i) {
            if (mFilters.get(i).second == remote) {
                mFilters.remove(i);
                removed = true;
            }
        }
        if (removed) {
            remote.asBinder().unlinkToDeath(mTransitionDeathRecipient, 0 /* flags */);
        }
    }