AI-generated Key Takeaways
-
The
WorkAccountApiinterface is deprecated and users should useWorkAccountClientinstead. -
WorkAccountApiprovides APIs to manage Android for Work Accounts for organizations not using Google Accounts. -
This interface includes methods for adding, removing, and changing the availability of work accounts.
This interface is deprecated.
Use WorkAccountClient
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 the EMM Developer's Overview .
Nested Class Summary
Public Method Summary
| abstract PendingResult < WorkAccountApi.AddAccountResult > | |
| abstract PendingResult < Result > | |
| abstract void | |
| abstract PendingResult < Result > |
Public Methods
public abstract PendingResult < WorkAccountApi.AddAccountResult > addWorkAccount ( GoogleApiClient apiClient, String token)
This method is deprecated.
Use WorkAccountClient
via WorkAccount.getClient(Activity)
instead.
Adds a work account to AccountManager
.
Parameters
| apiClient | The GoogleApiClient
to service this call. |
|---|---|
| token | OAuth token for the account. |
Returns
-
PendingResultindicating whether adding the account has succeeded.
public abstract PendingResult < Result > removeWorkAccount ( GoogleApiClient apiClient, Account account)
This method is deprecated.
Use WorkAccountClient
via WorkAccount.getClient(Activity)
instead.
Removes a work account from AccountManager
.
Parameters
| apiClient | The GoogleApiClient
to service this call. |
|---|---|
| account | the account to be removed. |
Returns
-
PendingResultindicating whether removing the account has succeeded.
public abstract void setWorkAuthenticatorEnabled ( GoogleApiClient apiClient, boolean enabled)
This method is deprecated.
Use WorkAccountClient
via WorkAccount.getClient(Activity)
instead.
Changes the availability of work accounts in AccountManager
.
Parameters
| apiClient | The GoogleApiClient
to service this call. |
|---|---|
| enabled | true
to enable work accounts; false
to disable work
accounts. |
public abstract PendingResult < Result > setWorkAuthenticatorEnabledWithResult ( GoogleApiClient apiClient, boolean enabled)
This method is deprecated.
Use WorkAccountClient
via WorkAccount.getClient(Activity)
instead.
Changes the availability of work accounts in AccountManager
.
Parameters
| apiClient | The GoogleApiClient
to service this call. |
|---|---|
| enabled | true
to enable work accounts; false
to disable work
accounts. |
Returns
-
PendingResultindicating whether enabling or disabling work accounts request has been accepted byAccountManager. Please note that the actual enabling or disabling operation is performed asynchronously.

