private void close() { synchronized (mSessions) { if (mSessions.remove(toString()) == null) { // the session was already closed, so bail out now return; } } if (mResponse != null) { // stop listening for response deaths mResponse.asBinder().unlinkToDeath(this, 0 /* flags */); // clear this so that we don't accidentally send any further results mResponse = null; } unbind(); }
Session(IAccountManagerResponse response, int userId, AuthenticatorInfo info, boolean expectActivityLaunch, boolean stripAuthTokenFromResult, String accountName, boolean authDetailsRequired, boolean updateLastAuthenticatedTime) { if (info == null) throw new IllegalArgumentException("accountType is null"); this.mStripAuthTokenFromResult = stripAuthTokenFromResult; this.mResponse = response; this.mUserId = userId; this.mAuthenticatorInfo = info; this.mExpectActivityLaunch = expectActivityLaunch; this.mCreationTime = SystemClock.elapsedRealtime(); this.mAccountName = accountName; this.mAuthDetailsRequired = authDetailsRequired; this.mUpdateLastAuthenticatedTime = updateLastAuthenticatedTime; synchronized (mSessions) { mSessions.put(toString(), this); } if (response != null) { try { response.asBinder().linkToDeath(this, 0 /* flags */); } catch (RemoteException e) { mResponse = null; binderDied(); } } }
private void close() { synchronized (mSessions) { if (mSessions.remove(toString()) == null) { // the session was already closed, so bail out now return; } } if (mResponse != null) { // stop listening for response deaths mResponse.asBinder().unlinkToDeath(this, 0 /* flags */); // clear this so that we don't accidentally send any further results mResponse = null; } unbind(); }
private void close() { synchronized (mSessions) { if (mSessions.remove(toString()) == null) { // the session was already closed, so bail out now return; } } if (mResponse != null) { // stop listening for response deaths mResponse.asBinder().unlinkToDeath(this, 0 /* flags */); // clear this so that we don't accidentally send any further results mResponse = null; } unbind(); }
Session(IAccountManagerResponse response, int userId, AuthenticatorInfo info, boolean expectActivityLaunch, boolean stripAuthTokenFromResult, String accountName, boolean authDetailsRequired, boolean updateLastAuthenticatedTime) { if (info == null) throw new IllegalArgumentException("accountType is null"); this.mStripAuthTokenFromResult = stripAuthTokenFromResult; this.mResponse = response; this.mUserId = userId; this.mAuthenticatorInfo = info; this.mExpectActivityLaunch = expectActivityLaunch; this.mCreationTime = SystemClock.elapsedRealtime(); this.mAccountName = accountName; this.mAuthDetailsRequired = authDetailsRequired; this.mUpdateLastAuthenticatedTime = updateLastAuthenticatedTime; synchronized (mSessions) { mSessions.put(toString(), this); } if (response != null) { try { response.asBinder().linkToDeath(this, 0 /* flags */); } catch (RemoteException e) { mResponse = null; binderDied(); } } }
Session(IAccountManagerResponse response, int userId, AuthenticatorInfo info, boolean expectActivityLaunch, boolean stripAuthTokenFromResult, String accountName, boolean authDetailsRequired, boolean updateLastAuthenticatedTime) { if (info == null) throw new IllegalArgumentException("accountType is null"); this.mStripAuthTokenFromResult = stripAuthTokenFromResult; this.mResponse = response; this.mUserId = userId; this.mAuthenticatorInfo = info; this.mExpectActivityLaunch = expectActivityLaunch; this.mCreationTime = SystemClock.elapsedRealtime(); this.mAccountName = accountName; this.mAuthDetailsRequired = authDetailsRequired; this.mUpdateLastAuthenticatedTime = updateLastAuthenticatedTime; synchronized (mSessions) { mSessions.put(toString(), this); } if (response != null) { try { response.asBinder().linkToDeath(this, 0 /* flags */); } catch (RemoteException e) { mResponse = null; binderDied(); } } }