{
	"id": "4dd70aff-6028-46ef-ac18-3df241e92912",
	"created_at": "2026-04-06T00:22:35.345937Z",
	"updated_at": "2026-04-10T03:20:49.457741Z",
	"deleted_at": null,
	"sha1_hash": "d88fcc6e28f08d2b7189fcf5ffb74a016886d177",
	"title": "AccountManager  |  API reference  |  Android Developers",
	"llm_title": "",
	"authors": "",
	"file_creation_date": "0001-01-01T00:00:00Z",
	"file_modification_date": "0001-01-01T00:00:00Z",
	"file_size": 678081,
	"plain_text": "AccountManager  |  API reference  |  Android Developers\r\nArchived: 2026-04-05 17:26:22 UTC\r\nAccountManager Stay organized with collections Save and categorize content based on\r\nyour preferences.\r\npublic class AccountManager\r\nextends Object\r\nThis class provides access to a centralized registry of the user's online accounts. The user enters credentials (username and\r\npassword) once per account, granting applications access to online resources with \"one-click\" approval.\r\nDifferent online services have different ways of handling accounts and authentication, so the account manager uses\r\npluggable authenticator modules for different account types. Authenticators (which may be written by third parties) handle\r\nthe actual details of validating account credentials and storing account information. For example, Google, Facebook, and\r\nMicrosoft Exchange each have their own authenticator.\r\nMany servers support some notion of an authentication token, which can be used to authenticate a request to the server\r\nwithout sending the user's actual password. (Auth tokens are normally created with a separate request which does include\r\nthe user's credentials.) AccountManager can generate auth tokens for applications, so the application doesn't need to handle\r\npasswords directly. Auth tokens are normally reusable and cached by AccountManager, but must be refreshed periodically.\r\nIt's the responsibility of applications to invalidate auth tokens when they stop working so the AccountManager knows it\r\nneeds to regenerate them.\r\nApplications accessing a server normally go through these steps:\r\nGet an instance of AccountManager using get(Context) .\r\nList the available accounts using getAccountsByType(String) or getAccountsByTypeAndFeatures(String, String,\r\nAccountManagerCallback, Handler) . Normally applications will only be interested in accounts with one particular\r\ntype, which identifies the authenticator. Account features are used to identify particular account subtypes and\r\ncapabilities. Both the account type and features are authenticator-specific strings, and must be known by the\r\napplication in coordination with its preferred authenticators.\r\nSelect one or more of the available accounts, possibly by asking the user for their preference. If no suitable accounts\r\nare available, addAccount(String, String, String, Bundle, Activity, AccountManagerCallback, Handler) may\r\nbe called to prompt the user to create an account of the appropriate type.\r\nImportant: If the application is using a previously remembered account selection, it must make sure the account is\r\nstill in the list of accounts returned by getAccountsByType(String) . Requesting an auth token for an account no\r\nlonger on the device results in an undefined failure.\r\nRequest an auth token for the selected account(s) using one of the getAuthToken(Account, String, Bundle,\r\nActivity, AccountManagerCallback, Handler) methods or related helpers. Refer to the description of each method\r\nfor exact usage and error handling details.\r\nMake the request using the auth token. The form of the auth token, the format of the request, and the protocol used\r\nare all specific to the service you are accessing. The application may use whatever network and protocol libraries are\r\nuseful.\r\nImportant: If the request fails with an authentication error, it could be that a cached auth token is stale and no longer\r\nhonored by the server. The application must call invalidateAuthToken(String, String) to remove the token from\r\nthe cache, otherwise requests will continue failing! After invalidating the auth token, immediately go back to the\r\n\"Request an auth token\" step above. If the process fails the second time, then it can be treated as a \"genuine\"\r\nauthentication failure and the user notified or other appropriate actions taken.\r\nSome AccountManager methods may need to interact with the user to prompt for credentials, present options, or ask the user\r\nto add an account. The caller may choose whether to allow AccountManager to directly launch the necessary user interface\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 1 of 36\n\nand wait for the user, or to return an Intent which the caller may use to launch the interface, or (in some cases) to install a\r\nnotification which the user can select at any time to launch the interface. To have AccountManager launch the interface\r\ndirectly, the caller must supply the current foreground Activity context.\r\nMany AccountManager methods take AccountManagerCallback and Handler as parameters. These methods return\r\nimmediately and run asynchronously. If a callback is provided then AccountManagerCallback.run will be invoked on the\r\nHandler's thread when the request completes, successfully or not. The result is retrieved by calling\r\nAccountManagerFuture.getResult() on the AccountManagerFuture returned by the method (and also passed to the\r\ncallback). This method waits for the operation to complete (if necessary) and either returns the result or throws an exception\r\nif an error occurred during the operation. To make the request synchronously, call AccountManagerFuture.getResult()\r\nimmediately on receiving the future from the method; no callback need be supplied.\r\nRequests which may block, including AccountManagerFuture.getResult() , must never be called on the application's main\r\nevent thread. These operations throw IllegalStateException if they are used on the main thread.\r\nSummary\r\nConstants\r\nString\r\nACTION_ACCOUNT_REMOVED\r\nAction sent as a broadcast Intent by the AccountsService when any account is removed or renamed.\r\nString ACTION_AUTHENTICATOR_INTENT\r\nString AUTHENTICATOR_ATTRIBUTES_NAME\r\nString AUTHENTICATOR_META_DATA_NAME\r\nint ERROR_CODE_BAD_ARGUMENTS\r\nint ERROR_CODE_BAD_AUTHENTICATION\r\nint ERROR_CODE_BAD_REQUEST\r\nint ERROR_CODE_CANCELED\r\nint ERROR_CODE_INVALID_RESPONSE\r\nint ERROR_CODE_NETWORK_ERROR\r\nint ERROR_CODE_REMOTE_EXCEPTION\r\nint ERROR_CODE_UNSUPPORTED_OPERATION\r\nString KEY_ACCOUNTS\r\nString KEY_ACCOUNT_AUTHENTICATOR_RESPONSE\r\nString KEY_ACCOUNT_MANAGER_RESPONSE\r\nString\r\nKEY_ACCOUNT_NAME\r\nBundle key used for the String account name in results from methods which return information about a\r\nparticular account.\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 2 of 36\n\nString\r\nKEY_ACCOUNT_SESSION_BUNDLE\r\nBundle key used for a Bundle in result from startAddAccountSession(String, String, String, Bundle,\r\nActivity, AccountManagerCallback, Handler) and friends which returns session data for installing an\r\naccount later.\r\nString\r\nKEY_ACCOUNT_STATUS_TOKEN\r\nBundle key used for the String account status token in result from startAddAccountSession(String,\r\nString, String, Bundle, Activity, AccountManagerCallback, Handler) and friends which returns\r\ninformation about a particular account.\r\nString\r\nKEY_ACCOUNT_TYPE\r\nBundle key used for the String account type in results from methods which return information about a\r\nparticular account.\r\nString\r\nKEY_ANDROID_PACKAGE_NAME\r\nThe Android package of the caller will be set in the options bundle by the AccountManager and will be\r\npassed to the AccountManagerService and to the AccountAuthenticators.\r\nString KEY_AUTHENTICATOR_TYPES\r\nString\r\nKEY_AUTHTOKEN\r\nBundle key used for the auth token value in results from getAuthToken(Account, String, Bundle,\r\nActivity, AccountManagerCallback, Handler) and friends.\r\nString KEY_AUTH_FAILED_MESSAGE\r\nString KEY_AUTH_TOKEN_LABEL\r\nString KEY_BOOLEAN_RESULT\r\nString\r\nKEY_CALLER_PID\r\nThe process id of caller app.\r\nString\r\nKEY_CALLER_UID\r\nThe UID of caller app.\r\nString KEY_ERROR_CODE\r\nString KEY_ERROR_MESSAGE\r\nString\r\nKEY_INTENT\r\nBundle key used for an Intent in results from methods that may require the caller to interact with the\r\nuser.\r\nString\r\nKEY_LAST_AUTHENTICATED_TIME\r\nBundle key used to supply the last time the credentials of the account were authenticated successfully.\r\nString KEY_PASSWORD\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 3 of 36\n\nBundle key used to supply the password directly in options to confirmCredentials(Account, Bundle,\r\nActivity, AccountManagerCallback, Handler) , rather than prompting the user with the standard password\r\nprompt.\r\nString KEY_USERDATA\r\nString\r\nLOGIN_ACCOUNTS_CHANGED_ACTION\r\nThis constant was deprecated in API level 26. use\r\naddOnAccountsUpdatedListener(OnAccountsUpdateListener, Handler, boolean) to get account updates\r\nin runtime.\r\nString\r\nPACKAGE_NAME_KEY_LEGACY_NOT_VISIBLE\r\nKey to set default visibility for applications which don't satisfy conditions in\r\nPACKAGE_NAME_KEY_LEGACY_VISIBLE .\r\nString\r\nPACKAGE_NAME_KEY_LEGACY_VISIBLE\r\nKey to set visibility for applications which satisfy one of the following conditions:\r\nTarget API level below Build.VERSION_CODES.O and have deprecated\r\nManifest.permission.GET_ACCOUNTS permission.\r\nint\r\nVISIBILITY_NOT_VISIBLE\r\nAccount is not visible to given application and only authenticator can grant visibility.\r\nint\r\nVISIBILITY_UNDEFINED\r\nAccount visibility was not set.\r\nint\r\nVISIBILITY_USER_MANAGED_NOT_VISIBLE\r\nAccount is not visible to given application, but user can reveal it, for example, using\r\nnewChooseAccountIntent(Account,List,String[],String,String,String[],Bundle)\r\nint\r\nVISIBILITY_USER_MANAGED_VISIBLE\r\nAccount is visible to given application, but user can revoke visibility.\r\nint\r\nVISIBILITY_VISIBLE\r\nAccount is always visible to given application and only authenticator can revoke visibility.\r\nPublic methods\r\nAccountManagerFuture\u003cBundle\u003e\r\naddAccount(String accountType, String authTokenType, String[] requiredFeatures, Bundle\r\naddAccountOptions, Activity activity, AccountManagerCallback\u003cBundle\u003e callback, Handler h\r\nAsks the user to add an account of a specified type.\r\nboolean\r\naddAccountExplicitly(Account account, String password, Bundle userdata)\r\nAdds an account directly to the AccountManager.\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 4 of 36\n\nboolean\r\naddAccountExplicitly(Account account, String password, Bundle extras, Map\u003cString,Integ\r\nvisibility)\r\nAdds an account directly to the AccountManager.\r\nvoid\r\naddOnAccountsUpdatedListener(OnAccountsUpdateListener listener, Handler handler, boolea\r\nupdateImmediately, String[] accountTypes)\r\nAdds an OnAccountsUpdateListener to this instance of the AccountManager .\r\nvoid\r\naddOnAccountsUpdatedListener(OnAccountsUpdateListener listener, Handler handler, boolea\r\nupdateImmediately)\r\nAdds an OnAccountsUpdateListener to this instance of the AccountManager .\r\nString\r\nblockingGetAuthToken(Account account, String authTokenType, boolean notifyAuthFailure)\r\nThis convenience helper synchronously gets an auth token with\r\ngetAuthToken(Account,String,boolean,AccountManagerCallback,Handler) .\r\nvoid\r\nclearPassword(Account account)\r\nForgets a saved password.\r\nAccountManagerFuture\u003cBundle\u003e\r\nconfirmCredentials(Account account, Bundle options, Activity activity,\r\nAccountManagerCallback\u003cBundle\u003e callback, Handler handler)\r\nConfirms that the user knows the password for an account to make extra sure they are the owner of\r\naccount.\r\nAccountManagerFuture\u003cBundle\u003e\r\neditProperties(String accountType, Activity activity, AccountManagerCallback\u003cBundle\u003e ca\r\nHandler handler)\r\nOffers the user an opportunity to change an authenticator's settings.\r\nAccountManagerFuture\u003cBundle\u003e\r\nfinishSession(Bundle sessionBundle, Activity activity, AccountManagerCallback\u003cBundle\u003e c\r\nHandler handler)\r\nFinishes the session started by startAddAccountSession(String, String, String, Bundle, Activ\r\nAccountManagerCallback, Handler) or startUpdateCredentialsSession(Account, String, Bund\r\nActivity, AccountManagerCallback, Handler) .\r\nstatic AccountManager\r\nget(Context context)\r\nGets an AccountManager instance associated with a Context.\r\nint\r\ngetAccountVisibility(Account account, String packageName)\r\nGet visibility of certain account for given application.\r\nAccount[]\r\ngetAccounts()\r\nLists all accounts visible to the caller regardless of type.\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 5 of 36\n\nMap\u003cAccount,\r\nInteger\u003e\r\ngetAccountsAndVisibilityForPackage(String packageName, String accountType)\r\nGets all accounts of given type and their visibility for specific package.\r\nAccount[]\r\ngetAccountsByType(String type)\r\nLists all accounts of particular type visible to the caller.\r\nAccountManagerFuture\u003cAccount[]\u003e\r\ngetAccountsByTypeAndFeatures(String type, String[] features, AccountManagerCallback\u003cAcc\r\ncallback, Handler handler)\r\nLists all accounts of a type which have certain features.\r\nAccount[]\r\ngetAccountsByTypeForPackage(String type, String packageName)\r\nReturns the accounts visible to the specified package in an environment where some apps are not au\r\nto view all accounts.\r\nAccountManagerFuture\u003cBundle\u003e\r\ngetAuthToken(Account account, String authTokenType, Bundle options, boolean notifyAuthF\r\nAccountManagerCallback\u003cBundle\u003e callback, Handler handler)\r\nGets an auth token of the specified type for a particular account, optionally raising a notification if\r\nmust enter credentials.\r\nAccountManagerFuture\u003cBundle\u003e\r\ngetAuthToken(Account account, String authTokenType, Bundle options, Activity activity,\r\nAccountManagerCallback\u003cBundle\u003e callback, Handler handler)\r\nGets an auth token of the specified type for a particular account, prompting the user for credentials\r\nnecessary.\r\nAccountManagerFuture\u003cBundle\u003e\r\ngetAuthToken(Account account, String authTokenType, boolean notifyAuthFailure,\r\nAccountManagerCallback\u003cBundle\u003e callback, Handler handler)\r\nThis method was deprecated in API level 15. use\r\ngetAuthToken(Account,String,android.os.Bundle,boolean,AccountManagerCallback,android.os\r\ninstead\r\nAccountManagerFuture\u003cBundle\u003e\r\ngetAuthTokenByFeatures(String accountType, String authTokenType, String[] features, Act\r\nactivity, Bundle addAccountOptions, Bundle getAuthTokenOptions, AccountManagerCallback\u003cB\r\ncallback, Handler handler)\r\nThis convenience helper combines the functionality of getAccountsByTypeAndFeatures(String, S\r\nAccountManagerCallback, Handler) , getAuthToken(Account, String, Bundle, Activity,\r\nAccountManagerCallback, Handler) , and addAccount(String, String, String, Bundle, Activi\r\nAccountManagerCallback, Handler) .\r\nAuthenticatorDescription[]\r\ngetAuthenticatorTypes()\r\nLists the currently registered authenticators.\r\nMap\u003cString,Integer\u003e\r\ngetPackagesAndVisibilityForAccount(Account account)\r\nReturns package names and visibility which were explicitly set for given account.\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 6 of 36\n\nString\r\ngetPassword(Account account)\r\nGets the saved password associated with the account.\r\nString\r\ngetPreviousName(Account account)\r\nGets the previous name associated with the account or null , if none.\r\nString\r\ngetUserData(Account account, String key)\r\nGets the user data named by \"key\" associated with the account.\r\nAccountManagerFuture\u003cBoolean\u003e\r\nhasFeatures(Account account, String[] features, AccountManagerCallback\u003cBoolean\u003e callbac\r\nHandler handler)\r\nFinds out whether a particular account has all the specified features.\r\nvoid\r\ninvalidateAuthToken(String accountType, String authToken)\r\nRemoves an auth token from the AccountManager's cache.\r\nAccountManagerFuture\u003cBoolean\u003e\r\nisCredentialsUpdateSuggested(Account account, String statusToken,\r\nAccountManagerCallback\u003cBoolean\u003e callback, Handler handler)\r\nChecks whether updateCredentials(Account, String, Bundle, Activity, AccountManagerCallba\r\nHandler) or startUpdateCredentialsSession(Account, String, Bundle, Activity,\r\nAccountManagerCallback, Handler) should be called with respect to the specified account.\r\nstatic Intent\r\nnewChooseAccountIntent(Account selectedAccount, List\u003cAccount\u003e allowableAccounts, String\r\nallowableAccountTypes, String descriptionOverrideText, String addAccountAuthTokenType, S\r\naddAccountRequiredFeatures, Bundle addAccountOptions)\r\nReturns an intent to an Activity that prompts the user to choose from a list of accounts.\r\nstatic Intent\r\nnewChooseAccountIntent(Account selectedAccount, ArrayList\u003cAccount\u003e allowableAccounts, S\r\nallowableAccountTypes, boolean alwaysPromptForAccount, String descriptionOverrideText, S\r\naddAccountAuthTokenType, String[] addAccountRequiredFeatures, Bundle addAccountOptions)\r\nDeprecated in favor of\r\nnewChooseAccountIntent(Account,List,String[],String,String,String[],Bundle) .\r\nboolean\r\nnotifyAccountAuthenticated(Account account)\r\nNotifies the system that the account has just been authenticated.\r\nString\r\npeekAuthToken(Account account, String authTokenType)\r\nGets an auth token from the AccountManager's cache.\r\nAccountManagerFuture\u003cBundle\u003e\r\nremoveAccount(Account account, Activity activity, AccountManagerCallback\u003cBundle\u003e callba\r\nHandler handler)\r\nRemoves an account from the AccountManager.\r\nAccountManagerFuture\u003cBoolean\u003e removeAccount(Account account, AccountManagerCallback\u003cBoolean\u003e callback, Handler handle\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 7 of 36\n\nThis method was deprecated in API level 22. use\r\nremoveAccount(Account,Activity,AccountManagerCallback,Handler) instead\r\nboolean\r\nremoveAccountExplicitly(Account account)\r\nRemoves an account directly.\r\nvoid\r\nremoveOnAccountsUpdatedListener(OnAccountsUpdateListener listener)\r\nRemoves an OnAccountsUpdateListener previously registered with\r\naddOnAccountsUpdatedListener(OnAccountsUpdateListener, Handler, boolean) .\r\nAccountManagerFuture\u003cAccount\u003e\r\nrenameAccount(Account account, String newName, AccountManagerCallback\u003cAccount\u003e callback\r\nhandler)\r\nRename the specified Account .\r\nboolean\r\nsetAccountVisibility(Account account, String packageName, int visibility)\r\nSet visibility value of given account to certain package.\r\nvoid\r\nsetAuthToken(Account account, String authTokenType, String authToken)\r\nAdds an auth token to the AccountManager cache for an account.\r\nvoid\r\nsetPassword(Account account, String password)\r\nSets or forgets a saved password.\r\nvoid\r\nsetUserData(Account account, String key, String value)\r\nSets one userdata key for an account.\r\nAccountManagerFuture\u003cBundle\u003e\r\nstartAddAccountSession(String accountType, String authTokenType, String[] requiredFeatu\r\nBundle options, Activity activity, AccountManagerCallback\u003cBundle\u003e callback, Handler hand\r\nAsks the user to authenticate with an account of a specified type.\r\nAccountManagerFuture\u003cBundle\u003e\r\nstartUpdateCredentialsSession(Account account, String authTokenType, Bundle options, Ac\r\nactivity, AccountManagerCallback\u003cBundle\u003e callback, Handler handler)\r\nAsks the user to enter a new password for the account but not updating the saved credentials for the\r\nuntil finishSession(Bundle, Activity, AccountManagerCallback, Handler) is called.\r\nAccountManagerFuture\u003cBundle\u003e\r\nupdateCredentials(Account account, String authTokenType, Bundle options, Activity activ\r\nAccountManagerCallback\u003cBundle\u003e callback, Handler handler)\r\nAsks the user to enter a new password for an account, updating the saved credentials for the accoun\r\nInherited methods\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 8 of 36\n\nFrom class java.lang.Object\r\nObject\r\nclone()\r\nCreates and returns a copy of this object.\r\nboolean\r\nequals(Object obj)\r\nIndicates whether some other object is \"equal to\" this one.\r\nvoid\r\nfinalize()\r\nCalled by the garbage collector on an object when garbage collection determines that there are no\r\nmore references to the object.\r\nfinal\r\nClass\u003c?\u003e\r\ngetClass()\r\nReturns the runtime class of this Object .\r\nint\r\nhashCode()\r\nReturns a hash code value for the object.\r\nfinal void\r\nnotify()\r\nWakes up a single thread that is waiting on this object's monitor.\r\nfinal void\r\nnotifyAll()\r\nWakes up all threads that are waiting on this object's monitor.\r\nString\r\ntoString()\r\nReturns a string representation of the object.\r\nfinal void\r\nwait(long timeoutMillis, int nanos)\r\nCauses the current thread to wait until it is awakened, typically by being notified or interrupted,\r\nor until a certain amount of real time has elapsed.\r\nfinal void\r\nwait(long timeoutMillis)\r\nCauses the current thread to wait until it is awakened, typically by being notified or interrupted,\r\nor until a certain amount of real time has elapsed.\r\nfinal void\r\nwait()\r\nCauses the current thread to wait until it is awakened, typically by being notified or interrupted.\r\nConstants\r\nACTION_ACCOUNT_REMOVED\r\npublic static final String ACTION_ACCOUNT_REMOVED\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 9 of 36\n\nAction sent as a broadcast Intent by the AccountsService when any account is removed or renamed. Only applications which\r\nwere able to see the account will receive the intent. Intent extra will include the following fields:\r\nKEY_ACCOUNT_NAME - the name of the removed account\r\nKEY_ACCOUNT_TYPE - the type of the account\r\nConstant Value: \"android.accounts.action.ACCOUNT_REMOVED\"\r\nACTION_AUTHENTICATOR_INTENT\r\npublic static final String ACTION_AUTHENTICATOR_INTENT\r\nConstant Value: \"android.accounts.AccountAuthenticator\"\r\nAUTHENTICATOR_ATTRIBUTES_NAME\r\npublic static final String AUTHENTICATOR_ATTRIBUTES_NAME\r\nConstant Value: \"account-authenticator\"\r\nAUTHENTICATOR_META_DATA_NAME\r\npublic static final String AUTHENTICATOR_META_DATA_NAME\r\nConstant Value: \"android.accounts.AccountAuthenticator\"\r\nERROR_CODE_BAD_ARGUMENTS\r\npublic static final int ERROR_CODE_BAD_ARGUMENTS\r\nConstant Value: 7 (0x00000007)\r\nERROR_CODE_BAD_AUTHENTICATION\r\npublic static final int ERROR_CODE_BAD_AUTHENTICATION\r\nConstant Value: 9 (0x00000009)\r\nERROR_CODE_BAD_REQUEST\r\npublic static final int ERROR_CODE_BAD_REQUEST\r\nConstant Value: 8 (0x00000008)\r\nERROR_CODE_CANCELED\r\npublic static final int ERROR_CODE_CANCELED\r\nConstant Value: 4 (0x00000004)\r\nERROR_CODE_INVALID_RESPONSE\r\npublic static final int ERROR_CODE_INVALID_RESPONSE\r\nConstant Value: 5 (0x00000005)\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 10 of 36\n\nERROR_CODE_NETWORK_ERROR\r\npublic static final int ERROR_CODE_NETWORK_ERROR\r\nConstant Value: 3 (0x00000003)\r\nERROR_CODE_REMOTE_EXCEPTION\r\npublic static final int ERROR_CODE_REMOTE_EXCEPTION\r\nConstant Value: 1 (0x00000001)\r\nERROR_CODE_UNSUPPORTED_OPERATION\r\npublic static final int ERROR_CODE_UNSUPPORTED_OPERATION\r\nConstant Value: 6 (0x00000006)\r\nKEY_ACCOUNTS\r\npublic static final String KEY_ACCOUNTS\r\nConstant Value: \"accounts\"\r\nKEY_ACCOUNT_AUTHENTICATOR_RESPONSE\r\npublic static final String KEY_ACCOUNT_AUTHENTICATOR_RESPONSE\r\nConstant Value: \"accountAuthenticatorResponse\"\r\nKEY_ACCOUNT_MANAGER_RESPONSE\r\npublic static final String KEY_ACCOUNT_MANAGER_RESPONSE\r\nConstant Value: \"accountManagerResponse\"\r\nKEY_ACCOUNT_NAME\r\npublic static final String KEY_ACCOUNT_NAME\r\nBundle key used for the String account name in results from methods which return information about a particular\r\naccount.\r\nConstant Value: \"authAccount\"\r\nKEY_ACCOUNT_TYPE\r\npublic static final String KEY_ACCOUNT_TYPE\r\nBundle key used for the String account type in results from methods which return information about a particular account.\r\nConstant Value: \"accountType\"\r\nKEY_ANDROID_PACKAGE_NAME\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 11 of 36\n\npublic static final String KEY_ANDROID_PACKAGE_NAME\r\nThe Android package of the caller will be set in the options bundle by the AccountManager and will be passed to the\r\nAccountManagerService and to the AccountAuthenticators. The uid of the caller will be known by the\r\nAccountManagerService as well as the AccountAuthenticators so they will be able to verify that the package is consistent\r\nwith the uid (a uid might be shared by many packages).\r\nConstant Value: \"androidPackageName\"\r\nKEY_AUTHENTICATOR_TYPES\r\npublic static final String KEY_AUTHENTICATOR_TYPES\r\nConstant Value: \"authenticator_types\"\r\nKEY_AUTH_FAILED_MESSAGE\r\npublic static final String KEY_AUTH_FAILED_MESSAGE\r\nConstant Value: \"authFailedMessage\"\r\nKEY_AUTH_TOKEN_LABEL\r\npublic static final String KEY_AUTH_TOKEN_LABEL\r\nConstant Value: \"authTokenLabelKey\"\r\nKEY_BOOLEAN_RESULT\r\npublic static final String KEY_BOOLEAN_RESULT\r\nConstant Value: \"booleanResult\"\r\nKEY_CALLER_PID\r\npublic static final String KEY_CALLER_PID\r\nThe process id of caller app.\r\nConstant Value: \"callerPid\"\r\nKEY_CALLER_UID\r\npublic static final String KEY_CALLER_UID\r\nThe UID of caller app.\r\nConstant Value: \"callerUid\"\r\nKEY_ERROR_CODE\r\npublic static final String KEY_ERROR_CODE\r\nConstant Value: \"errorCode\"\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 12 of 36\n\nKEY_ERROR_MESSAGE\r\npublic static final String KEY_ERROR_MESSAGE\r\nConstant Value: \"errorMessage\"\r\nKEY_INTENT\r\npublic static final String KEY_INTENT\r\nBundle key used for an Intent in results from methods that may require the caller to interact with the user. The Intent can\r\nbe used to start the corresponding user interface activity.\r\nConstant Value: \"intent\"\r\nKEY_LAST_AUTHENTICATED_TIME\r\npublic static final String KEY_LAST_AUTHENTICATED_TIME\r\nBundle key used to supply the last time the credentials of the account were authenticated successfully. Time is specified in\r\nmilliseconds since epoch. Associated time is updated on successful authentication of account on adding account, confirming\r\ncredentials, or updating credentials.\r\nConstant Value: \"lastAuthenticatedTime\"\r\nKEY_USERDATA\r\npublic static final String KEY_USERDATA\r\nConstant Value: \"userdata\"\r\nVISIBILITY_NOT_VISIBLE\r\npublic static final int VISIBILITY_NOT_VISIBLE\r\nAccount is not visible to given application and only authenticator can grant visibility.\r\nConstant Value: 3 (0x00000003)\r\nVISIBILITY_USER_MANAGED_VISIBLE\r\npublic static final int VISIBILITY_USER_MANAGED_VISIBLE\r\nAccount is visible to given application, but user can revoke visibility.\r\nConstant Value: 2 (0x00000002)\r\nVISIBILITY_VISIBLE\r\npublic static final int VISIBILITY_VISIBLE\r\nAccount is always visible to given application and only authenticator can revoke visibility.\r\nConstant Value: 1 (0x00000001)\r\nPublic methods\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 13 of 36\n\naddAccount\r\npublic AccountManagerFuture\u003cBundle\u003e addAccount (String accountType,\r\n String authTokenType,\r\n String[] requiredFeatures,\r\n Bundle addAccountOptions,\r\n Activity activity,\r\n AccountManagerCallback\u003cBundle\u003e callback,\r\n Handler handler)\r\nAsks the user to add an account of a specified type. The authenticator for this account type processes this request with the\r\nappropriate user interface. If the user does elect to create a new account, the account name is returned.\r\nThis method may be called from any thread, but the returned AccountManagerFuture must not be used on the main thread.\r\nNOTE: If targeting your app to work on API level 22 and before, MANAGE_ACCOUNTS permission is needed for those\r\nplatforms. See docs for this function in API level 22.\r\nRequires android.Manifest.permission.MANAGE_ACCOUNTS\r\nParameters\r\naccountType String : The type of account to add; must not be null\r\nauthTokenType\r\nString : The type of auth token (see getAuthToken(Account, String, Bundle, Activity,\r\nAccountManagerCallback, Handler) ) this account will need to be able to generate, null for\r\nnone\r\nrequiredFeatures\r\nString : The features (see hasFeatures(Account, String, AccountManagerCallback,\r\nHandler) ) this account must have, null for none\r\naddAccountOptions Bundle : Authenticator-specific options for the request, may be null or empty\r\nactivity\r\nActivity : The Activity context to use for launching a new authenticator-defined sub-Activity to prompt the user to create an account; used only to call startActivity(); if null, the\r\nprompt will not be launched directly, but the necessary Intent will be returned to the caller\r\ninstead\r\ncallback\r\nAccountManagerCallback : Callback to invoke when the request completes, null for no\r\ncallback\r\nhandler Handler : Handler identifying the callback thread, null for the main thread\r\naddAccountExplicitly\r\npublic boolean addAccountExplicitly (Account account,\r\n String password,\r\n Bundle userdata)\r\nAdds an account directly to the AccountManager. Normally used by sign-up wizards associated with authenticators, not\r\ndirectly by applications.\r\nCalling this method does not update the last authenticated timestamp, referred by KEY_LAST_AUTHENTICATED_TIME . To\r\nupdate it, call notifyAccountAuthenticated(Account) after getting success. However, if this method is called when it is\r\ntriggered by addAccount() or addAccountAsUser() or similar functions, then there is no need to update timestamp manually\r\nas it is updated automatically by framework on successful completion of the mentioned functions.\r\nIt is safe to call this method from the main thread.\r\nThis method requires the caller to have a signature match with the authenticator that owns the specified account.\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 14 of 36\n\nNOTE: If targeting your app to work on API level 22 and before, AUTHENTICATE_ACCOUNTS permission is needed for\r\nthose platforms. See docs for this function in API level 22.\r\nRequires android.Manifest.permission.AUTHENTICATE_ACCOUNTS\r\nParameters\r\naccount Account : The Account to add\r\npassword String : The password to associate with the account, null for none\r\nuserdata Bundle : String values to use for the account's userdata, null for none\r\nReturns\r\nboolean\r\nTrue if the account was successfully added, false if the account already exists, the account is null, the user\r\nis locked, or another error occurs.\r\naddAccountExplicitly\r\npublic boolean addAccountExplicitly (Account account,\r\n String password,\r\n Bundle extras,\r\n Map\u003cString,Integer\u003e visibility)\r\nAdds an account directly to the AccountManager. Additionally it specifies Account visibility for given list of packages.\r\nNormally used by sign-up wizards associated with authenticators, not directly by applications.\r\nCalling this method does not update the last authenticated timestamp, referred by KEY_LAST_AUTHENTICATED_TIME . To\r\nupdate it, call notifyAccountAuthenticated(Account) after getting success.\r\nIt is safe to call this method from the main thread.\r\nThis method requires the caller to have a signature match with the authenticator that owns the specified account.\r\nParameters\r\naccount Account : The Account to add\r\npassword String : The password to associate with the account, null for none\r\nextras Bundle : String values to use for the account's userdata, null for none\r\nvisibility\r\nMap : Map from packageName to visibility values which will be set before account is added. See\r\ngetAccountVisibility(Account, String) for possible values. Declaring package visibility needs for\r\npackage names in the map is needed, if the caller is targeting API level 34 and above.\r\nReturns\r\nboolean\r\nTrue if the account was successfully added, false if the account already exists, the account is null, or\r\nanother error occurs.\r\naddOnAccountsUpdatedListener\r\npublic void addOnAccountsUpdatedListener (OnAccountsUpdateListener listener,\r\n Handler handler,\r\n boolean updateImmediately,\r\n String[] accountTypes)\r\nAdds an OnAccountsUpdateListener to this instance of the AccountManager . This listener will be notified whenever user\r\nor AbstractAccountAuthenticator made changes to accounts of given types related to the caller - either list of accounts\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 15 of 36\n\nreturned by getAccounts() was changed, or new account was added for which user can grant access to the caller.\r\nAs long as this listener is present, the AccountManager instance will not be garbage-collected, and neither will the Context\r\nused to retrieve it, which may be a large Activity instance. To avoid memory leaks, you must remove this listener before\r\nthen. Normally listeners are added in an Activity or Service's Activity.onCreate and removed in Activity.onDestroy .\r\nIt is safe to call this method from the main thread.\r\nParameters\r\nlistener OnAccountsUpdateListener : The listener to send notifications to\r\nhandler Handler : Handler identifying the thread to use for notifications, null for the main thread\r\nupdateImmediately\r\nboolean : If true, the listener will be invoked (on the handler thread) right away with the\r\ncurrent account list\r\naccountTypes String : If set, only changes to accounts of given types will be reported.\r\naddOnAccountsUpdatedListener\r\npublic void addOnAccountsUpdatedListener (OnAccountsUpdateListener listener,\r\n Handler handler,\r\n boolean updateImmediately)\r\nAdds an OnAccountsUpdateListener to this instance of the AccountManager . This listener will be notified whenever user\r\nor AbstractAccountAuthenticator made changes to accounts of any type related to the caller. This method is equivalent to\r\naddOnAccountsUpdatedListener(listener, handler, updateImmediately, null).\r\nRequires Manifest.permission.GET_ACCOUNTS\r\nParameters\r\nlistener OnAccountsUpdateListener\r\nhandler Handler\r\nupdateImmediately boolean\r\nblockingGetAuthToken\r\npublic String blockingGetAuthToken (Account account,\r\n String authTokenType,\r\n boolean notifyAuthFailure)\r\nThis convenience helper synchronously gets an auth token with\r\ngetAuthToken(Account,String,boolean,AccountManagerCallback,Handler) .\r\nThis method may block while a network request completes, and must never be made from the main thread.\r\nNOTE: If targeting your app to work on API level 22 and before, USE_CREDENTIALS permission is needed for those\r\nplatforms. See docs for this function in API level 22.\r\nRequires android.Manifest.permission.USE_CREDENTIALS\r\nParameters\r\naccount Account : The account to fetch an auth token for\r\nauthTokenType String : The auth token type, see getAuthToken()\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 16 of 36\n\nnotifyAuthFailure\r\nboolean : If true, display a notification and return null if authentication fails; if false, prompt\r\nand wait for the user to re-enter correct credentials before returning\r\nReturns\r\nString An auth token of the specified type for this account, or null if authentication fails or none can be fetched.\r\nThrows\r\nAuthenticatorException if the authenticator failed to respond\r\nOperationCanceledException\r\nif the request was canceled for any reason, including the user canceling a credential\r\nrequest\r\nIOException\r\nif the authenticator experienced an I/O problem creating a new auth token, usually\r\nbecause of network trouble\r\nclearPassword\r\npublic void clearPassword (Account account)\r\nForgets a saved password. This erases the local copy of the password; it does not change the user's account password on the\r\nserver. Has the same effect as setPassword(account, null) but requires fewer permissions, and may be used by applications or\r\nmanagement interfaces to \"sign out\" from an account.\r\nThis method only successfully clear the account's password when the caller has the same signature as the authenticator that\r\nowns the specified account. Otherwise, this method will silently fail.\r\nIt is safe to call this method from the main thread.\r\nNOTE: If targeting your app to work on API level 22 and before, MANAGE_ACCOUNTS permission is needed for those\r\nplatforms. See docs for this function in API level 22.\r\nRequires android.Manifest.permission.MANAGE_ACCOUNTS\r\nParameters\r\naccount Account : The account whose password to clear\r\nconfirmCredentials\r\npublic AccountManagerFuture\u003cBundle\u003e confirmCredentials (Account account,\r\n Bundle options,\r\n Activity activity,\r\n AccountManagerCallback\u003cBundle\u003e callback,\r\n Handler handler)\r\nConfirms that the user knows the password for an account to make extra sure they are the owner of the account. The user-entered password can be supplied directly, otherwise the authenticator for this account type prompts the user with the\r\nappropriate interface. This method is intended for applications which want extra assurance; for example, the phone lock\r\nscreen uses this to let the user unlock the phone with an account password if they forget the lock pattern.\r\nIf the user-entered password matches a saved password for this account, the request is considered valid; otherwise the\r\nauthenticator verifies the password (usually by contacting the server).\r\nThis method may be called from any thread, but the returned AccountManagerFuture must not be used on the main thread.\r\nNOTE: If targeting your app to work on API level 22 and before, MANAGE_ACCOUNTS permission is needed for those\r\nplatforms. See docs for this function in API level 22.\r\nRequires android.Manifest.permission.MANAGE_ACCOUNTS\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 17 of 36\n\nParameters\r\naccount Account : The account to confirm password knowledge for\r\noptions\r\nBundle : Authenticator-specific options for the request; if the KEY_PASSWORD string field is present, the\r\nauthenticator may use it directly rather than prompting the user; may be null or empty\r\nactivity\r\nActivity : The Activity context to use for launching a new authenticator-defined sub-Activity to\r\nprompt the user to enter a password; used only to call startActivity(); if null, the prompt will not be\r\nlaunched directly, but the necessary Intent will be returned to the caller instead\r\ncallback AccountManagerCallback : Callback to invoke when the request completes, null for no callback\r\nhandler Handler : Handler identifying the callback thread, null for the main thread\r\neditProperties\r\npublic AccountManagerFuture\u003cBundle\u003e editProperties (String accountType,\r\n Activity activity,\r\n AccountManagerCallback\u003cBundle\u003e callback,\r\n Handler handler)\r\nOffers the user an opportunity to change an authenticator's settings. These properties are for the authenticator in general, not\r\na particular account. Not all authenticators support this method.\r\nThis method may be called from any thread, but the returned AccountManagerFuture must not be used on the main thread.\r\nThis method requires the caller to have the same signature as the authenticator associated with the specified account type.\r\nNOTE: If targeting your app to work on API level 22 and before, MANAGE_ACCOUNTS permission is needed for those\r\nplatforms. See docs for this function in API level 22.\r\nRequires android.Manifest.permission.MANAGE_ACCOUNTS\r\nParameters\r\naccountType String : The account type associated with the authenticator to adjust\r\nactivity\r\nActivity : The Activity context to use for launching a new authenticator-defined sub-Activity to\r\nadjust authenticator settings; used only to call startActivity(); if null, the settings dialog will not be\r\nlaunched directly, but the necessary Intent will be returned to the caller instead\r\ncallback AccountManagerCallback : Callback to invoke when the request completes, null for no callback\r\nhandler Handler : Handler identifying the callback thread, null for the main thread\r\nfinishSession\r\npublic AccountManagerFuture\u003cBundle\u003e finishSession (Bundle sessionBundle,\r\n Activity activity,\r\n AccountManagerCallback\u003cBundle\u003e callback,\r\n Handler handler)\r\nFinishes the session started by startAddAccountSession(String, String, String, Bundle, Activity,\r\nAccountManagerCallback, Handler) or startUpdateCredentialsSession(Account, String, Bundle, Activity,\r\nAccountManagerCallback, Handler) . This will either add the account to AccountManager or update the local credentials\r\nstored.\r\nThis method may be called from any thread, but the returned AccountManagerFuture must not be used on the main thread.\r\nParameters\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 18 of 36\n\nsessionBundle\r\nBundle : a Bundle created by startAddAccountSession(String, String, String, Bundle,\r\nActivity, AccountManagerCallback, Handler) or startUpdateCredentialsSession(Account,\r\nString, Bundle, Activity, AccountManagerCallback, Handler)\r\nactivity\r\nActivity : The Activity context to use for launching a new authenticator-defined sub-Activity\r\nto prompt the user to create an account or reauthenticate existing account; used only to call\r\nstartActivity(); if null, the prompt will not be launched directly, but the necessary Intent will be\r\nreturned to the caller instead\r\ncallback AccountManagerCallback : Callback to invoke when the request completes, null for no callback\r\nhandler Handler : Handler identifying the callback thread, null for the main thread\r\nReturns\r\nAccountManagerFuture\u003cBundle\u003e\r\nAn AccountManagerFuture which resolves to a Bundle with these fields if an\r\nactivity was supplied and an account was added to device or local credentials were\r\nupdated::\r\nKEY_ACCOUNT_NAME - the name of the account created\r\nKEY_ACCOUNT_TYPE - the type of the account\r\nKEY_ACCOUNT_STATUS_TOKEN - optional, token to check status of the account\r\nIf no activity was specified and additional information is needed from user, the\r\nreturned Bundle may only contain KEY_INTENT with the Intent needed to\r\nlaunch the actual account creation process. If an error occurred,\r\nAccountManagerFuture.getResult() throws:\r\nAuthenticatorException if no authenticator was registered for this\r\naccount type or the authenticator failed to respond\r\nOperationCanceledException if the operation was canceled for any\r\nreason, including the user canceling the creation process or adding accounts\r\n(of this type) has been disabled by policy\r\nIOException if the authenticator experienced an I/O problem creating a\r\nnew account, usually because of network trouble\r\ngetAccounts\r\npublic Account[] getAccounts ()\r\nLists all accounts visible to the caller regardless of type. Equivalent to getAccountsByType(null). These accounts may be\r\nvisible because the user granted access to the account, or the AbstractAccountAuthenticator managing the account did so or\r\nbecause the client shares a signature with the managing AbstractAccountAuthenticator.\r\nCaution: This method returns personal and sensitive user data. If your app accesses, collects, uses, or shares personal and\r\nsensitive data, you must clearly disclose that fact to users. For apps published on Google Play, policies protecting user data\r\nrequire that you do the following:\r\nDisclose to the user how your app accesses, collects, uses, or shares personal and sensitive data. Learn more about\r\nacceptable disclosure and consent.\r\nProvide a privacy policy that describes your use of this data on- and off-device.\r\nTo learn more, visit the Google Play Policy regarding user data.\r\nIt is safe to call this method from the main thread.\r\nRequires Manifest.permission.GET_ACCOUNTS\r\nReturns\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 19 of 36\n\nAccount[] An array of Account , one for each account. Empty (never null) if no accounts have been added.\r\ngetAccountsAndVisibilityForPackage\r\npublic Map\u003cAccount,Integer\u003e getAccountsAndVisibilityForPackage (String packageName,\r\n String accountType)\r\nGets all accounts of given type and their visibility for specific package. This method requires the caller to have a signature\r\nmatch with the authenticator that manages accountType. It is a helper method which combines calls to\r\ngetAccountsByType(String) by authenticator and getAccountVisibility(Account, String) for every returned account.\r\nParameters\r\npackageName String : Package name\r\naccountType String : Account type\r\ngetAccountsByType\r\npublic Account[] getAccountsByType (String type)\r\nLists all accounts of particular type visible to the caller. These accounts may be visible because the user granted access to the\r\naccount, or the AbstractAccountAuthenticator managing the account did so or because the client shares a signature with the\r\nmanaging AbstractAccountAuthenticator.\r\nThe account type is a string token corresponding to the authenticator and useful domain of the account. For example, there\r\nare types corresponding to Google and Facebook. The exact string token to use will be published somewhere associated with\r\nthe authenticator in question.\r\nCaution: This method returns personal and sensitive user data. If your app accesses, collects, uses, or shares personal and\r\nsensitive data, you must clearly disclose that fact to users. For apps published on Google Play, policies protecting user data\r\nrequire that you do the following:\r\nDisclose to the user how your app accesses, collects, uses, or shares personal and sensitive data. Learn more about\r\nacceptable disclosure and consent.\r\nProvide a privacy policy that describes your use of this data on- and off-device.\r\nTo learn more, visit the Google Play Policy regarding user data.\r\nIt is safe to call this method from the main thread.\r\nCaller targeting API level Build.VERSION_CODES.O and above, will get list of accounts made visible to it by user (see\r\nnewChooseAccountIntent(Account,List,String[],String,String,String[],Bundle) ) or AbstractAccountAuthenticator\r\nusing setAccountVisibility(Account, String, int) . Manifest.permission.GET_ACCOUNTS permission is not used.\r\nCaller targeting API level below Build.VERSION_CODES.O that have not been granted the\r\nManifest.permission.GET_ACCOUNTS permission, will only see those accounts managed by AbstractAccountAuthenticators\r\nwhose signature matches the client.\r\nNOTE: If targeting your app to work on API level Build.VERSION_CODES.LOLLIPOP_MR1 and before,\r\nManifest.permission.GET_ACCOUNTS permission is needed for those platforms, irrespective of uid or signature match. See\r\ndocs for this function in API level Build.VERSION_CODES.LOLLIPOP_MR1 .\r\nRequires Manifest.permission.GET_ACCOUNTS\r\nParameters\r\ntype String : The type of accounts to return, null to retrieve all accounts\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 20 of 36\n\nReturns\r\nAccount[]\r\nAn array of Account , one per matching account. Empty (never null) if no accounts of the specified type\r\nhave been added.\r\ngetAccountsByTypeAndFeatures\r\npublic AccountManagerFuture\u003cAccount[]\u003e getAccountsByTypeAndFeatures (String type,\r\n String[] features,\r\n AccountManagerCallback\u003cAccount[]\u003e callback,\r\n Handler handler)\r\nLists all accounts of a type which have certain features. The account type identifies the authenticator (see\r\ngetAccountsByType(String) ). Account features are authenticator-specific string tokens identifying boolean account\r\nproperties (see hasFeatures(Account, String, AccountManagerCallback, Handler) ).\r\nUnlike getAccountsByType(String) , this method calls the authenticator, which may contact the server or do other work to\r\ncheck account features, so the method returns an AccountManagerFuture .\r\nThis method may be called from any thread, but the returned AccountManagerFuture must not be used on the main thread.\r\nCaller targeting API level Build.VERSION_CODES.O and above, will get list of accounts made visible to it by user (see\r\nnewChooseAccountIntent(Account,List,String[],String,String,String[],Bundle) ) or AbstractAccountAuthenticator\r\nusing setAccountVisibility(Account, String, int) . Manifest.permission.GET_ACCOUNTS permission is not used.\r\nCaller targeting API level below Build.VERSION_CODES.O that have not been granted the\r\nManifest.permission.GET_ACCOUNTS permission, will only see those accounts managed by AbstractAccountAuthenticators\r\nwhose signature matches the client.\r\nNOTE: If targeting your app to work on API level Build.VERSION_CODES.LOLLIPOP_MR1 and before,\r\nManifest.permission.GET_ACCOUNTS permission is needed for those platforms, irrespective of uid or signature match. See\r\ndocs for this function in API level Build.VERSION_CODES.LOLLIPOP_MR1 .\r\nParameters\r\ntype String : The type of accounts to return, must not be null\r\nfeatures String : An array of the account features to require, may be null or empty *\r\ncallback AccountManagerCallback : Callback to invoke when the request completes, null for no callback\r\nhandler Handler : Handler identifying the callback thread, null for the main thread\r\ngetAccountsByTypeForPackage\r\npublic Account[] getAccountsByTypeForPackage (String type,\r\n String packageName)\r\nReturns the accounts visible to the specified package in an environment where some apps are not authorized to view all\r\naccounts. This method can only be called by system apps and authenticators managing the type. Beginning API level\r\nBuild.VERSION_CODES.O it also return accounts which user can make visible to the application (see\r\nVISIBILITY_USER_MANAGED_VISIBLE ).\r\nParameters\r\ntype String : The type of accounts to return, null to retrieve all accounts\r\npackageName String : The package name of the app for which the accounts are to be returned\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 21 of 36\n\nReturns\r\nAccount[]\r\nAn array of Account , one per matching account. Empty (never null) if no accounts of the specified type\r\ncan be accessed by the package.\r\ngetAuthToken\r\npublic AccountManagerFuture\u003cBundle\u003e getAuthToken (Account account,\r\n String authTokenType,\r\n Bundle options,\r\n boolean notifyAuthFailure,\r\n AccountManagerCallback\u003cBundle\u003e callback,\r\n Handler handler)\r\nGets an auth token of the specified type for a particular account, optionally raising a notification if the user must enter\r\ncredentials. This method is intended for background tasks and services where the user should not be immediately interrupted\r\nwith a password prompt.\r\nIf a previously generated auth token is cached for this account and type, then it is returned. Otherwise, if a saved password is\r\navailable, it is sent to the server to generate a new auth token. Otherwise, an Intent is returned which, when started, will\r\nprompt the user for a password. If the notifyAuthFailure parameter is set, a status bar notification is also created with the\r\nsame Intent, alerting the user that they need to enter a password at some point.\r\nIn that case, you may need to wait until the user responds, which could take hours or days or forever. When the user does\r\nrespond and supply a new password, the account manager will broadcast the LOGIN_ACCOUNTS_CHANGED_ACTION Intent and\r\nnotify OnAccountsUpdateListener which applications can use to try again.\r\nIf notifyAuthFailure is not set, it is the application's responsibility to launch the returned Intent at some point. Either way,\r\nthe result from this call will not wait for user action.\r\nSome authenticators have auth token types, whose value is authenticator-dependent. Some services use different token types\r\nto access different functionality -- for example, Google uses different auth tokens to access Gmail and Google Calendar for\r\nthe same account.\r\nThis method may be called from any thread, but the returned AccountManagerFuture must not be used on the main thread.\r\nNOTE: If targeting your app to work on API level 22 and before, USE_CREDENTIALS permission is needed for those\r\nplatforms. See docs for this function in API level 22.\r\nRequires android.Manifest.permission.USE_CREDENTIALS\r\nParameters\r\naccount Account : The account to fetch an auth token for\r\nauthTokenType String : The auth token type, an authenticator-dependent string token, must not be null\r\noptions Bundle : Authenticator-specific options for the request, may be null or empty\r\nnotifyAuthFailure\r\nboolean : True to add a notification to prompt the user for a password if necessary, false to\r\nleave that to the caller\r\ncallback\r\nAccountManagerCallback : Callback to invoke when the request completes, null for no\r\ncallback\r\nhandler Handler : Handler identifying the callback thread, null for the main thread\r\nReturns\r\nAccountManagerFuture\u003cBundle\u003e An AccountManagerFuture which resolves to a Bundle with at least the following\r\nfields on success:\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 22 of 36\n\nKEY_ACCOUNT_NAME - the name of the account you supplied\r\nKEY_ACCOUNT_TYPE - the type of the account\r\nKEY_AUTHTOKEN - the auth token you wanted\r\n(Other authenticator-specific values may be returned.) If the user must enter\r\ncredentials, the returned Bundle contains only KEY_INTENT with the Intent\r\nneeded to launch a prompt. If an error occurred,\r\nAccountManagerFuture.getResult() throws:\r\nAuthenticatorException if the authenticator failed to respond\r\nOperationCanceledException if the operation is canceled for any reason,\r\nincluidng the user canceling a credential request\r\nIOException if the authenticator experienced an I/O problem creating a\r\nnew auth token, usually because of network trouble\r\nIf the account is no longer present on the device, the return value is authenticator-dependent. The caller should verify the validity of the account before requesting an\r\nauth token.\r\ngetAuthToken\r\npublic AccountManagerFuture\u003cBundle\u003e getAuthToken (Account account,\r\n String authTokenType,\r\n Bundle options,\r\n Activity activity,\r\n AccountManagerCallback\u003cBundle\u003e callback,\r\n Handler handler)\r\nGets an auth token of the specified type for a particular account, prompting the user for credentials if necessary. This method\r\nis intended for applications running in the foreground where it makes sense to ask the user directly for a password.\r\nIf a previously generated auth token is cached for this account and type, then it is returned. Otherwise, if a saved password is\r\navailable, it is sent to the server to generate a new auth token. Otherwise, the user is prompted to enter a password.\r\nSome authenticators have auth token types, whose value is authenticator-dependent. Some services use different token types\r\nto access different functionality -- for example, Google uses different auth tokens to access Gmail and Google Calendar for\r\nthe same account.\r\nNOTE: If targeting your app to work on API level 22 and before, USE_CREDENTIALS permission is needed for those\r\nplatforms. See docs for this function in API level 22.\r\nThis method may be called from any thread, but the returned AccountManagerFuture must not be used on the main thread.\r\nRequires android.Manifest.permission.USE_CREDENTIALS\r\nParameters\r\naccount Account : The account to fetch an auth token for\r\nauthTokenType String : The auth token type, an authenticator-dependent string token, must not be null\r\noptions Bundle : Authenticator-specific options for the request, may be null or empty\r\nactivity\r\nActivity : The Activity context to use for launching a new authenticator-defined sub-Activity\r\nto prompt the user for a password if necessary; used only to call startActivity(); must not be null.\r\ncallback AccountManagerCallback : Callback to invoke when the request completes, null for no callback\r\nhandler Handler : Handler identifying the callback thread, null for the main thread\r\ngetAuthToken\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 23 of 36\n\npublic AccountManagerFuture\u003cBundle\u003e getAuthToken (Account account,\r\n String authTokenType,\r\n boolean notifyAuthFailure,\r\n AccountManagerCallback\u003cBundle\u003e callback,\r\n Handler handler)\r\nThis method was deprecated in API level 15.\r\nuse getAuthToken(Account,String,android.os.Bundle,boolean,AccountManagerCallback,android.os.Handler) instead\r\nGets an auth token of the specified type for a particular account, optionally raising a notification if the user must enter\r\ncredentials. This method is intended for background tasks and services where the user should not be immediately interrupted\r\nwith a password prompt.\r\nIf a previously generated auth token is cached for this account and type, then it is returned. Otherwise, if a saved password is\r\navailable, it is sent to the server to generate a new auth token. Otherwise, an Intent is returned which, when started, will\r\nprompt the user for a password. If the notifyAuthFailure parameter is set, a status bar notification is also created with the\r\nsame Intent, alerting the user that they need to enter a password at some point.\r\nIn that case, you may need to wait until the user responds, which could take hours or days or forever. When the user does\r\nrespond and supply a new password, the account manager will broadcast the LOGIN_ACCOUNTS_CHANGED_ACTION Intent and\r\nnotify OnAccountsUpdateListener which applications can use to try again.\r\nIf notifyAuthFailure is not set, it is the application's responsibility to launch the returned Intent at some point. Either way,\r\nthe result from this call will not wait for user action.\r\nSome authenticators have auth token types, whose value is authenticator-dependent. Some services use different token types\r\nto access different functionality -- for example, Google uses different auth tokens to access Gmail and Google Calendar for\r\nthe same account.\r\nThis method may be called from any thread, but the returned AccountManagerFuture must not be used on the main thread.\r\nRequires android.Manifest.permission.USE_CREDENTIALS\r\nParameters\r\naccount Account : The account to fetch an auth token for\r\nauthTokenType String : The auth token type, an authenticator-dependent string token, must not be null\r\nnotifyAuthFailure\r\nboolean : True to add a notification to prompt the user for a password if necessary, false to\r\nleave that to the caller\r\ncallback\r\nAccountManagerCallback : Callback to invoke when the request completes, null for no\r\ncallback\r\nhandler Handler : Handler identifying the callback thread, null for the main thread\r\nReturns\r\nAccountManagerFuture\u003cBundle\u003e An AccountManagerFuture which resolves to a Bundle with at least the following\r\nfields on success:\r\nKEY_ACCOUNT_NAME - the name of the account you supplied\r\nKEY_ACCOUNT_TYPE - the type of the account\r\nKEY_AUTHTOKEN - the auth token you wanted\r\n(Other authenticator-specific values may be returned.) If the user must enter\r\ncredentials, the returned Bundle contains only KEY_INTENT with the Intent\r\nneeded to launch a prompt. If an error occurred,\r\nAccountManagerFuture.getResult() throws:\r\nAuthenticatorException if the authenticator failed to respond\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 24 of 36\n\nOperationCanceledException if the operation is canceled for any reason,\r\nincluidng the user canceling a credential request\r\nIOException if the authenticator experienced an I/O problem creating a\r\nnew auth token, usually because of network trouble\r\nIf the account is no longer present on the device, the return value is authenticator-dependent. The caller should verify the validity of the account before requesting an\r\nauth token.\r\ngetAuthTokenByFeatures\r\npublic AccountManagerFuture\u003cBundle\u003e getAuthTokenByFeatures (String accountType,\r\n String authTokenType,\r\n String[] features,\r\n Activity activity,\r\n Bundle addAccountOptions,\r\n Bundle getAuthTokenOptions,\r\n AccountManagerCallback\u003cBundle\u003e callback,\r\n Handler handler)\r\nThis convenience helper combines the functionality of getAccountsByTypeAndFeatures(String, String,\r\nAccountManagerCallback, Handler) , getAuthToken(Account, String, Bundle, Activity, AccountManagerCallback,\r\nHandler) , and addAccount(String, String, String, Bundle, Activity, AccountManagerCallback, Handler) .\r\nThis method gets a list of the accounts matching specific type and feature set which are visible to the caller (see\r\ngetAccountsByType(String) for details); if there is exactly one already visible account, it is used; if there are some\r\naccounts for which user grant visibility, the user is prompted to pick one; if there are none, the user is prompted to add one.\r\nFinally, an auth token is acquired for the chosen account.\r\nThis method may be called from any thread, but the returned AccountManagerFuture must not be used on the main thread.\r\nNOTE: If targeting your app to work on API level 22 and before, MANAGE_ACCOUNTS permission is needed for those\r\nplatforms. See docs for this function in API level 22.\r\nRequires android.Manifest.permission.MANAGE_ACCOUNTS\r\nParameters\r\naccountType String : The account type required (see getAccountsByType(String) ), must not be null\r\nauthTokenType\r\nString : The desired auth token type (see getAuthToken(Account, String, Bundle,\r\nActivity, AccountManagerCallback, Handler) ), must not be null\r\nfeatures\r\nString : Required features for the account (see getAccountsByTypeAndFeatures(String,\r\nString, AccountManagerCallback, Handler) ), may be null or empty\r\nactivity\r\nActivity : The Activity context to use for launching new sub-Activities to prompt to add\r\nan account, select an account, and/or enter a password, as necessary; used only to call\r\nstartActivity(); should not be null\r\naddAccountOptions\r\nBundle : Authenticator-specific options to use for adding new accounts; may be null or\r\nempty\r\ngetAuthTokenOptions Bundle : Authenticator-specific options to use for getting auth tokens; may be null or empty\r\ncallback\r\nAccountManagerCallback : Callback to invoke when the request completes, null for no\r\ncallback\r\nhandler Handler : Handler identifying the callback thread, null for the main thread\r\ngetAuthenticatorTypes\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 25 of 36\n\npublic AuthenticatorDescription[] getAuthenticatorTypes ()\r\nLists the currently registered authenticators.\r\nIt is safe to call this method from the main thread.\r\nNo permission is required to call this method.\r\nCaller targeting API level 34 and above, the results are filtered by the rules of package visibility.\r\ngetPackagesAndVisibilityForAccount\r\npublic Map\u003cString,Integer\u003e getPackagesAndVisibilityForAccount (Account account)\r\nReturns package names and visibility which were explicitly set for given account.\r\nThis method requires the caller to have a signature match with the authenticator that owns the specified account.\r\nParameters\r\naccount Account : The account for which visibility data should be returned\r\nReturns\r\nMap\u003cString,Integer\u003e Map from package names to visibility for given account\r\ngetPassword\r\npublic String getPassword (Account account)\r\nGets the saved password associated with the account. This is intended for authenticators and related code; applications\r\nshould get an auth token instead.\r\nIt is safe to call this method from the main thread.\r\nThis method requires the caller to have a signature match with the authenticator that owns the specified account.\r\nNOTE: If targeting your app to work on API level Build.VERSION_CODES.LOLLIPOP_MR1 and before,\r\nAUTHENTICATE_ACCOUNTS permission is needed for those platforms. See docs for this function in API level\r\nBuild.VERSION_CODES.LOLLIPOP_MR1 .\r\nRequires android.Manifest.permission.AUTHENTICATE_ACCOUNTS\r\nParameters\r\naccount Account : The account to query for a password. Must not be null .\r\nReturns\r\nString The account's password, null if none or if the account doesn't exist\r\ngetPreviousName\r\npublic String getPreviousName (Account account)\r\nGets the previous name associated with the account or null , if none. This is intended so that clients of\r\nOnAccountsUpdateListener can determine if an authenticator has renamed an account.\r\nIt is safe to call this method from the main thread.\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 26 of 36\n\nParameters\r\naccount Account : The account to query for a previous name.\r\nReturns\r\nString The account's previous name, null if the account has never been renamed.\r\ngetUserData\r\npublic String getUserData (Account account,\r\n String key)\r\nGets the user data named by \"key\" associated with the account. This is intended for authenticators and related code to store\r\narbitrary metadata along with accounts. The meaning of the keys and values is up to the authenticator for the account.\r\nIt is safe to call this method from the main thread.\r\nThis method requires the caller to have a signature match with the authenticator that owns the specified account.\r\nNOTE: If targeting your app to work on API level Build.VERSION_CODES.LOLLIPOP_MR1 and before,\r\nAUTHENTICATE_ACCOUNTS permission is needed for those platforms. See docs for this function in API level\r\nBuild.VERSION_CODES.LOLLIPOP_MR1 .\r\nRequires android.Manifest.permission.AUTHENTICATE_ACCOUNTS\r\nParameters\r\naccount Account : The account to query for user data\r\nkey String\r\nReturns\r\nString The user data, null if the account, key doesn't exist, or the user is locked\r\nhasFeatures\r\npublic AccountManagerFuture\u003cBoolean\u003e hasFeatures (Account account,\r\n String[] features,\r\n AccountManagerCallback\u003cBoolean\u003e callback,\r\n Handler handler)\r\nFinds out whether a particular account has all the specified features. Account features are authenticator-specific string tokens\r\nidentifying boolean account properties. For example, features are used to tell whether Google accounts have a particular\r\nservice (such as Google Calendar or Google Talk) enabled. The feature names and their meanings are published somewhere\r\nassociated with the authenticator in question.\r\nThis method may be called from any thread, but the returned AccountManagerFuture must not be used on the main thread.\r\nIf caller target API level is below Build.VERSION_CODES.O , it is required to hold the permission\r\nManifest.permission.GET_ACCOUNTS or have a signature match with the AbstractAccountAuthenticator that manages the\r\naccount.\r\nParameters\r\naccount Account : The Account to test\r\nfeatures String : An array of the account features to check\r\ncallback AccountManagerCallback : Callback to invoke when the request completes, null for no callback\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 27 of 36\n\nhandler Handler : Handler identifying the callback thread, null for the main thread\r\ninvalidateAuthToken\r\npublic void invalidateAuthToken (String accountType,\r\n String authToken)\r\nRemoves an auth token from the AccountManager's cache. Does nothing if the auth token is not currently in the cache.\r\nApplications must call this method when the auth token is found to have expired or otherwise become invalid for\r\nauthenticating requests. The AccountManager does not validate or expire cached auth tokens otherwise.\r\nIt is safe to call this method from the main thread.\r\nNOTE: If targeting your app to work on API level 22 and before, MANAGE_ACCOUNTS or USE_CREDENTIALS\r\npermission is needed for those platforms. See docs for this function in API level 22.\r\nRequires android.Manifest.permission.MANAGE_ACCOUNTS or android.Manifest.permission.USE_CREDENTIALS\r\nParameters\r\naccountType String : The account type of the auth token to invalidate, must not be null\r\nauthToken String : The auth token to invalidate, may be null\r\nisCredentialsUpdateSuggested\r\npublic AccountManagerFuture\u003cBoolean\u003e isCredentialsUpdateSuggested (Account account,\r\n String statusToken,\r\n AccountManagerCallback\u003cBoolean\u003e callback,\r\n Handler handler)\r\nChecks whether updateCredentials(Account, String, Bundle, Activity, AccountManagerCallback, Handler) or\r\nstartUpdateCredentialsSession(Account, String, Bundle, Activity, AccountManagerCallback, Handler) should be\r\ncalled with respect to the specified account.\r\nThis method may be called from any thread, but the returned AccountManagerFuture must not be used on the main thread.\r\nParameters\r\naccount\r\nAccount : The Account to be checked whether updateCredentials(Account, String, Bundle,\r\nActivity, AccountManagerCallback, Handler) or startUpdateCredentialsSession(Account,\r\nString, Bundle, Activity, AccountManagerCallback, Handler) should be called\r\nstatusToken String : a String of token to check account staus\r\ncallback AccountManagerCallback : Callback to invoke when the request completes, null for no callback\r\nhandler Handler : Handler identifying the callback thread, null for the main thread\r\nnewChooseAccountIntent\r\npublic static Intent newChooseAccountIntent (Account selectedAccount,\r\n List\u003cAccount\u003e allowableAccounts,\r\n String[] allowableAccountTypes,\r\n String descriptionOverrideText,\r\n String addAccountAuthTokenType,\r\n String[] addAccountRequiredFeatures,\r\n Bundle addAccountOptions)\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 28 of 36\n\nReturns an intent to an Activity that prompts the user to choose from a list of accounts. The caller will then typically start\r\nthe activity by calling startActivityForResult(intent, ...); .\r\nOn success the activity returns a Bundle with the account name and type specified using keys KEY_ACCOUNT_NAME and\r\nKEY_ACCOUNT_TYPE . Chosen account is marked as VISIBILITY_USER_MANAGED_VISIBLE to the caller (see\r\nsetAccountVisibility(Account, String, int) ) and will be returned to it in consequent getAccountsByType(String) )\r\ncalls.\r\nThe most common case is to call this with one account type, e.g.:\r\n newChooseAccountIntent(null, null, new String[]{\"com.google\"}, null, null, null,\r\n null);\r\nParameters\r\nselectedAccount\r\nAccount : if specified, indicates that the Account is the currently selected one,\r\naccording to the caller's definition of selected.\r\nallowableAccounts\r\nList : an optional List of accounts that are allowed to be shown. If not specified\r\nthen this field will not limit the displayed accounts.\r\nallowableAccountTypes\r\nString : an optional string array of account types. These are used both to filter the\r\nshown accounts and to filter the list of account types that are shown when adding an\r\naccount. If not specified then this field will not limit the displayed account types\r\nwhen adding an account.\r\ndescriptionOverrideText\r\nString : if non-null this string is used as the description in the accounts chooser\r\nscreen rather than the default\r\naddAccountAuthTokenType\r\nString : this string is passed as the addAccount(String, String, String, Bundle,\r\nActivity, AccountManagerCallback, Handler) authTokenType parameter\r\naddAccountRequiredFeatures\r\nString : this string array is passed as the addAccount(String, String, String,\r\nBundle, Activity, AccountManagerCallback, Handler) requiredFeatures parameter\r\naddAccountOptions\r\nBundle : This Bundle is passed as the addAccount(String, String, String,\r\nBundle, Activity, AccountManagerCallback, Handler) options parameter\r\nReturns\r\nIntent an Intent that can be used to launch the ChooseAccount activity flow.\r\nnewChooseAccountIntent\r\npublic static Intent newChooseAccountIntent (Account selectedAccount,\r\n ArrayList\u003cAccount\u003e allowableAccounts,\r\n String[] allowableAccountTypes,\r\n boolean alwaysPromptForAccount,\r\n String descriptionOverrideText,\r\n String addAccountAuthTokenType,\r\n String[] addAccountRequiredFeatures,\r\n Bundle addAccountOptions)\r\nDeprecated in favor of newChooseAccountIntent(Account,List,String[],String,String,String[],Bundle) . Returns an\r\nintent to an Activity that prompts the user to choose from a list of accounts. The caller will then typically start the activity\r\nby calling startActivityForResult(intent, ...); .\r\nOn success the activity returns a Bundle with the account name and type specified using keys KEY_ACCOUNT_NAME and\r\nKEY_ACCOUNT_TYPE . Chosen account is marked as VISIBILITY_USER_MANAGED_VISIBLE to the caller (see\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 29 of 36\n\nsetAccountVisibility(Account, String, int) ) and will be returned to it in consequent getAccountsByType(String) )\r\ncalls.\r\nThe most common case is to call this with one account type, e.g.:\r\n newChooseAccountIntent(null, null, new String[]{\"com.google\"}, false, null,\r\n null, null, null);\r\nParameters\r\nselectedAccount\r\nAccount : if specified, indicates that the Account is the currently selected one,\r\naccording to the caller's definition of selected.\r\nallowableAccounts\r\nArrayList : an optional List of accounts that are allowed to be shown. If not\r\nspecified then this field will not limit the displayed accounts.\r\nallowableAccountTypes\r\nString : an optional string array of account types. These are used both to filter the\r\nshown accounts and to filter the list of account types that are shown when adding an\r\naccount. If not specified then this field will not limit the displayed account types\r\nwhen adding an account.\r\nalwaysPromptForAccount boolean : boolean that is ignored.\r\ndescriptionOverrideText\r\nString : if non-null this string is used as the description in the accounts chooser\r\nscreen rather than the default\r\naddAccountAuthTokenType\r\nString : this string is passed as the addAccount(String, String, String, Bundle,\r\nActivity, AccountManagerCallback, Handler) authTokenType parameter\r\naddAccountRequiredFeatures\r\nString : this string array is passed as the addAccount(String, String, String,\r\nBundle, Activity, AccountManagerCallback, Handler) requiredFeatures parameter\r\naddAccountOptions\r\nBundle : This Bundle is passed as the addAccount(String, String, String,\r\nBundle, Activity, AccountManagerCallback, Handler) options parameter\r\nReturns\r\nIntent an Intent that can be used to launch the ChooseAccount activity flow.\r\nnotifyAccountAuthenticated\r\npublic boolean notifyAccountAuthenticated (Account account)\r\nNotifies the system that the account has just been authenticated. This information may be used by other applications to\r\nverify the account. This should be called only when the user has entered correct credentials for the account.\r\nIt is not safe to call this method from the main thread. As such, call it from another thread.\r\nThis method requires the caller to have a signature match with the authenticator that owns the specified account.\r\nRequires android.Manifest.permission.AUTHENTICATE_ACCOUNTS\r\nParameters\r\naccount Account : The Account to be updated.\r\nReturns\r\nboolean\r\nboolean true if the authentication of the account has been successfully acknowledged. Otherwise\r\nfalse .\r\npeekAuthToken\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 30 of 36\n\npublic String peekAuthToken (Account account,\r\n String authTokenType)\r\nGets an auth token from the AccountManager's cache. If no auth token is cached for this account, null will be returned -- a\r\nnew auth token will not be generated, and the server will not be contacted. Intended for use by the authenticator, not directly\r\nby applications.\r\nIt is safe to call this method from the main thread.\r\nThis method requires the caller to have a signature match with the authenticator that manages the specified account.\r\nNOTE: If targeting your app to work on API level 22 and before, AUTHENTICATE_ACCOUNTS permission and same\r\nUID as account's authenticator is needed for those platforms. See docs for this function in API level 22.\r\nRequires android.Manifest.permission.AUTHENTICATE_ACCOUNTS\r\nParameters\r\naccount Account : The account for which an auth token is to be fetched. Cannot be null .\r\nauthTokenType String : The type of auth token to fetch. Cannot be null .\r\nReturns\r\nString\r\nThe cached auth token for this account and type, or null if no auth token is cached, the account does not\r\nexist, or the user is locked\r\nremoveAccount\r\npublic AccountManagerFuture\u003cBundle\u003e removeAccount (Account account,\r\n Activity activity,\r\n AccountManagerCallback\u003cBundle\u003e callback,\r\n Handler handler)\r\nRemoves an account from the AccountManager. Does nothing if the account does not exist. Does not delete the account\r\nfrom the server. The authenticator may have its own policies preventing account deletion, in which case the account will not\r\nbe deleted.\r\nThis method may be called from any thread, but the returned AccountManagerFuture must not be used on the main thread.\r\nThis method requires the caller to have a signature match with the authenticator that manages the specified account, be a\r\nprofile owner or have the ERROR(/android.Manifest.permission#REMOVE_ACCOUNTS) permission.\r\nNOTE: If targeting your app to work on API level 22 and before, MANAGE_ACCOUNTS permission is needed for those\r\nplatforms. See docs for this function in API level 22.\r\nParameters\r\naccount Account : The Account to remove\r\nactivity\r\nActivity : The Activity context to use for launching a new authenticator-defined sub-Activity to\r\nprompt the user to delete an account; used only to call startActivity(); if null, the prompt will not be\r\nlaunched directly, but the Intent may be returned to the caller instead\r\ncallback AccountManagerCallback : Callback to invoke when the request completes, null for no callback\r\nhandler Handler : Handler identifying the callback thread, null for the main thread\r\nremoveAccount\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 31 of 36\n\npublic AccountManagerFuture\u003cBoolean\u003e removeAccount (Account account,\r\n AccountManagerCallback\u003cBoolean\u003e callback,\r\n Handler handler)\r\nThis method was deprecated in API level 22.\r\nuse removeAccount(Account,Activity,AccountManagerCallback,Handler) instead\r\nRemoves an account from the AccountManager. Does nothing if the account does not exist. Does not delete the account\r\nfrom the server. The authenticator may have its own policies preventing account deletion, in which case the account will not\r\nbe deleted.\r\nThis method requires the caller to have a signature match with the authenticator that manages the specified account.\r\nNOTE: If targeting your app to work on API level 22 and before, MANAGE_ACCOUNTS permission is needed for those\r\nplatforms. See docs for this function in API level 22.\r\nRequires android.Manifest.permission.MANAGE_ACCOUNTS\r\nParameters\r\naccount Account : The Account to remove\r\ncallback AccountManagerCallback : Callback to invoke when the request completes, null for no callback\r\nhandler Handler : Handler identifying the callback thread, null for the main thread\r\nremoveAccountExplicitly\r\npublic boolean removeAccountExplicitly (Account account)\r\nRemoves an account directly. Normally used by authenticators, not directly by applications. Does not delete the account\r\nfrom the server. The authenticator may have its own policies preventing account deletion, in which case the account will not\r\nbe deleted.\r\nIt is safe to call this method from the main thread.\r\nThis method requires the caller to have a signature match with the authenticator that manages the specified account.\r\nNOTE: If targeting your app to work on API level 22 and before, AUTHENTICATE_ACCOUNTS permission and same\r\nUID as account's authenticator is needed for those platforms. See docs for this function in API level 22.\r\nRequires android.Manifest.permission.AUTHENTICATE_ACCOUNTS\r\nParameters\r\naccount Account : The Account to delete.\r\nReturns\r\nboolean\r\nTrue if the account was successfully deleted, false if the account did not exist, the account is null, or\r\nanother error occurs.\r\nrenameAccount\r\npublic AccountManagerFuture\u003cAccount\u003e renameAccount (Account account,\r\n String newName,\r\n AccountManagerCallback\u003cAccount\u003e callback,\r\n Handler handler)\r\nRename the specified Account . This is equivalent to removing the existing account and adding a new renamed account\r\nwith the old account's user data.\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 32 of 36\n\nIt is safe to call this method from the main thread.\r\nThis method requires the caller to have a signature match with the authenticator that manages the specified account.\r\nNOTE: If targeting your app to work on API level 22 and before, AUTHENTICATE_ACCOUNTS permission and same\r\nUID as account's authenticator is needed for those platforms. See docs for this function in API level 22.\r\nRequires android.Manifest.permission.AUTHENTICATE_ACCOUNTS\r\nParameters\r\naccount Account : The Account to rename\r\nnewName String : String name to be associated with the account.\r\ncallback AccountManagerCallback : Callback to invoke when the request completes, null for no callback\r\nhandler Handler : Handler identifying the callback thread, null for the main thread\r\nsetAuthToken\r\npublic void setAuthToken (Account account,\r\n String authTokenType,\r\n String authToken)\r\nAdds an auth token to the AccountManager cache for an account. If the account does not exist then this call has no effect.\r\nReplaces any previous auth token for this account and auth token type. Intended for use by the authenticator, not directly by\r\napplications.\r\nIt is safe to call this method from the main thread.\r\nThis method requires the caller to have a signature match with the authenticator that manages the specified account.\r\nNOTE: If targeting your app to work on API level 22 and before, AUTHENTICATE_ACCOUNTS permission and same\r\nUID as account's authenticator is needed for those platforms. See docs for this function in API level 22.\r\nRequires android.Manifest.permission.AUTHENTICATE_ACCOUNTS\r\nParameters\r\naccount Account : The account to set an auth token for\r\nauthTokenType String : The type of the auth token, see {#getAuthToken}\r\nauthToken String : The auth token to add to the cache\r\nsetPassword\r\npublic void setPassword (Account account,\r\n String password)\r\nSets or forgets a saved password. This modifies the local copy of the password used to automatically authenticate the user; it\r\ndoes not change the user's account password on the server. Intended for use by the authenticator, not directly by applications.\r\nCalling this method does not update the last authenticated timestamp, referred by KEY_LAST_AUTHENTICATED_TIME . To\r\nupdate it, call notifyAccountAuthenticated(Account) after getting success.\r\nIt is safe to call this method from the main thread.\r\nThis method requires the caller to have a signature match with the authenticator that manages the specified account.\r\nNOTE: If targeting your app to work on API level 22 and before, AUTHENTICATE_ACCOUNTS permission and same\r\nUID as account's authenticator is needed for those platforms. See docs for this function in API level 22.\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 33 of 36\n\nRequires android.Manifest.permission.AUTHENTICATE_ACCOUNTS\r\nParameters\r\naccount Account : The account whose password is to be set. Cannot be null .\r\npassword String : The password to set, null to clear the password\r\nsetUserData\r\npublic void setUserData (Account account,\r\n String key,\r\n String value)\r\nSets one userdata key for an account. Intended by use for the authenticator to stash state for itself, not directly by\r\napplications. The meaning of the keys and values is up to the authenticator.\r\nIt is safe to call this method from the main thread.\r\nThis method requires the caller to have a signature match with the authenticator that manages the specified account.\r\nNOTE: If targeting your app to work on API level 22 and before, AUTHENTICATE_ACCOUNTS permission and same\r\nUID as account's authenticator is needed for those platforms. See docs for this function in API level 22.\r\nRequires android.Manifest.permission.AUTHENTICATE_ACCOUNTS\r\nParameters\r\naccount Account : Account whose user data is to be set. Must not be null .\r\nkey String : String user data key to set. Must not be null\r\nvalue String : String value to set, null to clear this user data key\r\nstartAddAccountSession\r\npublic AccountManagerFuture\u003cBundle\u003e startAddAccountSession (String accountType,\r\n String authTokenType,\r\n String[] requiredFeatures,\r\n Bundle options,\r\n Activity activity,\r\n AccountManagerCallback\u003cBundle\u003e callback,\r\n Handler handler)\r\nAsks the user to authenticate with an account of a specified type. The authenticator for this account type processes this\r\nrequest with the appropriate user interface. If the user does elect to authenticate with a new account, a bundle of session data\r\nfor installing the account later is returned with optional account password and account status token.\r\nThis method may be called from any thread, but the returned AccountManagerFuture must not be used on the main thread.\r\nNOTE: The account will not be installed to the device by calling this api alone. #finishSession should be called after this to\r\ninstall the account on device.\r\nParameters\r\naccountType String : The type of account to add; must not be null\r\nauthTokenType\r\nString : The type of auth token (see getAuthToken(Account, String, Bundle, Activity,\r\nAccountManagerCallback, Handler) ) this account will need to be able to generate, null for none\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 34 of 36\n\nrequiredFeatures\r\nString : The features (see hasFeatures(Account, String, AccountManagerCallback,\r\nHandler) ) this account must have, null for none\r\noptions Bundle : Authenticator-specific options for the request, may be null or empty\r\nactivity\r\nActivity : The Activity context to use for launching a new authenticator-defined sub-Activity to prompt the user to create an account; used only to call startActivity(); if null, the\r\nprompt will not be launched directly, but the necessary Intent will be returned to the caller\r\ninstead\r\ncallback AccountManagerCallback : Callback to invoke when the request completes, null for no callback\r\nhandler Handler : Handler identifying the callback thread, null for the main thread\r\nstartUpdateCredentialsSession\r\npublic AccountManagerFuture\u003cBundle\u003e startUpdateCredentialsSession (Account account,\r\n String authTokenType,\r\n Bundle options,\r\n Activity activity,\r\n AccountManagerCallback\u003cBundle\u003e callback,\r\n Handler handler)\r\nAsks the user to enter a new password for the account but not updating the saved credentials for the account until\r\nfinishSession(Bundle, Activity, AccountManagerCallback, Handler) is called.\r\nThis method may be called from any thread, but the returned AccountManagerFuture must not be used on the main thread.\r\nNOTE: The saved credentials for the account alone will not be updated by calling this API alone. #finishSession should be\r\ncalled after this to update local credentials\r\nParameters\r\naccount Account : The account to update credentials for\r\nauthTokenType\r\nString : The credentials entered must allow an auth token of this type to be created (but no actual\r\nauth token is returned); may be null\r\noptions Bundle : Authenticator-specific options for the request; may be null or empty\r\nactivity\r\nActivity : The Activity context to use for launching a new authenticator-defined sub-Activity\r\nto prompt the user to enter a password; used only to call startActivity(); if null, the prompt will not\r\nbe launched directly, but the necessary Intent will be returned to the caller instead\r\ncallback AccountManagerCallback : Callback to invoke when the request completes, null for no callback\r\nhandler Handler : Handler identifying the callback thread, null for the main thread\r\nupdateCredentials\r\npublic AccountManagerFuture\u003cBundle\u003e updateCredentials (Account account,\r\n String authTokenType,\r\n Bundle options,\r\n Activity activity,\r\n AccountManagerCallback\u003cBundle\u003e callback,\r\n Handler handler)\r\nAsks the user to enter a new password for an account, updating the saved credentials for the account. Normally this happens\r\nautomatically when the server rejects credentials during an auth token fetch, but this can be invoked directly to ensure we\r\nhave the correct credentials stored.\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 35 of 36\n\nThis method may be called from any thread, but the returned AccountManagerFuture must not be used on the main thread.\r\nNOTE: If targeting your app to work on API level 22 and before, MANAGE_ACCOUNTS permission is needed for those\r\nplatforms. See docs for this function in API level 22.\r\nRequires android.Manifest.permission.MANAGE_ACCOUNTS\r\nParameters\r\naccount Account : The account to update credentials for\r\nauthTokenType\r\nString : The credentials entered must allow an auth token of this type to be created (but no actual\r\nauth token is returned); may be null\r\noptions Bundle : Authenticator-specific options for the request; may be null or empty\r\nactivity\r\nActivity : The Activity context to use for launching a new authenticator-defined sub-Activity\r\nto prompt the user to enter a password; used only to call startActivity(); if null, the prompt will not\r\nbe launched directly, but the necessary Intent will be returned to the caller instead\r\ncallback AccountManagerCallback : Callback to invoke when the request completes, null for no callback\r\nhandler Handler : Handler identifying the callback thread, null for the main thread\r\nSource: https://developer.android.com/reference/android/accounts/AccountManager\r\nhttps://developer.android.com/reference/android/accounts/AccountManager\r\nPage 36 of 36",
	"extraction_quality": 1,
	"language": "EN",
	"sources": [
		"MITRE"
	],
	"references": [
		"https://developer.android.com/reference/android/accounts/AccountManager"
	],
	"report_names": [
		"AccountManager"
	],
	"threat_actors": [],
	"ts_created_at": 1775434955,
	"ts_updated_at": 1775791249,
	"ts_creation_date": 0,
	"ts_modification_date": 0,
	"files": {
		"pdf": "https://archive.orkl.eu/d88fcc6e28f08d2b7189fcf5ffb74a016886d177.pdf",
		"text": "https://archive.orkl.eu/d88fcc6e28f08d2b7189fcf5ffb74a016886d177.txt",
		"img": "https://archive.orkl.eu/d88fcc6e28f08d2b7189fcf5ffb74a016886d177.jpg"
	}
}