diff options
Diffstat (limited to 'src/com/android/se/Channel.java')
-rw-r--r-- | src/com/android/se/Channel.java | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/com/android/se/Channel.java b/src/com/android/se/Channel.java index 4fbb2a0..d6df415 100644 --- a/src/com/android/se/Channel.java +++ b/src/com/android/se/Channel.java @@ -89,21 +89,23 @@ public class Channel implements IBinder.DeathRecipient { /** * Closes the channel. */ - public synchronized void close() { + public void close() { synchronized (mLock) { - if (isBasicChannel()) { - Log.i(mTag, "Close basic channel - Select without AID ..."); - mTerminal.selectDefaultApplication(); - } - - mTerminal.closeChannel(this); + if (isClosed()) + return; mIsClosed = true; - if (mBinder != null) { - mBinder.unlinkToDeath(this, 0); - } - if (mSession != null) { - mSession.removeChannel(this); - } + } + if (isBasicChannel()) { + Log.i(mTag, "Close basic channel - Select without AID ..."); + mTerminal.selectDefaultApplication(); + } + + mTerminal.closeChannel(this); + if (mBinder != null) { + mBinder.unlinkToDeath(this, 0); + } + if (mSession != null) { + mSession.removeChannel(this); } } |