blob: 8b98ca28ca815663454b5de85856a7f81b953c2d [file] [log] [blame]
Fred Quintana60307342009-03-24 22:48:12 -07001/*
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
17package android.accounts;
18
19import android.accounts.IAccountAuthenticatorResponse;
Fred Quintanaa698f422009-04-08 19:14:54 -070020import android.accounts.Account;
21import android.os.Bundle;
Fred Quintana60307342009-03-24 22:48:12 -070022
23/**
24 * Service that allows the interaction with an authentication server.
Fred Quintanaf7ae77c2009-10-02 17:19:31 -070025 * @hide
Fred Quintana60307342009-03-24 22:48:12 -070026 */
27oneway interface IAccountAuthenticator {
28 /**
29 * prompts the user for account information and adds the result to the IAccountManager
30 */
Fred Quintanaa698f422009-04-08 19:14:54 -070031 void addAccount(in IAccountAuthenticatorResponse response, String accountType,
Fred Quintana33269202009-04-20 16:05:10 -070032 String authTokenType, in String[] requiredFeatures, in Bundle options);
Fred Quintanaa698f422009-04-08 19:14:54 -070033
34 /**
Fred Quintana60307342009-03-24 22:48:12 -070035 * prompts the user for the credentials of the account
36 */
Fred Quintanaf7ae77c2009-10-02 17:19:31 -070037 void confirmCredentials(in IAccountAuthenticatorResponse response, in Account account,
38 in Bundle options);
Fred Quintana60307342009-03-24 22:48:12 -070039
40 /**
41 * gets the password by either prompting the user or querying the IAccountManager
42 */
Fred Quintanaa698f422009-04-08 19:14:54 -070043 void getAuthToken(in IAccountAuthenticatorResponse response, in Account account,
44 String authTokenType, in Bundle options);
Fred Quintana60307342009-03-24 22:48:12 -070045
46 /**
Fred Quintanad4a1d2e2009-07-16 16:36:38 -070047 * Gets the user-visible label of the given authtoken type.
48 */
49 void getAuthTokenLabel(in IAccountAuthenticatorResponse response, String authTokenType);
50
51 /**
Fred Quintana60307342009-03-24 22:48:12 -070052 * prompts the user for a new password and writes it to the IAccountManager
53 */
Fred Quintanaa698f422009-04-08 19:14:54 -070054 void updateCredentials(in IAccountAuthenticatorResponse response, in Account account,
55 String authTokenType, in Bundle options);
Fred Quintana60307342009-03-24 22:48:12 -070056
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 Quintana33269202009-04-20 16:05:10 -070061
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 Quintanaffd0cb042009-08-15 21:45:26 -070068
69 /**
70 * Gets whether or not the account is allowed to be removed.
71 */
72 void getAccountRemovalAllowed(in IAccountAuthenticatorResponse response, in Account account);
Amith Yamasani67df64b2012-12-14 12:09:36 -080073
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 Kwan78812282015-11-04 11:19:47 -080086
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 Kwane68c37e2015-11-12 17:11:49 -080093
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 Kwan920f6ef2015-11-10 14:13:29 -080099
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 Kwan390c9d22016-01-12 14:13:37 -0800107
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 Quintana60307342009-03-24 22:48:12 -0700113}