<commit_before>package com.mantralabsglobal.cashin.social;

import android.content.Context;
import android.os.AsyncTask;
import android.util.Log;

import com.google.android.gms.auth.GoogleAuthException;
import com.google.android.gms.auth.GoogleAuthUtil;
import com.google.android.gms.auth.UserRecoverableAuthException;
import com.google.android.gms.common.Scopes;
import com.mantralabsglobal.cashin.ui.activity.app.BaseActivity;

import java.io.IOException;

/**
 * Created by hello on 7/23/2015.
 */
public abstract class GoogleTokenRetrieverTask extends AsyncTask<Context, Void, String> {

    protected static final String GMAIL_SCOPE = "https://www.googleapis.com/auth/gmail.readonly";

    private static final String TAG = GoogleTokenRetrieverTask.class.getSimpleName();

    public String executeSync(Context context)
    {
        return doInBackground(context);
    }

    @Override
    protected String doInBackground(Context... params) {
        String scope = getScope();

        Context context = params[0];
        try {
            return GoogleAuthUtil.getToken(context, getEmail() , scope);

        } catch (IOException e) {
            Log.e(TAG, "Failed to get token for server", e);
            onException(e);
        } catch (UserRecoverableAuthException e) {
            Log.e(TAG, "Failed to get token for server", e);
            onException(e);
        } catch (GoogleAuthException e) {
            Log.e(TAG, "Failed to get token for server", e);
            onException(e);
        }
        return null;
    }

    protected String getScope()
    {
        return "oauth2:" + Scopes.PROFILE + " " + Scopes.PLUS_LOGIN;
    }<commit_msg>Adding email to google login token<commit_after>package com.mantralabsglobal.cashin.social;

import android.content.Context;
import android.os.AsyncTask;
import android.util.Log;

import com.google.android.gms.auth.GoogleAuthException;
import com.google.android.gms.auth.GoogleAuthUtil;
import com.google.android.gms.auth.UserRecoverableAuthException;
import com.google.android.gms.common.Scopes;
import com.mantralabsglobal.cashin.ui.activity.app.BaseActivity;

import java.io.IOException;

/**
 * Created by hello on 7/23/2015.
 */
public abstract class GoogleTokenRetrieverTask extends AsyncTask<Context, Void, String> {

    protected static final String GMAIL_SCOPE = "https://www.googleapis.com/auth/gmail.readonly";

    private static final String TAG = GoogleTokenRetrieverTask.class.getSimpleName();

    public String executeSync(Context context)
    {
        return doInBackground(context);
    }

    @Override
    protected String doInBackground(Context... params) {
        String scope = getScope();

        Context context = params[0];
        try {
            return GoogleAuthUtil.getToken(context, getEmail() , scope);

        } catch (IOException e) {
            Log.e(TAG, "Failed to get token for server", e);
            onException(e);
        } catch (UserRecoverableAuthException e) {
            Log.e(TAG, "Failed to get token for server", e);
            onException(e);
        } catch (GoogleAuthException e) {
            Log.e(TAG, "Failed to get token for server", e);
            onException(e);
        }
        return null;
    }

    protected String getScope()
    {
        return "oauth2:" + Scopes.PROFILE + " " + Scopes.PLUS_LOGIN + " email";
    }
{'fraction_non_alphanumeric': 0.10552913198573127, 'fraction_numerical': 0.00535077288941736, 'mean_word_length': 2.9634864546525326, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1223024', 'n_tokens_mistral': 1004, 'n_tokens_neox': 959, 'n_words': 230}