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);
32c1cf161af036e0f337b58ef0739a8ff2e42f01e7Alexandra Gherghina    AuthenticatorDescription[] getAuthenticatorTypes(int userId);
33ffd0cb04f97e62d286d185c520580d81a9c328b1Fred Quintana    Account[] getAccounts(String accountType);
3427db46850b708070452c0ce49daf5f79503fbde6Amith Yamasani    Account[] getAccountsForPackage(String packageName, int uid);
353b458ad9ee5f2d6b7cf28a13bc29123cdf540763Amith Yamasani    Account[] getAccountsByTypeForPackage(String type, String packageName);
362c7bc26a7447e6ac9eadcf328259aa3bb1be2949Amith Yamasani    Account[] getAccountsAsUser(String accountType, int userId);
373084a6f80180506ce26fe4773d9a19f004b7f625Fred Quintana    void hasFeatures(in IAccountManagerResponse response, in Account account, in String[] features);
38ffd0cb04f97e62d286d185c520580d81a9c328b1Fred Quintana    void getAccountsByFeatures(in IAccountManagerResponse response, String accountType, in String[] features);
3927db46850b708070452c0ce49daf5f79503fbde6Amith Yamasani    boolean addAccountExplicitly(in Account account, String password, in Bundle extras);
408778f993aeb7ec3df88aa0b244381253257bafe2Simranjit Singh Kohli    void removeAccount(in IAccountManagerResponse response, in Account account,
418778f993aeb7ec3df88aa0b244381253257bafe2Simranjit Singh Kohli        boolean expectActivityLaunch);
428778f993aeb7ec3df88aa0b244381253257bafe2Simranjit Singh Kohli    void removeAccountAsUser(in IAccountManagerResponse response, in Account account,
438778f993aeb7ec3df88aa0b244381253257bafe2Simranjit Singh Kohli        boolean expectActivityLaunch, int userId);
448778f993aeb7ec3df88aa0b244381253257bafe2Simranjit Singh Kohli    boolean removeAccountExplicitly(in Account account);
4522dc3b7ba111e27bce99a7cce966598e7873508cEsteban Talavera    void copyAccountToUser(in IAccountManagerResponse response, in Account account,
4622dc3b7ba111e27bce99a7cce966598e7873508cEsteban Talavera        int userFrom, int userTo);
47603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana    void invalidateAuthToken(String accountType, String authToken);
48603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana    String peekAuthToken(in Account account, String authTokenType);
49603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana    void setAuthToken(in Account account, String authTokenType, String authToken);
50603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana    void setPassword(in Account account, String password);
51603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana    void clearPassword(in Account account);
52603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana    void setUserData(in Account account, String key, String value);
53d9640ec712806508877868d08aafaa2d715ff441Fred Quintana    void updateAppPermission(in Account account, String authTokenType, int uid, boolean value);
54603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana
55a698f4276968d078b1b9e2f3738c4f559a3307b2Fred Quintana    void getAuthToken(in IAccountManagerResponse response, in Account account,
56a698f4276968d078b1b9e2f3738c4f559a3307b2Fred Quintana        String authTokenType, boolean notifyOnAuthFailure, boolean expectActivityLaunch,
57a698f4276968d078b1b9e2f3738c4f559a3307b2Fred Quintana        in Bundle options);
5827db46850b708070452c0ce49daf5f79503fbde6Amith Yamasani    void addAccount(in IAccountManagerResponse response, String accountType,
593084a6f80180506ce26fe4773d9a19f004b7f625Fred Quintana        String authTokenType, in String[] requiredFeatures, boolean expectActivityLaunch,
603326920329cecb57c7ff1fc5c6add5c98aab9ed9Fred Quintana        in Bundle options);
61999d394adee533c55fce38bd632ffd4f1af91362Alexandra Gherghina    void addAccountAsUser(in IAccountManagerResponse response, String accountType,
62999d394adee533c55fce38bd632ffd4f1af91362Alexandra Gherghina        String authTokenType, in String[] requiredFeatures, boolean expectActivityLaunch,
63999d394adee533c55fce38bd632ffd4f1af91362Alexandra Gherghina        in Bundle options, int userId);
64a698f4276968d078b1b9e2f3738c4f559a3307b2Fred Quintana    void updateCredentials(in IAccountManagerResponse response, in Account account,
65a698f4276968d078b1b9e2f3738c4f559a3307b2Fred Quintana        String authTokenType, boolean expectActivityLaunch, in Bundle options);
66a698f4276968d078b1b9e2f3738c4f559a3307b2Fred Quintana    void editProperties(in IAccountManagerResponse response, String accountType,
67a698f4276968d078b1b9e2f3738c4f559a3307b2Fred Quintana        boolean expectActivityLaunch);
682c7bc26a7447e6ac9eadcf328259aa3bb1be2949Amith Yamasani    void confirmCredentialsAsUser(in IAccountManagerResponse response, in Account account,
692c7bc26a7447e6ac9eadcf328259aa3bb1be2949Amith Yamasani        in Bundle options, boolean expectActivityLaunch, int userId);
70d9640ec712806508877868d08aafaa2d715ff441Fred Quintana    void getAuthTokenLabel(in IAccountManagerResponse response, String accountType,
71d9640ec712806508877868d08aafaa2d715ff441Fred Quintana        String authTokenType);
7267df64b3a48a8157d08a98fa90135d0ac0ee621cAmith Yamasani
7367df64b3a48a8157d08a98fa90135d0ac0ee621cAmith Yamasani    /* Shared accounts */
7467df64b3a48a8157d08a98fa90135d0ac0ee621cAmith Yamasani    boolean addSharedAccountAsUser(in Account account, int userId);
7567df64b3a48a8157d08a98fa90135d0ac0ee621cAmith Yamasani    Account[] getSharedAccountsAsUser(int userId);
7667df64b3a48a8157d08a98fa90135d0ac0ee621cAmith Yamasani    boolean removeSharedAccountAsUser(in Account account, int userId);
77f193b9a61d0b14d13bb7f8aec42a21154672e5ecCarlos Valdivia
78f193b9a61d0b14d13bb7f8aec42a21154672e5ecCarlos Valdivia    /* Account renaming. */
79f193b9a61d0b14d13bb7f8aec42a21154672e5ecCarlos Valdivia    void renameAccount(in IAccountManagerResponse response, in Account accountToRename, String newName);
80f193b9a61d0b14d13bb7f8aec42a21154672e5ecCarlos Valdivia    String getPreviousName(in Account account);
81f193b9a61d0b14d13bb7f8aec42a21154672e5ecCarlos Valdivia    boolean renameSharedAccountAsUser(in Account accountToRename, String newName, int userId);
82f193b9a61d0b14d13bb7f8aec42a21154672e5ecCarlos Valdivia
83603073430bbcb1bd29db7afb9b14e2732ad589fbFred Quintana}
84