Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cognito auth release service #615

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ private Auth(final Context context,
this.signOutRedirectUri = signOutRedirectUri;
this.scopes = scopes;
this.user = new AuthClient(context, this);
this.user = new AuthClient(context, this);
this.user.setUserHandler(userHandler);
this.userPoolId = userPoolId;
this.advancedSecurityDataCollectionFlag = advancedSecurityDataCollectionFlag;
Expand Down Expand Up @@ -655,4 +654,11 @@ public Auth setUsername(final String username) {
this.user.setUsername(username);
return this;
}

/**
* Release resources used by {@link Auth}
*/
public void release() {
this.user.unbindServiceConnection();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,15 @@ public void getTokens(final Uri uri) {
getTokens(uri, userHandler);
}


/**
* Unbind {@link AuthClient#mCustomTabsServiceConnection}
*/
public void unbindServiceConnection() {
if(mCustomTabsServiceConnection != null)
context.unbindService(mCustomTabsServiceConnection);
}

/**
* Internal method to exchange code for tokens.
* <p>
Expand Down