Home | History | Annotate | Download | only in accounts

Lines Matching refs:account

55  * per account, granting applications access to online resources with
59 * authentication, so the account manager uses pluggable <em>authenticator</em>
60 * modules for different <em>account types</em>. Authenticators (which may be
61 * written by third parties) handle the actual details of validating account
62 * credentials and storing account information. For example, Google, Facebook,
83 * identifies the authenticator. Account <em>features</em> are used to
84 * identify particular account subtypes and capabilities. Both the account
91 * account of the appropriate type.
94 * account selection, it must make sure the account is still in the list
96 * for an account no longer on the device results in an undefined failure.
98 * <li>Request an auth token for the selected account(s) using one of the
118 * prompt for credentials, present options, or ask the user to add an account.
160 * Bundle key used for the {@link String} account name in results
161 * from methods which return information about a particular account.
166 * Bundle key used for the {@link String} account type in results
167 * from methods which return information about a particular account.
231 public static final String AUTHENTICATOR_ATTRIBUTES_NAME = "account-authenticator";
240 * account's credentials (saved password, etc) are changed.
300 * Gets the saved password associated with the account.
308 * and to have the same UID as the account's authenticator.
310 * @param account The account to query for a password
311 * @return The account's password, null if none or if the account doesn't exist
313 public String getPassword(final Account account) {
314 if (account == null) throw new IllegalArgumentException("account is null");
316 return mService.getPassword(account);
324 * Gets the user data named by "key" associated with the account.
327 * and values is up to the authenticator for the account.
333 * and to have the same UID as the account's authenticator.
335 * @param account The account to query for user data
336 * @return The user data, null if the account or key doesn't exist
338 public String getUserData(final Account account, final String key) {
339 if (account == null) throw new IllegalArgumentException("account is null");
342 return mService.getUserData(account, key);
378 * @return An array of {@link Account}, one for each account. Empty
381 Account[] getAccounts() {
398 public Account[] getAccountsForPackage(String packageName, int uid) {
412 * @return An array of {@link Account}, one per matching account. Empty
415 public Account[] getAccountsByTypeForPackage(String type, String packageName) {
425 * Lists all accounts of a particular type. The account type is a
427 * of the account. For example, there are types corresponding to Google
437 * @return An array of {@link Account}, one per matching account. Empty
440 public Account[] getAccountsByType(String type) {
445 public Account[] getAccountsByTypeAsUser(String type, UserHandle userHandle) {
456 * for an account.
459 * @param account The account whose permissions are being modified
465 public void updateAppPermission(Account account, String authTokenType, int uid, boolean value) {
467 mService.updateAppPermission(account, authTokenType, uid, value);
504 * Finds out whether a particular account has all the specified features.
505 * Account features are authenticator-specific string tokens identifying
506 * boolean account properties. For example, features are used to tell
517 * @param account The {@link Account} to test
518 * @param features An array of the account features to check
524 * true if the account exists and has all of the specified features.
526 public AccountManagerFuture<Boolean> hasFeatures(final Account account,
529 if (account == null) throw new IllegalArgumentException("account is null");
533 mService.hasFeatures(mResponse, account, features);
545 * Lists all accounts of a type which have certain features. The account
547 * Account features are authenticator-specific string tokens identifying
548 * boolean account properties (see {@link #hasFeatures}).
551 * which may contact the server or do other work to check account features,
561 * @param features An array of the account features to require,
568 * {@link Account}, one per account of the specified type which
571 public AccountManagerFuture<Account[]> getAccountsByTypeAndFeatures(
573 AccountManagerCallback<Account[]> callback, Handler handler) {
575 return new Future2Task<Account[]>(handler, callback) {
579 public Account[] bundleToResult(Bundle bundle) throws AuthenticatorException {
584 Account[] descs = new Account[parcelables.length];
586 descs[i] = (Account) parcelables[i];
594 * Adds an account directly to the AccountManager. Normally used by sign-up
601 * and to have the same UID as the added account's authenticator.
603 * @param account The {@link Account} to add
604 * @param password The password to associate with the account, null for none
605 * @param userdata String values to use for the account's userdata, null for none
606 * @return True if the account was successfully added, false if the account
607 * already exists, the account is null, or another error occurs.
609 public boolean addAccountExplicitly(Account account, String password, Bundle userdata) {
610 if (account == null) throw new IllegalArgumentException("account is null");
612 return mService.addAccountExplicitly(account, password, userdata);
620 * Removes an account from the AccountManager. Does nothing if the account
621 * does not exist. Does not delete the account from the server.
622 * The authenticator may have its own policies preventing account
623 * deletion, in which case the account will not be deleted.
631 * @param account The {@link Account} to remove
637 * true if the account has been successfully removed,
638 * false if the authenticator forbids deleting this account.
640 public AccountManagerFuture<Boolean> removeAccount(final Account account,
642 if (account == null) throw new IllegalArgumentException("account is null");
645 mService.removeAccount(mResponse, account);
669 * @param accountType The account type of the auth token to invalidate, must not be null
686 * token is cached for this account, null will be returned -- a new
694 * and to have the same UID as the account's authenticator.
696 * @param account The account to fetch an auth token for
698 * @return The cached auth token for this account and type, or null if
699 * no auth token is cached or the account does not exist.
701 public String peekAuthToken(final Account account, final String authTokenType) {
702 if (account == null) throw new IllegalArgumentException("account is null");
705 return mService.peekAuthToken(account, authTokenType);
715 * not change the user's account password on the server. Intended for use
722 * and have the same UID as the account's authenticator.
724 * @param account The account to set a password for
727 public void setPassword(final Account account, final String password) {
728 if (account == null) throw new IllegalArgumentException("account is null");
730 mService.setPassword(account, password);
739 * it does not change the user's account password on the server.
740 * Has the same effect as setPassword(account, null) but requires fewer
742 * to "sign out" from an account.
749 * @param account The account whose password to clear
751 public void clearPassword(final Account account) {
752 if (account == null) throw new IllegalArgumentException("account is null");
754 mService.clearPassword(account);
762 * Sets one userdata key for an account. Intended by use for the
770 * and to have the same UID as the account's authenticator.
772 * @param account The account to set the userdata for
776 public void setUserData(final Account account, final String key, final String value) {
777 if (account == null) throw new IllegalArgumentException("account is null");
780 mService.setUserData(account, key, value);
788 * Adds an auth token to the AccountManager cache for an account.
789 * If the account does not exist then this call has no effect.
790 * Replaces any previous auth token for this account and auth token type.
797 * and to have the same UID as the account's authenticator.
799 * @param account The account to set an auth token for
803 public void setAuthToken(Account account, final String authTokenType, final String authToken) {
804 if (account == null) throw new IllegalArgumentException("account is null");
807 mService.setAuthToken(account, authTokenType, authToken);
816 * {@link #getAuthToken(Account, String, boolean, AccountManagerCallback, Handler)}.
824 * @param account The account to fetch an auth token for
829 * @return An auth token of the specified type for this account, or null
837 public String blockingGetAuthToken(Account account, String authTokenType,
840 if (account == null) throw new IllegalArgumentException("account is null");
842 Bundle bundle = getAuthToken(account, authTokenType, notifyAuthFailure, null /* callback */,
850 + account + ", authTokenType " + authTokenType);
857 * Gets an auth token of the specified type for a particular account,
862 * <p>If a previously generated auth token is cached for this account and
870 * tokens to access Gmail and Google Calendar for the same account.
878 * @param account The account to fetch an auth token for
893 * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account you supplied
894 * <li> {@link #KEY_ACCOUNT_TYPE} - the type of the account
907 * If the account is no longer present on the device, the return value is
909 * account before requesting an auth token.
912 final Account account, final String authTokenType, final Bundle options,
914 if (account == null) throw new IllegalArgumentException("account is null");
923 mService.getAuthToken(mResponse, account, authTokenType,
931 * Gets an auth token of the specified type for a particular account,
936 * <p>If a previously generated auth token is cached for this account and
946 * supply a new password, the account manager will broadcast the
957 * tokens to access Gmail and Google Calendar for the same account.
965 * @param account The account to fetch an auth token for
977 * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account you supplied
978 * <li> {@link #KEY_ACCOUNT_TYPE} - the type of the account
994 * If the account is no longer present on the device, the return value is
996 * account before requesting an auth token.
997 * @deprecated use {@link #getAuthToken(Account, String, android.os.Bundle,
1002 final Account account, final String authTokenType,
1005 return getAuthToken(account, authTokenType, null, notifyAuthFailure, callback,
1010 * Gets an auth token of the specified type for a particular account,
1015 * <p>If a previously generated auth token is cached for this account and
1025 * supply a new password, the account manager will broadcast the
1036 * tokens to access Gmail and Google Calendar for the same account.
1044 * @param account The account to fetch an auth token for
1058 * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account you supplied
1059 * <li> {@link #KEY_ACCOUNT_TYPE} - the type of the account
1075 * If the account is no longer present on the device, the return value is
1077 * account before requesting an auth token.
1080 final Account account, final String authTokenType, final Bundle options,
1084 if (account == null) throw new IllegalArgumentException("account is null");
1093 mService.getAuthToken(mResponse, account, authTokenType,
1100 * Asks the user to add an account of a specified type. The authenticator
1101 * for this account type processes this request with the appropriate user
1102 * interface. If the user does elect to create a new account, the account
1111 * @param accountType The type of account to add; must not be null
1113 * this account will need to be able to generate, null for none
1115 * account must have, null for none
1120 * account; used only to call startActivity(); if null, the prompt
1128 * these fields if activity was specified and an account was created:
1130 * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account created
1131 * <li> {@link #KEY_ACCOUNT_TYPE} - the type of the account
1136 * actual account creation process. If an error occurred,
1140 * this account type or the authenticator failed to respond
1144 * creating a new account, usually because of network trouble
1167 * Adds a shared account from the primary user to a secondary user. Adding the shared account
1171 * @param account the account to share
1176 public boolean addSharedAccount(final Account account, UserHandle user) {
1178 boolean val = mService.addSharedAccountAsUser(account, user.getIdentifier());
1188 * Removes the shared account.
1189 * @param account the account to remove
1190 * @param user the user to remove the account from
1193 public boolean removeSharedAccount(final Account account, UserHandle user) {
1195 boolean val = mService.removeSharedAccountAsUser(account, user.getIdentifier());
1208 public Account[] getSharedAccounts(UserHandle user) {
1218 * Confirms that the user knows the password for an account to make extra
1219 * sure they are the owner of the account. The user-entered password can
1220 * be supplied directly, otherwise the authenticator for this account type
1224 * account password if they forget the lock pattern.
1227 * account, the request is considered valid; otherwise the authenticator
1236 * @param account The account to confirm password knowledge for
1252 * the account was successfully verified:
1254 * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account created
1255 * <li> {@link #KEY_ACCOUNT_TYPE} - the type of the account
1271 public AccountManagerFuture<Bundle> confirmCredentials(final Account account,
1276 return confirmCredentialsAsUser(account, options, activity, callback, handler,
1282 * Same as {@link #confirmCredentials(Account, Bundle, Activity, AccountManagerCallback, Handler)}
1285 public AccountManagerFuture<Bundle> confirmCredentialsAsUser(final Account account,
1290 if (account == null) throw new IllegalArgumentException("account is null");
1294 mService.confirmCredentialsAsUser(mResponse, account, options, activity != null,
1301 * Asks the user to enter a new password for an account, updating the
1302 * saved credentials for the account. Normally this happens automatically
1312 * @param account The account to update credentials for
1328 * with these fields if an activity was supplied and the account
1331 * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account created
1332 * <li> {@link #KEY_ACCOUNT_TYPE} - the type of the account
1347 public AccountManagerFuture<Bundle> updateCredentials(final Account account,
1352 if (account == null) throw new IllegalArgumentException("account is null");
1355 mService.updateCredentials(mResponse, account, authTokenType, activity != null,
1364 * account. Not all authenticators support this method.
1372 * @param accountType The account type associated with the authenticator
1391 * this account type or the authenticator failed to respond
1433 final Account[] accounts) {
1434 final Account[] accountsCopy = new Account[accounts.length];
1736 if (accountType == null) throw new IllegalArgumentException("account type is null");
1755 new AccountManagerCallback<Account[]>() {
1756 public void run(AccountManagerFuture<Account[]> future) {
1757 Account[] accounts;
1780 // send result since we can't prompt to add an account
1793 // have a single account, return an authtoken for it
1807 Account account = new Account(
1810 mFuture = getAuthToken(account, mAuthTokenType, mLoginOptions,
1832 // send result since we can't prompt to select an account
1853 setException(new AuthenticatorException("account not in result"));
1856 final Account account = new Account(accountName, accountType);
1858 getAuthToken(account, mAuthTokenType, null /* options */, mActivity,
1882 * an auth token is acquired for the chosen account.
1890 * @param accountType The account type required
1894 * @param features Required features for the account
1897 * sub-Activities to prompt to add an account, select an account,
1911 * <li> {@link #KEY_ACCOUNT_NAME} - the name of the account
1912 * <li> {@link #KEY_ACCOUNT_TYPE} - the type of the account
1919 * this account type or the authenticator failed to respond
1931 if (accountType == null) throw new IllegalArgumentException("account type is null");
1946 * On success the activity returns a Bundle with the account name and type specified using
1949 * The most common case is to call this with one account type, e.g.:
1953 * @param selectedAccount if specified, indicates that the {@link Account} is the currently
1957 * @param allowableAccountTypes an optional string array of account types. These are used
1958 * both to filter the shown accounts and to filter the list of account types that are shown
1959 * when adding an account.
1960 * @param alwaysPromptForAccount if set the account chooser screen is always shown, otherwise
1961 * it is only shown when there is more than one account from which to choose
1972 static public Intent newChooseAccountIntent(Account selectedAccount,
1973 ArrayList<Account> allowableAccounts,
2014 final Account[] accounts = getAccounts();
2046 * (on the handler thread) right away with the current account list
2064 account changes
2081 * receive notifications of account changes.