WorkAccountApi

public interfaceWorkAccountApi

This interface is deprecated.
UseWorkAccountClient via WorkAccount.getClient(Activity)instead.

Set of APIs to manage Android for Work Accounts. This class provides methods for managing the life cycle of work accounts.

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

Nested Class Summary

interface WorkAccountApi.AddAccountResult This interface is deprecated. Use WorkAccountClient via WorkAccount.getClient(Activity)instead.

Public Method Summary

abstractPendingResult<WorkAccountApi.AddAccountResult>
addWorkAccount(GoogleApiClient apiClient,Stringtoken)
This method is deprecated. Use WorkAccountClientvia WorkAccount.getClient(Activity)instead.
abstractPendingResult<Result>
removeWorkAccount(GoogleApiClient apiClient,Account account)
This method is deprecated. Use WorkAccountClientvia WorkAccount.getClient(Activity)instead.
abstract void
setWorkAuthenticatorEnabled(GoogleApiClient apiClient, boolean enabled)
This method is deprecated. Use WorkAccountClientvia WorkAccount.getClient(Activity)instead.
abstractPendingResult<Result>
setWorkAuthenticatorEnabledWithResult(GoogleApiClient apiClient, boolean enabled)
This method is deprecated. Use WorkAccountClientvia WorkAccount.getClient(Activity)instead.

Public Methods

public abstractPendingResult<WorkAccountApi.AddAccountResult> addWorkAccount(GoogleApiClient apiClient,String token)

This method is deprecated.
UseWorkAccountClient via WorkAccount.getClient(Activity)instead.

Adds a work account toAccountManager.

Parameters
apiClient TheGoogleApiClient to service this call.
token OAuth token for the account.
Returns
  • PendingResult indicating whether adding the account has succeeded.

public abstractPendingResult<Result> removeWorkAccount(GoogleApiClient apiClient,Account account)

This method is deprecated.
UseWorkAccountClient via WorkAccount.getClient(Activity)instead.

Removes a work account fromAccountManager.

Parameters
apiClient TheGoogleApiClient to service this call.
account the account to be removed.
Returns
  • PendingResult indicating whether removing the account has succeeded.

public abstract voidsetWorkAuthenticatorEnabled(GoogleApiClient apiClient, boolean enabled)

This method is deprecated.
UseWorkAccountClient via WorkAccount.getClient(Activity)instead.

Changes the availability of work accounts inAccountManager.

Parameters
apiClient TheGoogleApiClient to service this call.
enabled trueto enable work accounts;falseto disable work accounts.

public abstractPendingResult<Result> setWorkAuthenticatorEnabledWithResult (GoogleApiClient apiClient, boolean enabled)

This method is deprecated.
UseWorkAccountClient via WorkAccount.getClient(Activity)instead.

Changes the availability of work accounts inAccountManager.

Parameters
apiClient TheGoogleApiClient to service this call.
enabled trueto enable work accounts;falseto disable work accounts.
Returns
  • PendingResult 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.