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.IAccountManagerResponse; 20 import android.accounts.Account; 21 import android.accounts.AuthenticatorDescription; 22 import android.os.Bundle; 23 24 25 /** 26 * Central application service that provides account management. 27 * @hide 28 */ 29 interface IAccountManager { 30 String getPassword(in Account account); 31 String getUserData(in Account account, String key); 32 AuthenticatorDescription[] getAuthenticatorTypes(int userId); 33 Account[] getAccounts(String accountType); 34 Account[] getAccountsForPackage(String packageName, int uid); 35 Account[] getAccountsByTypeForPackage(String type, String packageName); 36 Account[] getAccountsAsUser(String accountType, int userId); 37 void hasFeatures(in IAccountManagerResponse response, in Account account, in String[] features); 38 void getAccountsByFeatures(in IAccountManagerResponse response, String accountType, in String[] features); 39 boolean addAccountExplicitly(in Account account, String password, in Bundle extras); 40 void removeAccount(in IAccountManagerResponse response, in Account account); 41 void removeAccountAsUser(in IAccountManagerResponse response, in Account account, int userId); 42 void invalidateAuthToken(String accountType, String authToken); 43 String peekAuthToken(in Account account, String authTokenType); 44 void setAuthToken(in Account account, String authTokenType, String authToken); 45 void setPassword(in Account account, String password); 46 void clearPassword(in Account account); 47 void setUserData(in Account account, String key, String value); 48 void updateAppPermission(in Account account, String authTokenType, int uid, boolean value); 49 50 void getAuthToken(in IAccountManagerResponse response, in Account account, 51 String authTokenType, boolean notifyOnAuthFailure, boolean expectActivityLaunch, 52 in Bundle options); 53 void addAccount(in IAccountManagerResponse response, String accountType, 54 String authTokenType, in String[] requiredFeatures, boolean expectActivityLaunch, 55 in Bundle options); 56 void addAccountAsUser(in IAccountManagerResponse response, String accountType, 57 String authTokenType, in String[] requiredFeatures, boolean expectActivityLaunch, 58 in Bundle options, int userId); 59 void updateCredentials(in IAccountManagerResponse response, in Account account, 60 String authTokenType, boolean expectActivityLaunch, in Bundle options); 61 void editProperties(in IAccountManagerResponse response, String accountType, 62 boolean expectActivityLaunch); 63 void confirmCredentialsAsUser(in IAccountManagerResponse response, in Account account, 64 in Bundle options, boolean expectActivityLaunch, int userId); 65 void getAuthTokenLabel(in IAccountManagerResponse response, String accountType, 66 String authTokenType); 67 68 /* Shared accounts */ 69 boolean addSharedAccountAsUser(in Account account, int userId); 70 Account[] getSharedAccountsAsUser(int userId); 71 boolean removeSharedAccountAsUser(in Account account, int userId); 72 73 /* Account renaming. */ 74 void renameAccount(in IAccountManagerResponse response, in Account accountToRename, String newName); 75 String getPreviousName(in Account account); 76 boolean renameSharedAccountAsUser(in Account accountToRename, String newName, int userId); 77 78 } 79