WorkAccountClient

public classWorkAccountClientextendsGoogleApi<Api.ApiOptions.NoOptions>

Client to manage Android for Work Accounts. This class provides methods for managing the lifecycle of work accounts.

Android for Work Accounts are for organizations that don't use Google Accounts. For details, see theEMM Developer's Overview.

Public Method Summary

Task<Account>
addWorkAccount(Stringtoken)
Adds a work account toAccountManager.
Task<Void>
removeWorkAccount(Account account)
Removes a work account fromAccountManager.
Task<Void>
setWorkAuthenticatorEnabled(boolean enabled)
Changes the availability of work accounts inAccountManager.

Inherited Method Summary

Public Methods

publicTask<Account> addWorkAccount(Stringtoken)

Adds a work account toAccountManager.

Parameters
token OAuth token for the account.
Returns
  • Task indicating whether adding the account has succeeded.

publicTask<Void>removeWorkAccount(Account account)

Removes a work account fromAccountManager.

Parameters
account the account to be removed.
Returns
  • Task indicating whether removing the account has succeeded.

publicTask<Void>setWorkAuthenticatorEnabled(boolean enabled)

Changes the availability of work accounts inAccountManager.

Parameters
enabled trueto enable work accounts;falseto disable work accounts.
Returns
  • Task indicating whether enabling or disabling work accounts request has been accepted by AccountManager. Please note that the actual enabling or disabling operation is performed asynchronously.