1 /* 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef BASE_ACCOUNT_IACCOUNT_H 17 #define BASE_ACCOUNT_IACCOUNT_H 18 19 #include <string> 20 #include <stdint.h> 21 #include <iremote_broker.h> 22 #include "account_info.h" 23 #include "device_account_info.h" 24 25 namespace OHOS { 26 namespace AccountSA { 27 const std::string ACCOUNT_SERVICE_NAME = "AccountService"; 28 29 class IAccount : public IRemoteBroker { 30 public: 31 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.accountfwk.IAccount"); 32 enum { 33 UPDATE_OHOS_ACCOUNT_INFO = 1, 34 QUERY_OHOS_ACCOUNT_INFO = 2, 35 QUERY_OHOS_ACCOUNT_QUIT_TIPS = 3, 36 QUERY_OHOS_ACCOUNT_INFO_BY_USER_ID = 4, 37 SET_OHOS_ACCOUNT_INFO = 5, 38 GET_OHOS_ACCOUNT_INFO = 6, 39 GET_OHOS_ACCOUNT_INFO_BY_USER_ID = 7, 40 QUERY_DEVICE_ACCOUNT_ID = 104, 41 GET_APP_ACCOUNT_SERVICE = 105, 42 GET_OS_ACCOUNT_SERVICE = 106, 43 GET_ACCOUNT_IAM_SERVICE = 107, 44 GET_DOMAIN_ACCOUNT_SERVICE = 108, 45 }; 46 47 virtual bool UpdateOhosAccountInfo( 48 const std::string &accountName, const std::string &uid, const std::string &eventStr) = 0; 49 virtual std::int32_t SetOhosAccountInfo(const OhosAccountInfo &ohosAccountInfo, 50 const std::string &eventStr) = 0; 51 virtual std::pair<bool, OhosAccountInfo> QueryOhosAccountInfo(void) = 0; 52 virtual std::pair<bool, OhosAccountInfo> QueryOhosAccountInfoByUserId(std::int32_t userId) = 0; 53 virtual ErrCode GetOhosAccountInfo(OhosAccountInfo &accountInfo) = 0; 54 virtual ErrCode GetOhosAccountInfoByUserId(int32_t userId, OhosAccountInfo &info) = 0; 55 virtual std::int32_t QueryDeviceAccountId(std::int32_t &accountId) = 0; 56 virtual sptr<IRemoteObject> GetAppAccountService() = 0; 57 virtual sptr<IRemoteObject> GetOsAccountService() = 0; 58 virtual sptr<IRemoteObject> GetAccountIAMService() = 0; 59 virtual sptr<IRemoteObject> GetDomainAccountService() = 0; 60 }; 61 } // namespace AccountSA 62 } // namespace OHOS 63 64 #endif // BASE_ACCOUNT_IACCOUNT_H 65