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
17package android.accounts;
18
19import android.accounts.IAccountManagerResponse;
20import android.accounts.Account;
21import android.accounts.AuthenticatorDescription;
22import android.os.Bundle;
23
24
25/**
26 * Central application service that provides account management.
27 * @hide
28 */
29interface IAccountManager {
30    String getPassword(in Account account);
31    String getUserData(in Account account, String key);
32    AuthenticatorDescription[] getAuthenticatorTypes();
33    Account[] getAccounts(String accountType);
34    Account[] getAccountsAsUser(String accountType, int userId);
35    void hasFeatures(in IAccountManagerResponse response, in Account account, in String[] features);
36    void getAccountsByFeatures(in IAccountManagerResponse response, String accountType, in String[] features);
37    boolean addAccount(in Account account, String password, in Bundle extras);
38    void removeAccount(in IAccountManagerResponse response, in Account account);
39    void invalidateAuthToken(String accountType, String authToken);
40    String peekAuthToken(in Account account, String authTokenType);
41    void setAuthToken(in Account account, String authTokenType, String authToken);
42    void setPassword(in Account account, String password);
43    void clearPassword(in Account account);
44    void setUserData(in Account account, String key, String value);
45    void updateAppPermission(in Account account, String authTokenType, int uid, boolean value);
46
47    void getAuthToken(in IAccountManagerResponse response, in Account account,
48        String authTokenType, boolean notifyOnAuthFailure, boolean expectActivityLaunch,
49        in Bundle options);
50    void addAcount(in IAccountManagerResponse response, String accountType,
51        String authTokenType, in String[] requiredFeatures, boolean expectActivityLaunch,
52        in Bundle options);
53    void updateCredentials(in IAccountManagerResponse response, in Account account,
54        String authTokenType, boolean expectActivityLaunch, in Bundle options);
55    void editProperties(in IAccountManagerResponse response, String accountType,
56        boolean expectActivityLaunch);
57    void confirmCredentialsAsUser(in IAccountManagerResponse response, in Account account,
58        in Bundle options, boolean expectActivityLaunch, int userId);
59    void getAuthTokenLabel(in IAccountManagerResponse response, String accountType,
60        String authTokenType);
61}
62