WorkAccountClient | Doclava
public class

WorkAccountClient

extends GoogleApi<Api.ApiOptions.NoOptions>
java.lang.Object
   ↳ com.google.android.gms.common.api.GoogleApi<com.google.android.gms.common.api.Api.ApiOptions.NoOptions>
     ↳ com.google.android.gms.auth.account.WorkAccountClient

Class Overview

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 the EMM Developer's Overview.

Summary

Public Methods
Task<Account> addWorkAccount(String token)
Adds a work account to AccountManager.
Task<Void> removeWorkAccount(Account account)
Removes a work account from AccountManager.
Task<Void> setWorkAuthenticatorEnabled(boolean enabled)
Changes the availability of work accounts in AccountManager.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public Task<Account> addWorkAccount (String token)

Adds a work account to AccountManager.

Parameters
token String:OAuth token for the account.

Returns
Task<Account> Task indicating whether adding the account has succeeded.

public Task<Void> removeWorkAccount (Account account)

Removes a work account from AccountManager.

Parameters
account Account:the account to be removed.

Returns
Task<Void> Task indicating whether removing the account has succeeded.

public Task<Void> setWorkAuthenticatorEnabled (boolean enabled)

Changes the availability of work accounts in AccountManager.

Parameters
enabled boolean:true to enable work accounts; false to disable work accounts.

Returns
Task<Void> 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.