1603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana/*
2603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana * Copyright (C) 2009 The Android Open Source Project
3603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana *
4603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana * Licensed under the Apache License, Version 2.0 (the "License");
5603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana * you may not use this file except in compliance with the License.
6603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana * You may obtain a copy of the License at
7603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana *
8603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana *      http://www.apache.org/licenses/LICENSE-2.0
9603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana *
10603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana * Unless required by applicable law or agreed to in writing, software
11603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana * distributed under the License is distributed on an "AS IS" BASIS,
12603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana * See the License for the specific language governing permissions and
14603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana * limitations under the License.
15603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana */
16603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana
17603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintanapackage android.accounts;
18603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana
19603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintanaimport android.accounts.IAccountManagerResponse;
20603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintanaimport android.accounts.Account;
219788976b1465ce982b5ae7c741345edd0ecd9322Fred Quintanaimport android.accounts.AuthenticatorDescription;
22603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintanaimport android.os.Bundle;
23603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana
24ffd0cb04f97e62d286d185c520580d81a9c328b1Fred Quintana
25603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana/**
26603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana * Central application service that provides account management.
273326920329cecb57c7ff1fc5c6add5c98aab9ed9Fred Quintana * @hide
28603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana */
29603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintanainterface IAccountManager {
30603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana    String getPassword(in Account account);
31603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana    String getUserData(in Account account, String key);
329788976b1465ce982b5ae7c741345edd0ecd9322Fred Quintana    AuthenticatorDescription[] getAuthenticatorTypes();
33ffd0cb04f97e62d286d185c520580d81a9c328b1Fred Quintana    Account[] getAccounts(String accountType);
342c7bc26a7447e6ac9eadcf328259aa3bb1be2949Amith Yamasani    Account[] getAccountsAsUser(String accountType, int userId);
353084a6f80180506ce26fe4773d9a19f004b7f625Fred Quintana    void hasFeatures(in IAccountManagerResponse response, in Account account, in String[] features);
36ffd0cb04f97e62d286d185c520580d81a9c328b1Fred Quintana    void getAccountsByFeatures(in IAccountManagerResponse response, String accountType, in String[] features);
37603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana    boolean addAccount(in Account account, String password, in Bundle extras);
38ffd0cb04f97e62d286d185c520580d81a9c328b1Fred Quintana    void removeAccount(in IAccountManagerResponse response, in Account account);
39603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana    void invalidateAuthToken(String accountType, String authToken);
40603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana    String peekAuthToken(in Account account, String authTokenType);
41603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana    void setAuthToken(in Account account, String authTokenType, String authToken);
42603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana    void setPassword(in Account account, String password);
43603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana    void clearPassword(in Account account);
44603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana    void setUserData(in Account account, String key, String value);
45d9640ec712806508877868d08aafaa2d715ff441Fred Quintana    void updateAppPermission(in Account account, String authTokenType, int uid, boolean value);
46603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana
47a698f4276968d078b1b9e2f3738c4f559a3307b2Fred Quintana    void getAuthToken(in IAccountManagerResponse response, in Account account,
48a698f4276968d078b1b9e2f3738c4f559a3307b2Fred Quintana        String authTokenType, boolean notifyOnAuthFailure, boolean expectActivityLaunch,
49a698f4276968d078b1b9e2f3738c4f559a3307b2Fred Quintana        in Bundle options);
50a698f4276968d078b1b9e2f3738c4f559a3307b2Fred Quintana    void addAcount(in IAccountManagerResponse response, String accountType,
513084a6f80180506ce26fe4773d9a19f004b7f625Fred Quintana        String authTokenType, in String[] requiredFeatures, boolean expectActivityLaunch,
523326920329cecb57c7ff1fc5c6add5c98aab9ed9Fred Quintana        in Bundle options);
53a698f4276968d078b1b9e2f3738c4f559a3307b2Fred Quintana    void updateCredentials(in IAccountManagerResponse response, in Account account,
54a698f4276968d078b1b9e2f3738c4f559a3307b2Fred Quintana        String authTokenType, boolean expectActivityLaunch, in Bundle options);
55a698f4276968d078b1b9e2f3738c4f559a3307b2Fred Quintana    void editProperties(in IAccountManagerResponse response, String accountType,
56a698f4276968d078b1b9e2f3738c4f559a3307b2Fred Quintana        boolean expectActivityLaunch);
572c7bc26a7447e6ac9eadcf328259aa3bb1be2949Amith Yamasani    void confirmCredentialsAsUser(in IAccountManagerResponse response, in Account account,
582c7bc26a7447e6ac9eadcf328259aa3bb1be2949Amith Yamasani        in Bundle options, boolean expectActivityLaunch, int userId);
59d9640ec712806508877868d08aafaa2d715ff441Fred Quintana    void getAuthTokenLabel(in IAccountManagerResponse response, String accountType,
60d9640ec712806508877868d08aafaa2d715ff441Fred Quintana        String authTokenType);
61603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana}
62