Modifier and Type | Field and Description |
---|---|
static String |
ACCOUNT_TYPE
Google account type.
|
Constructor and Description |
---|
GoogleAccountManager(android.accounts.AccountManager accountManager) |
GoogleAccountManager(android.content.Context context) |
Modifier and Type | Method and Description |
---|---|
android.accounts.Account |
getAccountByName(String accountName)
Returns the Google account of the given
Account.name . |
android.accounts.AccountManager |
getAccountManager()
Returns the account manager.
|
android.accounts.Account[] |
getAccounts()
Returns all Google accounts.
|
void |
invalidateAuthToken(String authToken)
Invalidates the given Google auth token by removing it from the account manager's cache (if
necessary) for example if the auth token has expired or otherwise become invalid.
|
public static final String ACCOUNT_TYPE
public GoogleAccountManager(android.accounts.AccountManager accountManager)
accountManager
- account managerpublic GoogleAccountManager(android.content.Context context)
context
- context from which to retrieve the account managerpublic android.accounts.AccountManager getAccountManager()
public android.accounts.Account[] getAccounts()
public android.accounts.Account getAccountByName(String accountName)
Account.name
.accountName
- Google account name or null
for null
resultnull
for none found or for null
inputpublic void invalidateAuthToken(String authToken)
authToken
- auth tokenCopyright © 2010–2021 Google. All rights reserved.