WorkAccountClient
Stay organized with collections
Save and categorize content based on your preferences.
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.
Inherited Method Summary
From class com.google.android.gms.common.api.GoogleApi
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
Public Methods
Parameters
token |
OAuth token for the account. |
Returns
Task
indicating whether adding the account has succeeded.
public Task<Void> removeWorkAccount (Account
account)
Parameters
account |
the account to be removed. |
Returns
Task
indicating whether removing the account has succeeded.
public Task<Void> setWorkAuthenticatorEnabled (boolean
enabled)
Parameters
enabled |
true to enable work accounts; false to 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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["`WorkAccountClient` manages Android for Work Accounts, offering methods for account lifecycle management."],["It is specifically designed for organizations that do not utilize Google Accounts."],["The client provides functionality to add, remove, and control the availability of work accounts within the Android Account Manager."],["`WorkAccountClient` uses tasks to indicate the success or acceptance of these account operations."]]],["The `WorkAccountClient` manages Android for Work accounts, which are for organizations not using Google Accounts. Key actions include: adding a work account using `addWorkAccount(String token)`, which utilizes an OAuth token; removing an account using `removeWorkAccount(Account account)`; and enabling/disabling work account availability in `AccountManager` with `setWorkAuthenticatorEnabled(boolean enabled)`. Each of these methods returns a `Task` to indicate success or failure. `getApiFallbackAttributionTag(Context arg0)` is inherited from `GoogleApi`.\n"]]