• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 <cstdint>
20 #include <string>
21 #include <iremote_broker.h>
22 #include "accountmgr_service_ipc_interface_code.h"
23 #include "account_info.h"
24 #include "device_account_info.h"
25 
26 namespace OHOS {
27 namespace AccountSA {
28 const std::string ACCOUNT_SERVICE_NAME = "AccountService";
29 
30 class IAccount : public IRemoteBroker {
31 public:
32     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.accountfwk.IAccount");
33 
34     virtual bool UpdateOhosAccountInfo(
35         const std::string &accountName, const std::string &uid, const std::string &eventStr) = 0;
36     virtual std::int32_t SetOhosAccountInfo(const OhosAccountInfo &ohosAccountInfo,
37         const std::string &eventStr) = 0;
38     virtual std::int32_t SetOhosAccountInfoByUserId(
39         const int32_t userId, const OhosAccountInfo &ohosAccountInfo, const std::string &eventStr) = 0;
40     virtual std::pair<bool, OhosAccountInfo> QueryOhosAccountInfo(void) = 0;
41     virtual std::pair<bool, OhosAccountInfo> QueryOhosAccountInfoByUserId(std::int32_t userId) = 0;
42     virtual ErrCode GetOhosAccountInfo(OhosAccountInfo &accountInfo) = 0;
43     virtual ErrCode GetOhosAccountInfoByUserId(int32_t userId, OhosAccountInfo &info) = 0;
44     virtual std::int32_t QueryDeviceAccountId(std::int32_t &accountId) = 0;
45     virtual sptr<IRemoteObject> GetAppAccountService() = 0;
46     virtual sptr<IRemoteObject> GetOsAccountService() = 0;
47     virtual sptr<IRemoteObject> GetAccountIAMService() = 0;
48     virtual sptr<IRemoteObject> GetDomainAccountService() = 0;
49 };
50 }  // namespace AccountSA
51 }  // namespace OHOS
52 
53 #endif  // BASE_ACCOUNT_IACCOUNT_H
54