Lines Matching refs:account

52  * per account, granting applications access to online resources with
56 * authentication, so the account manager uses pluggable <em>authenticator</em>
57 * modules for different <em>account types</em>. Authenticators (which may be
58 * written by third parties) handle the actual details of validating account
59 * credentials and storing account information. For example, Google, Facebook,
81 * identify particular account subtypes and capabilities. Both the account
88 * account of the appropriate type.
91 * account selection, it must make sure the account is still in the list
93 * for an account no longer on the device results in an undefined failure.
95 * <li>Request an auth token for the selected account(s) using one of the
115 * prompt for credentials, present options, or ask the user to add an account.
153 * Bundle key used for the {@link String} account name in results
154 * from methods which return information about a particular account.
159 * Bundle key used for the {@link String} account type in results
160 * from methods which return information about a particular account.
224 public static final String AUTHENTICATOR_ATTRIBUTES_NAME = "account-authenticator";
233 * account's credentials (saved password, etc) are changed.
293 * Gets the saved password associated with the account.
301 * and to have the same UID as the account's authenticator.
303 * @param account The account to query for a password
304 * @return The account's password, null if none or if the account doesn't exist
306 public String getPassword(final Account account) {
307 if (account == null) throw new IllegalArgumentException("account is null");
309 return mService.getPassword(account);
317 * Gets the user data named by "key" associated with the account.
320 * and values is up to the authenticator for the account.
326 * and to have the same UID as the account's authenticator.
328 * @param account The account to query for user data
329 * @return The user data, null if the account or key doesn't exist
331 public String getUserData(final Account account, final String key) {
332 if (account == null) throw new IllegalArgumentException("account is null");
335 return mService.getUserData(account, key);
371 * @return An array of {@link Account}, one for each account. Empty
384 * Lists all accounts of a particular type. The account type is a
386 * of the account. For example, there are types corresponding to Google
396 * @return An array of {@link Account}, one per matching account. Empty
415 * for an account.
418 * @param account The account whose permissions are being modified
424 public void updateAppPermission(Account account, String authTokenType, int uid, boolean value) {
426 mService.updateAppPermission(account, authTokenType, uid, value);
463 * Finds out whether a particular account has all the specified features.
465 * boolean account properties. For example, features are used to tell
476 * @param account The {@link Account} to test
477 * @param features An array of the account features to check
483 * true if the account exists and has all of the specified features.
485 public AccountManagerFuture<Boolean> hasFeatures(final Account account,
488 if (account == null) throw new IllegalArgumentException("account is null");
492 mService.hasFeatures(mResponse, account, features);
504 * Lists all accounts of a type which have certain features. The account
507 * boolean account properties (see {@link #hasFeatures}).
510 * which may contact the server or do other work to check account features,
520 * @param features An array of the account features to require,
527 * {@link Account}, one per account of the specified type which
553 * Adds an account directly to the AccountManager. Normally used by sign-up
560 * and to have the same UID as the added account's authenticator.
562 * @param account The {@link Account} to add
563 * @param password The password to associate with the account, null for none
564 * @param userdata String values to use for the account's userdata, null for none
565 * @return True if the account was successfully added, false if the account
566 * already exists, the account is null, or another error occurs.
568 public boolean addAccountExplicitly(Account account, String password, Bundle userdata) {
569 if (account == null) throw new IllegalArgumentException("account is null");
571 return mService.addAccount(account, password, userdata);
579 * Removes an account from the AccountManager. Does nothing if the account
580 * does not exist. Does not delete the account from the server.
581 * The authenticator may have its own policies preventing account
582 * deletion, in which case the account will not be deleted.
590 * @param account The {@link Account} to remove
596 * true if the account has been successfully removed,
597 * false if the authenticator forbids deleting this account.
599 public AccountManagerFuture<Boolean> removeAccount(final Account account,
601 if (account == null) throw new IllegalArgumentException("account is null");
604 mService.removeAccount(mResponse, account);
628 * @param accountType The account type of the auth token to invalidate, must not be null
645 * token is cached for this account, null will be returned -- a new
653 * and to have the same UID as the account's authenticator.
655 * @param account The account to fetch an auth token for
657 * @return The cached auth token for this account and type, or null if
658 * no auth token is cached or the account does not exist.
660 public String peekAuthToken(final Account account, final String authTokenType) {
661 if (account == null) throw new IllegalArgumentException("account is null");
664 return mService.peekAuthToken(account, authTokenType);
674 * not change the user's account password on the server. Intended for use
681 * and have the same UID as the account's authenticator.
683 * @param account The account to set a password for
686 public void setPassword(final Account account, final String password) {
687 if (account == null) throw new IllegalArgumentException("account is null");
689 mService.setPassword(account, password);
698 * it does not change the user's account password on the server.
699 * Has the same effect as setPassword(account, null) but requires fewer
701 * to "sign out" from an account.
708 * @param account The account whose password to clear
710 public void clearPassword(final Account account) {
711 if (account == null) throw new IllegalArgumentException("account is null");
713 mService.clearPassword(account);
721 * Sets one userdata key for an account. Intended by use for the
729 * and to have the same UID as the account's authenticator.
731 * @param account The account to set the userdata for
735 public void setUserData(final Account account, final String key, final String value) {
736 if (account == null) throw new IllegalArgumentException("account is null");
739 mService.setUserData(account, key, value);
747 * Adds an auth token to the AccountManager cache for an account.
748 * If the account does not exist then this call has no effect.
749 * Replaces any previous auth token for this account and auth token type.
756 * and to have the same UID as the account's authenticator.
758 * @param account The account to set an auth token for
762 public void setAuthToken(Account account, final String authTokenType, final String authToken) {
763 if (account == null) throw new IllegalArgumentException("account is null");
766 mService.setAuthToken(account, authTokenType, authToken);
783 * @param account The account to fetch an auth token for
788 * @return An auth token of the specified type for this account, or null
796 public String blockingGetAuthToken(Account account, String authTokenType,
799 if (account == null) throw new IllegalArgumentException("account is null");
801 Bundle bundle = getAuthToken(account, authTokenType, notifyAuthFailure, null /* callback */,
809 + account + ", authTokenType " + authTokenType);
816 * Gets an auth token of the specified type for a particular account,
821 * <p>If a previously generated auth token is cached for this account and
829 * tokens to access Gmail and Google Calendar for the same account.
837 * @param account The account to fetch an auth token for
852 * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account you supplied
853 * <li> {@link #KEY_ACCOUNT_TYPE} - the type of the account
866 * If the account is no longer present on the device, the return value is
868 * account before requesting an auth token.
871 final Account account, final String authTokenType, final Bundle options,
873 if (account == null) throw new IllegalArgumentException("account is null");
882 mService.getAuthToken(mResponse, account, authTokenType,
890 * Gets an auth token of the specified type for a particular account,
895 * <p>If a previously generated auth token is cached for this account and
905 * supply a new password, the account manager will broadcast the
916 * tokens to access Gmail and Google Calendar for the same account.
924 * @param account The account to fetch an auth token for
936 * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account you supplied
937 * <li> {@link #KEY_ACCOUNT_TYPE} - the type of the account
953 * If the account is no longer present on the device, the return value is
955 * account before requesting an auth token.
961 final Account account, final String authTokenType,
964 return getAuthToken(account, authTokenType, null, notifyAuthFailure, callback,
969 * Gets an auth token of the specified type for a particular account,
974 * <p>If a previously generated auth token is cached for this account and
984 * supply a new password, the account manager will broadcast the
995 * tokens to access Gmail and Google Calendar for the same account.
1003 * @param account The account to fetch an auth token for
1017 * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account you supplied
1018 * <li> {@link #KEY_ACCOUNT_TYPE} - the type of the account
1034 * If the account is no longer present on the device, the return value is
1036 * account before requesting an auth token.
1039 final Account account, final String authTokenType, final Bundle options,
1043 if (account == null) throw new IllegalArgumentException("account is null");
1052 mService.getAuthToken(mResponse, account, authTokenType,
1059 * Asks the user to add an account of a specified type. The authenticator
1060 * for this account type processes this request with the appropriate user
1061 * interface. If the user does elect to create a new account, the account
1070 * @param accountType The type of account to add; must not be null
1072 * this account will need to be able to generate, null for none
1074 * account must have, null for none
1079 * account; used only to call startActivity(); if null, the prompt
1087 * these fields if activity was specified and an account was created:
1089 * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account created
1090 * <li> {@link #KEY_ACCOUNT_TYPE} - the type of the account
1095 * actual account creation process. If an error occurred,
1099 * this account type or the authenticator failed to respond
1103 * creating a new account, usually because of network trouble
1126 * Confirms that the user knows the password for an account to make extra
1127 * sure they are the owner of the account. The user-entered password can
1128 * be supplied directly, otherwise the authenticator for this account type
1132 * account password if they forget the lock pattern.
1135 * account, the request is considered valid; otherwise the authenticator
1144 * @param account The account to confirm password knowledge for
1160 * the account was successfully verified:
1162 * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account created
1163 * <li> {@link #KEY_ACCOUNT_TYPE} - the type of the account
1179 public AccountManagerFuture<Bundle> confirmCredentials(final Account account,
1184 return confirmCredentialsAsUser(account, options, activity, callback, handler,
1193 public AccountManagerFuture<Bundle> confirmCredentialsAsUser(final Account account,
1198 if (account == null) throw new IllegalArgumentException("account is null");
1202 mService.confirmCredentialsAsUser(mResponse, account, options, activity != null,
1209 * Asks the user to enter a new password for an account, updating the
1210 * saved credentials for the account. Normally this happens automatically
1220 * @param account The account to update credentials for
1236 * with these fields if an activity was supplied and the account
1239 * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account created
1240 * <li> {@link #KEY_ACCOUNT_TYPE} - the type of the account
1255 public AccountManagerFuture<Bundle> updateCredentials(final Account account,
1260 if (account == null) throw new IllegalArgumentException("account is null");
1263 mService.updateCredentials(mResponse, account, authTokenType, activity != null,
1272 * account. Not all authenticators support this method.
1280 * @param accountType The account type associated with the authenticator
1299 * this account type or the authenticator failed to respond
1644 if (accountType == null) throw new IllegalArgumentException("account type is null");
1688 // send result since we can't prompt to add an account
1701 // have a single account, return an authtoken for it
1715 Account account = new Account(
1718 mFuture = getAuthToken(account, mAuthTokenType, mLoginOptions,
1737 // send result since we can't prompt to select an account
1758 setException(new AuthenticatorException("account not in result"));
1761 final Account account = new Account(accountName, accountType);
1763 getAuthToken(account, mAuthTokenType, null /* options */, mActivity,
1787 * an auth token is acquired for the chosen account.
1795 * @param accountType The account type required
1799 * @param features Required features for the account
1802 * sub-Activities to prompt to add an account, select an account,
1816 * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account
1817 * <li> {@link #KEY_ACCOUNT_TYPE} - the type of the account
1824 * this account type or the authenticator failed to respond
1836 if (accountType == null) throw new IllegalArgumentException("account type is null");
1851 * On success the activity returns a Bundle with the account name and type specified using
1854 * The most common case is to call this with one account type, e.g.:
1862 * @param allowableAccountTypes an optional string array of account types. These are used
1863 * both to filter the shown accounts and to filter the list of account types that are shown
1864 * when adding an account.
1865 * @param alwaysPromptForAccount if set the account chooser screen is always shown, otherwise
1866 * it is only shown when there is more than one account from which to choose
1948 * (on the handler thread) right away with the current account list
1966 // Register a broadcast receiver to monitor account changes
1983 * receive notifications of account changes.