Search in sources :

Example 1 with Account

use of com.uwetrottmann.seriesguide.backend.account.Account in project SeriesGuide by UweTrottmann.

the class HexagonTools method buildAccountService.

/**
     * Creates and returns a new instance for this hexagon service or null if not signed in.
     */
@Nullable
public synchronized Account buildAccountService() {
    GoogleAccountCredential credential = getAccountCredential(true);
    if (credential.getSelectedAccount() == null) {
        return null;
    }
    Account.Builder builder = new Account.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential);
    return CloudEndpointUtils.updateBuilder(app, builder).build();
}
Also used : GoogleSignInAccount(com.google.android.gms.auth.api.signin.GoogleSignInAccount) Account(com.uwetrottmann.seriesguide.backend.account.Account) GoogleAccountCredential(com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential) Nullable(android.support.annotation.Nullable)

Aggregations

Nullable (android.support.annotation.Nullable)1 GoogleSignInAccount (com.google.android.gms.auth.api.signin.GoogleSignInAccount)1 GoogleAccountCredential (com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential)1 Account (com.uwetrottmann.seriesguide.backend.account.Account)1