Skip to content

Fix leaks #429

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

Merged
merged 3 commits into from
Dec 1, 2016
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 @@ -55,6 +55,8 @@ public class FacebookProvider implements IdpProvider, FacebookCallback<LoginResu
private IdpCallback mCallbackObject;

public FacebookProvider(Context appContext, IdpConfig idpConfig) {
appContext = appContext.getApplicationContext();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to do this or only call getApplicationContext when we are passing it into the Facebook initializer?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. Either way would have been fine.


if (appContext.getResources().getIdentifier(
"facebook_permissions", "array", appContext.getPackageName()) != 0) {
Log.w(TAG, "DEVELOPER WARNING: You have defined R.array.facebook_permissions but that"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import android.util.Log;

import com.firebase.ui.auth.IdpResponse;
import com.firebase.ui.auth.R;
import com.google.firebase.auth.AuthCredential;
Expand All @@ -30,7 +30,7 @@ public TwitterProvider(Context appContext) {
TwitterAuthConfig authConfig = new TwitterAuthConfig(
appContext.getString(R.string.twitter_consumer_key),
appContext.getString(R.string.twitter_consumer_secret));
Fabric.with(appContext, new Twitter(authConfig));
Fabric.with(appContext.getApplicationContext(), new Twitter(authConfig));
mTwitterAuthClient = new TwitterAuthClient();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
return;
}

if (provider.equalsIgnoreCase(FacebookAuthProvider.PROVIDER_ID)) {
mIdpProvider = new FacebookProvider(getContext(), providerConfig);
} else if (provider.equalsIgnoreCase(GoogleAuthProvider.PROVIDER_ID)) {
if (provider.equalsIgnoreCase(GoogleAuthProvider.PROVIDER_ID)) {
mIdpProvider = new GoogleProvider(getActivity(), providerConfig, email);
} else if (provider.equalsIgnoreCase(FacebookAuthProvider.PROVIDER_ID)) {
mIdpProvider = new FacebookProvider(getContext(), providerConfig);
} else if (provider.equalsIgnoreCase(TwitterAuthProvider.PROVIDER_ID)) {
mIdpProvider = new TwitterProvider(getContext());
}
Expand Down