Fred Quintana | 6030734 | 2009-03-24 22:48:12 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2009 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.accounts; |
| 18 | |
| 19 | import android.accounts.IAccountAuthenticatorResponse; |
Fred Quintana | a698f42 | 2009-04-08 19:14:54 -0700 | [diff] [blame] | 20 | import android.accounts.Account; |
| 21 | import android.os.Bundle; |
Fred Quintana | 6030734 | 2009-03-24 22:48:12 -0700 | [diff] [blame] | 22 | |
| 23 | /** |
| 24 | * Service that allows the interaction with an authentication server. |
Fred Quintana | f7ae77c | 2009-10-02 17:19:31 -0700 | [diff] [blame] | 25 | * @hide |
Fred Quintana | 6030734 | 2009-03-24 22:48:12 -0700 | [diff] [blame] | 26 | */ |
| 27 | oneway interface IAccountAuthenticator { |
| 28 | /** |
| 29 | * prompts the user for account information and adds the result to the IAccountManager |
| 30 | */ |
Fred Quintana | a698f42 | 2009-04-08 19:14:54 -0700 | [diff] [blame] | 31 | void addAccount(in IAccountAuthenticatorResponse response, String accountType, |
Fred Quintana | 3326920 | 2009-04-20 16:05:10 -0700 | [diff] [blame] | 32 | String authTokenType, in String[] requiredFeatures, in Bundle options); |
Fred Quintana | a698f42 | 2009-04-08 19:14:54 -0700 | [diff] [blame] | 33 | |
| 34 | /** |
Fred Quintana | 6030734 | 2009-03-24 22:48:12 -0700 | [diff] [blame] | 35 | * prompts the user for the credentials of the account |
| 36 | */ |
Fred Quintana | f7ae77c | 2009-10-02 17:19:31 -0700 | [diff] [blame] | 37 | void confirmCredentials(in IAccountAuthenticatorResponse response, in Account account, |
| 38 | in Bundle options); |
Fred Quintana | 6030734 | 2009-03-24 22:48:12 -0700 | [diff] [blame] | 39 | |
| 40 | /** |
| 41 | * gets the password by either prompting the user or querying the IAccountManager |
| 42 | */ |
Fred Quintana | a698f42 | 2009-04-08 19:14:54 -0700 | [diff] [blame] | 43 | void getAuthToken(in IAccountAuthenticatorResponse response, in Account account, |
| 44 | String authTokenType, in Bundle options); |
Fred Quintana | 6030734 | 2009-03-24 22:48:12 -0700 | [diff] [blame] | 45 | |
| 46 | /** |
Fred Quintana | d4a1d2e | 2009-07-16 16:36:38 -0700 | [diff] [blame] | 47 | * Gets the user-visible label of the given authtoken type. |
| 48 | */ |
| 49 | void getAuthTokenLabel(in IAccountAuthenticatorResponse response, String authTokenType); |
| 50 | |
| 51 | /** |
Fred Quintana | 6030734 | 2009-03-24 22:48:12 -0700 | [diff] [blame] | 52 | * prompts the user for a new password and writes it to the IAccountManager |
| 53 | */ |
Fred Quintana | a698f42 | 2009-04-08 19:14:54 -0700 | [diff] [blame] | 54 | void updateCredentials(in IAccountAuthenticatorResponse response, in Account account, |
| 55 | String authTokenType, in Bundle options); |
Fred Quintana | 6030734 | 2009-03-24 22:48:12 -0700 | [diff] [blame] | 56 | |
| 57 | /** |
| 58 | * launches an activity that lets the user edit and set the properties for an authenticator |
| 59 | */ |
| 60 | void editProperties(in IAccountAuthenticatorResponse response, String accountType); |
Fred Quintana | 3326920 | 2009-04-20 16:05:10 -0700 | [diff] [blame] | 61 | |
| 62 | /** |
| 63 | * returns a Bundle where the boolean value BOOLEAN_RESULT_KEY is set if the account has the |
| 64 | * specified features |
| 65 | */ |
| 66 | void hasFeatures(in IAccountAuthenticatorResponse response, in Account account, |
| 67 | in String[] features); |
Fred Quintana | ffd0cb04 | 2009-08-15 21:45:26 -0700 | [diff] [blame] | 68 | |
| 69 | /** |
| 70 | * Gets whether or not the account is allowed to be removed. |
| 71 | */ |
| 72 | void getAccountRemovalAllowed(in IAccountAuthenticatorResponse response, in Account account); |
Amith Yamasani | 67df64b | 2012-12-14 12:09:36 -0800 | [diff] [blame] | 73 | |
| 74 | /** |
| 75 | * Returns a Bundle containing the required credentials to copy the account across users. |
| 76 | */ |
| 77 | void getAccountCredentialsForCloning(in IAccountAuthenticatorResponse response, |
| 78 | in Account account); |
| 79 | |
| 80 | /** |
| 81 | * Uses the Bundle containing credentials from another instance of the authenticator to create |
| 82 | * a copy of the account on this user. |
| 83 | */ |
| 84 | void addAccountFromCredentials(in IAccountAuthenticatorResponse response, in Account account, |
| 85 | in Bundle accountCredentials); |
Sandra Kwan | 7881228 | 2015-11-04 11:19:47 -0800 | [diff] [blame] | 86 | |
| 87 | /** |
| 88 | * Starts the add account session by prompting the user for account information |
| 89 | * and return a Bundle containing data to finish the session later. |
| 90 | */ |
| 91 | void startAddAccountSession(in IAccountAuthenticatorResponse response, String accountType, |
| 92 | String authTokenType, in String[] requiredFeatures, in Bundle options); |
Sandra Kwan | e68c37e | 2015-11-12 17:11:49 -0800 | [diff] [blame] | 93 | |
| 94 | /** |
| 95 | * Prompts the user for a new password but does not write it to the IAccountManager. |
| 96 | */ |
| 97 | void startUpdateCredentialsSession(in IAccountAuthenticatorResponse response, in Account account, |
| 98 | String authTokenType, in Bundle options); |
Sandra Kwan | 920f6ef | 2015-11-10 14:13:29 -0800 | [diff] [blame] | 99 | |
| 100 | /** |
| 101 | * Finishes the session started by startAddAccountSession(...) or |
| 102 | * startUpdateCredentialsSession(...) by adding account to or updating local credentials |
| 103 | * in the IAccountManager. |
| 104 | */ |
| 105 | void finishSession(in IAccountAuthenticatorResponse response, String accountType, |
| 106 | in Bundle sessionBundle); |
Sandra Kwan | 390c9d2 | 2016-01-12 14:13:37 -0800 | [diff] [blame] | 107 | |
| 108 | /** |
| 109 | * Checks if the credentials of the provided account should be updated. |
| 110 | */ |
| 111 | void isCredentialsUpdateSuggested(in IAccountAuthenticatorResponse response, in Account account, |
| 112 | String statusToken); |
Fred Quintana | 6030734 | 2009-03-24 22:48:12 -0700 | [diff] [blame] | 113 | } |