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

Commit 703a70eb authored by Robert Greenwalt's avatar Robert Greenwalt Committed by Android Git Automerger
Browse files

am bf857065: Merge "Support multiple calls to AsyncChannel.disconnect"

* commit 'bf857065afa38bb55b370a6b4e38b4703d22376d':
  Support multiple calls to AsyncChannel.disconnect
parents 73d8f087 140d2d3e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -450,6 +450,7 @@ public class AsyncChannel {
    public void disconnect() {
        if ((mConnection != null) && (mSrcContext != null)) {
            mSrcContext.unbindService(mConnection);
            mConnection = null;
        }
        try {
            // Send the DISCONNECTED, although it may not be received
@@ -463,10 +464,12 @@ public class AsyncChannel {
        // Tell source we're disconnected.
        if (mSrcHandler != null) {
            replyDisconnected(STATUS_SUCCESSFUL);
            mSrcHandler = null;
        }
        // Unlink only when bindService isn't used
        if (mConnection == null && mDstMessenger != null && mDeathMonitor!= null) {
            mDstMessenger.getBinder().unlinkToDeath(mDeathMonitor, 0);
            mDeathMonitor = null;
        }
    }