Lines Matching defs:account

62  * per account, granting applications access to online resources with
66 * authentication, so the account manager uses pluggable <em>authenticator</em>
67 * modules for different <em>account types</em>. Authenticators (which may be
68 * written by third parties) handle the actual details of validating account
69 * credentials and storing account information. For example, Google, Facebook,
91 * identify particular account subtypes and capabilities. Both the account
98 * account of the appropriate type.
101 * account selection, it must make sure the account is still in the list
103 * for an account no longer on the device results in an undefined failure.
105 * <li>Request an auth token for the selected account(s) using one of the
125 * prompt for credentials, present options, or ask the user to add an account.
169 * Bundle key used for the {@link String} account name in results
170 * from methods which return information about a particular account.
175 * Bundle key used for the {@link String} account type in results
176 * from methods which return information about a particular account.
213 * Bundle key used to supply the last time the credentials of the account
215 * epoch. Associated time is updated on successful authentication of account
216 * on adding account, confirming credentials, or updating credentials.
247 * for installing an account later.
254 * Bundle key used for the {@link String} account status token in result
256 * information about a particular account.
266 public static final String AUTHENTICATOR_ATTRIBUTES_NAME = "account-authenticator";
275 * account's credentials (saved password, etc) are changed.
335 * Gets the saved password associated with the account.
342 * authenticator that owns the specified account.
348 * @param account The account to query for a password. Must not be {@code null}.
349 * @return The account's password, null if none or if the account doesn't exist
351 public String getPassword(final Account account) {
352 if (account == null) throw new IllegalArgumentException("account is null");
354 return mService.getPassword(account);
361 * Gets the user data named by "key" associated with the account.
364 * and values is up to the authenticator for the account.
369 * authenticator that owns the specified account.
375 * @param account The account to query for user data
376 * @return The user data, null if the account or key doesn't exist
378 public String getUserData(final Account account, final String key) {
379 if (account == null) throw new IllegalArgumentException("account is null");
382 return mService.getUserData(account, key);
439 * @return An array of {@link Account}, one for each account. Empty
464 * @return An array of {@link Account}, one for each account. Empty
499 * @return An array of {@link Account}, one per matching account. Empty
513 * Lists all accounts of a particular type. The account type is a
515 * of the account. For example, there are types corresponding to Google
531 * @return An array of {@link Account}, one per matching account. Empty
553 * for an account.
556 * @param account The account whose permissions are being modified
562 public void updateAppPermission(Account account, String authTokenType, int uid, boolean value) {
564 mService.updateAppPermission(account, authTokenType, uid, value);
601 * Finds out whether a particular account has all the specified features.
603 * boolean account properties. For example, features are used to tell
613 * match with the AbstractAccountAuthenticator that manages the account.
615 * @param account The {@link Account} to test
616 * @param features An array of the account features to check
622 * true if the account exists and has all of the specified features.
625 public AccountManagerFuture<Boolean> hasFeatures(final Account account,
628 if (account == null) throw new IllegalArgumentException("account is null");
633 mService.hasFeatures(mResponse, account, features, mContext.getOpPackageName());
646 * Lists all accounts of a type which have certain features. The account
649 * boolean account properties (see {@link #hasFeatures}).
652 * which may contact the server or do other work to check account features,
664 * @param features An array of the account features to require,
676 * {@link Account}, one per account of the specified type which
706 * Adds an account directly to the AccountManager. Normally used by sign-up
717 * authenticator that owns the specified account.
723 * @param account The {@link Account} to add
724 * @param password The password to associate with the account, null for none
725 * @param userdata String values to use for the account's userdata, null for
727 * @return True if the account was successfully added, false if the account
728 * already exists, the account is null, or another error occurs.
730 public boolean addAccountExplicitly(Account account, String password, Bundle userdata) {
731 if (account == null) throw new IllegalArgumentException("account is null");
733 return mService.addAccountExplicitly(account, password, userdata);
740 * Notifies the system that the account has just been authenticated. This
741 * information may be used by other applications to verify the account. This
743 * the account.
748 * authenticator that owns the specified account.
750 * @param account The {@link Account} to be updated.
751 * @return boolean {@code true} if the authentication of the account has been successfully
754 public boolean notifyAccountAuthenticated(Account account) {
755 if (account == null)
756 throw new IllegalArgumentException("account is null");
758 return mService.accountAuthenticated(account);
766 * the existing account and adding a new renamed account with the old
767 * account's user data.
772 * authenticator that manages the specified account.
775 * AUTHENTICATE_ACCOUNTS permission and same UID as account's authenticator
778 * @param account The {@link Account} to rename
779 * @param newName String name to be associated with the account.
785 * after the name change. If successful the account's name will be the
789 final Account account,
793 if (account == null) throw new IllegalArgumentException("account is null.");
800 mService.renameAccount(mResponse, account, newName);
812 * Gets the previous name associated with the account or {@code null}, if
815 * authenticator has renamed an account.
819 * @param account The account to query for a previous name.
820 * @return The account's previous name, null if the account has never been
823 public String getPreviousName(final Account account) {
824 if (account == null) throw new IllegalArgumentException("account is null");
826 return mService.getPreviousName(account);
833 * Removes an account from the AccountManager. Does nothing if the account
834 * does not exist. Does not delete the account from the server.
835 * The authenticator may have its own policies preventing account
836 * deletion, in which case the account will not be deleted.
839 * authenticator that manages the specified account.
845 * @param account The {@link Account} to remove
851 * true if the account has been successfully removed
857 public AccountManagerFuture<Boolean> removeAccount(final Account account,
859 if (account == null) throw new IllegalArgumentException("account is null");
863 mService.removeAccount(mResponse, account, false);
876 * Removes an account from the AccountManager. Does nothing if the account
877 * does not exist. Does not delete the account from the server.
878 * The authenticator may have its own policies preventing account
879 * deletion, in which case the account will not be deleted.
885 * authenticator that manages the specified account.
891 * @param account The {@link Account} to remove
894 * account; used only to call startActivity(); if null, the prompt
902 * {@link #KEY_BOOLEAN_RESULT} if activity was specified and an account
905 * needed to launch the actual account removal process, if authenticator
910 * this account type or the authenticator failed to respond
916 public AccountManagerFuture<Bundle> removeAccount(final Account account,
918 if (account == null) throw new IllegalArgumentException("account is null");
922 mService.removeAccount(mResponse, account, activity != null);
935 public AccountManagerFuture<Boolean> removeAccountAsUser(final Account account,
938 if (account == null) throw new IllegalArgumentException("account is null");
943 mService.removeAccountAsUser(mResponse, account, false, userHandle.getIdentifier());
959 public AccountManagerFuture<Bundle> removeAccountAsUser(final Account account,
962 if (account == null)
963 throw new IllegalArgumentException("account is null");
969 mService.removeAccountAsUser(mResponse, account, activity != null,
976 * Removes an account directly. Normally used by authenticators, not
977 * directly by applications. Does not delete the account from the server.
978 * The authenticator may have its own policies preventing account deletion,
979 * in which case the account will not be deleted.
983 * authenticator that manages the specified account.
986 * AUTHENTICATE_ACCOUNTS permission and same UID as account's authenticator
989 * @param account The {@link Account} to delete.
990 * @return True if the account was successfully deleted, false if the
991 * account did not exist, the account is null, or another error
994 public boolean removeAccountExplicitly(Account account) {
995 if (account == null) throw new IllegalArgumentException("account is null");
997 return mService.removeAccountExplicitly(account);
1016 * @param accountType The account type of the auth token to invalidate, must not be null
1032 * token is cached for this account, null will be returned -- a new
1039 * authenticator that manages the specified account.
1042 * AUTHENTICATE_ACCOUNTS permission and same UID as account's authenticator
1045 * @param account The account for which an auth token is to be fetched. Cannot be {@code null}.
1047 * @return The cached auth token for this account and type, or null if
1048 * no auth token is cached or the account does not exist.
1051 public String peekAuthToken(final Account account, final String authTokenType) {
1052 if (account == null) throw new IllegalArgumentException("account is null");
1055 return mService.peekAuthToken(account, authTokenType);
1064 * the user's account password on the server. Intended for use by the
1071 * authenticator that manages the specified account.
1074 * AUTHENTICATE_ACCOUNTS permission and same UID as account's authenticator
1077 * @param account The account whose password is to be set. Cannot be
1081 public void setPassword(final Account account, final String password) {
1082 if (account == null) throw new IllegalArgumentException("account is null");
1084 mService.setPassword(account, password);
1092 * it does not change the user's account password on the server.
1093 * Has the same effect as setPassword(account, null) but requires fewer
1095 * to "sign out" from an account.
1097 * <p>This method only successfully clear the account's password when the
1099 * specified account. Otherwise, this method will silently fail.
1107 * @param account The account whose password to clear
1109 public void clearPassword(final Account account) {
1110 if (account == null) throw new IllegalArgumentException("account is null");
1112 mService.clearPassword(account);
1119 * Sets one userdata key for an account. Intended by use for the
1126 * authenticator that manages the specified account.
1129 * AUTHENTICATE_ACCOUNTS permission and same UID as account's authenticator
1132 * @param account Account whose user data is to be set. Must not be {@code null}.
1136 public void setUserData(final Account account, final String key, final String value) {
1137 if (account == null) throw new IllegalArgumentException("account is null");
1140 mService.setUserData(account, key, value);
1147 * Adds an auth token to the AccountManager cache for an account.
1148 * If the account does not exist then this call has no effect.
1149 * Replaces any previous auth token for this account and auth token type.
1155 * authenticator that manages the specified account.
1158 * AUTHENTICATE_ACCOUNTS permission and same UID as account's authenticator
1161 * @param account The account to set an auth token for
1165 public void setAuthToken(Account account, final String authTokenType, final String authToken) {
1166 if (account == null) throw new IllegalArgumentException("account is null");
1169 mService.setAuthToken(account, authTokenType, authToken);
1186 * @param account The account to fetch an auth token for
1191 * @return An auth token of the specified type for this account, or null
1199 public String blockingGetAuthToken(Account account, String authTokenType,
1202 if (account == null) throw new IllegalArgumentException("account is null");
1204 Bundle bundle = getAuthToken(account, authTokenType, notifyAuthFailure, null /* callback */,
1212 + account + ", authTokenType " + authTokenType);
1219 * Gets an auth token of the specified type for a particular account,
1224 * <p>If a previously generated auth token is cached for this account and
1232 * tokens to access Gmail and Google Calendar for the same account.
1241 * @param account The account to fetch an auth token for
1256 * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account you supplied
1257 * <li> {@link #KEY_ACCOUNT_TYPE} - the type of the account
1270 * If the account is no longer present on the device, the return value is
1272 * account before requesting an auth token.
1275 final Account account, final String authTokenType, final Bundle options,
1277 if (account == null) throw new IllegalArgumentException("account is null");
1287 mService.getAuthToken(mResponse, account, authTokenType,
1295 * Gets an auth token of the specified type for a particular account,
1300 * <p>If a previously generated auth token is cached for this account and
1310 * supply a new password, the account manager will broadcast the
1321 * tokens to access Gmail and Google Calendar for the same account.
1326 * @param account The account to fetch an auth token for
1338 * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account you supplied
1339 * <li> {@link #KEY_ACCOUNT_TYPE} - the type of the account
1355 * If the account is no longer present on the device, the return value is
1357 * account before requesting an auth token.
1363 final Account account, final String authTokenType,
1366 return getAuthToken(account, authTokenType, null, notifyAuthFailure, callback,
1371 * Gets an auth token of the specified type for a particular account,
1376 * <p>If a previously generated auth token is cached for this account and
1386 * supply a new password, the account manager will broadcast the
1397 * tokens to access Gmail and Google Calendar for the same account.
1406 * @param account The account to fetch an auth token for
1420 * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account you supplied
1421 * <li> {@link #KEY_ACCOUNT_TYPE} - the type of the account
1437 * If the account is no longer present on the device, the return value is
1439 * account before requesting an auth token.
1442 final Account account, final String authTokenType, final Bundle options,
1446 if (account == null) throw new IllegalArgumentException("account is null");
1456 mService.getAuthToken(mResponse, account, authTokenType,
1463 * Asks the user to add an account of a specified type. The authenticator
1464 * for this account type processes this request with the appropriate user
1465 * interface. If the user does elect to create a new account, the account
1475 * @param accountType The type of account to add; must not be null
1477 * this account will need to be able to generate, null for none
1479 * account must have, null for none
1484 * account; used only to call startActivity(); if null, the prompt
1492 * these fields if activity was specified and an account was created:
1494 * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account created
1495 * <li> {@link #KEY_ACCOUNT_TYPE} - the type of the account
1500 * actual account creation process. If an error occurred,
1504 * this account type or the authenticator failed to respond
1509 * creating a new account, usually because of network trouble
1559 * Adds shared accounts from a parent user to a secondary user. Adding the shared account
1577 * Copies an account from one user to another user.
1578 * @param account the account to copy
1579 * @param fromUser the user to copy the account from
1590 final Account account, final UserHandle fromUser, final UserHandle toUser,
1592 if (account == null) throw new IllegalArgumentException("account is null");
1601 mResponse, account, fromUser.getIdentifier(), toUser.getIdentifier());
1615 * Removes the shared account.
1616 * @param account the account to remove
1617 * @param user the user to remove the account from
1620 public boolean removeSharedAccount(final Account account, UserHandle user) {
1622 boolean val = mService.removeSharedAccountAsUser(account, user.getIdentifier());
1643 * Confirms that the user knows the password for an account to make extra
1644 * sure they are the owner of the account. The user-entered password can
1645 * be supplied directly, otherwise the authenticator for this account type
1649 * account password if they forget the lock pattern.
1652 * account, the request is considered valid; otherwise the authenticator
1662 * @param account The account to confirm password knowledge for
1678 * the account was successfully verified:
1680 * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account verified
1681 * <li> {@link #KEY_ACCOUNT_TYPE} - the type of the account
1702 public AccountManagerFuture<Bundle> confirmCredentials(final Account account,
1707 return confirmCredentialsAsUser(account, options, activity, callback, handler,
1716 public AccountManagerFuture<Bundle> confirmCredentialsAsUser(final Account account,
1721 if (account == null) throw new IllegalArgumentException("account is null");
1726 mService.confirmCredentialsAsUser(mResponse, account, options, activity != null,
1733 * Asks the user to enter a new password for an account, updating the
1734 * saved credentials for the account. Normally this happens automatically
1745 * @param account The account to update credentials for
1761 * with these fields if an activity was supplied and the account
1764 * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account
1765 * <li> {@link #KEY_ACCOUNT_TYPE} - the type of the account
1780 public AccountManagerFuture<Bundle> updateCredentials(final Account account,
1785 if (account == null) throw new IllegalArgumentException("account is null");
1789 mService.updateCredentials(mResponse, account, authTokenType, activity != null,
1798 * account. Not all authenticators support this method.
1804 * authenticator associated with the specified account type.
1810 * @param accountType The account type associated with the authenticator
1829 * this account type or the authenticator failed to respond
1850 * Checks if the given account exists on any of the users on the device.
1853 * @param account The account to check for existence.
1854 * @return whether any user has this account
1856 public boolean someUserHasAccount(@NonNull final Account account) {
1858 return mService.someUserHasAccount(account);
2211 if (accountType == null) throw new IllegalArgumentException("account type is null");
2257 // send result since we can't prompt to add an account
2270 // have a single account, return an authtoken for it
2285 Account account = new Account(
2288 mFuture = getAuthToken(account, mAuthTokenType, mLoginOptions,
2311 // send result since we can't prompt to select an account
2333 setException(new AuthenticatorException("account not in result"));
2336 final Account account = new Account(accountName, accountType);
2338 getAuthToken(account, mAuthTokenType, null /* options */, mActivity,
2362 * an auth token is acquired for the chosen account.
2371 * @param accountType The account type required
2375 * @param features Required features for the account
2378 * sub-Activities to prompt to add an account, select an account,
2392 * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account
2393 * <li> {@link #KEY_ACCOUNT_TYPE} - the type of the account
2400 * this account type or the authenticator failed to respond
2412 if (accountType == null) throw new IllegalArgumentException("account type is null");
2430 * On success the activity returns a Bundle with the account name and type specified using
2433 * The most common case is to call this with one account type, e.g.:
2441 * @param allowableAccountTypes an optional string array of account types. These are used
2442 * both to filter the shown accounts and to filter the list of account types that are shown
2443 * when adding an account. If not specified then this field will not limit the displayed
2444 * account types when adding an account.
2482 * On success the activity returns a Bundle with the account name and type specified using
2485 * The most common case is to call this with one account type, e.g.:
2493 * @param allowableAccountTypes an optional string array of account types. These are used
2494 * both to filter the shown accounts and to filter the list of account types that are shown
2495 * when adding an account. If not specified then this field will not limit the displayed
2496 * account types when adding an account.
2582 * (on the handler thread) right away with the current account list
2601 // Register a broadcast receiver to monitor account changes
2618 * receive notifications of account changes.
2643 * Asks the user to authenticate with an account of a specified type. The
2644 * authenticator for this account type processes this request with the
2646 * new account, a bundle of session data for installing the account later is
2647 * returned with optional account password and account status token.
2653 * <b>NOTE:</b> The account will not be installed to the device by calling
2655 * account on device.
2657 * @param accountType The type of account to add; must not be null
2659 * this account will need to be able to generate, null for none
2661 * account must have, null for none
2666 * create an account; used only to call startActivity(); if null,
2675 * with an account:
2680 * hash of the account.
2682 * status of the account
2686 * actual account creation process. If authenticator doesn't support
2689 * {@code options} needed to add account later. If an error
2693 * registered for this account type or the authenticator failed to
2700 * problem creating a new account, usually because of network
2737 * Asks the user to enter a new password for an account but not updating the
2738 * saved credentials for the account until {@link #finishSession} is called.
2743 * <b>NOTE:</b> The saved credentials for the account alone will not be
2747 * @param account The account to update credentials for
2764 * successfully re-authenticated to the account:
2769 * hash of the account
2771 * status of the account
2792 final Account account,
2798 if (account == null) {
2799 throw new IllegalArgumentException("account is null");
2815 account,
2825 * {@link #startUpdateCredentialsSession}. This will either add the account
2835 * create an account or reauthenticate existing account; used
2844 * these fields if an activity was supplied and an account was added
2847 * <li>{@link #KEY_ACCOUNT_NAME} - the name of the account created
2848 * <li>{@link #KEY_ACCOUNT_TYPE} - the type of the account
2853 * actual account creation process. If an error occurred,
2857 * registered for this account type or the authenticator failed to
2864 * problem creating a new account, usually because of network
2899 /* Add information required by add account flow */
2918 * called with respect to the specified account.
2923 * @param account The {@link Account} to be checked whether {@link #updateCredentials} or
2925 * @param statusToken a String of token to check account staus
2929 * of the account should be updated.
2934 final Account account,
2938 if (account == null) {
2939 throw new IllegalArgumentException("account is null");
2951 account,