• 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 <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_DEVICE_ACCOUNT_ID = 104,
37         GET_APP_ACCOUNT_SERVICE = 105,
38         GET_OS_ACCOUNT_SERVICE = 106,
39     };
40 
41     virtual bool UpdateOhosAccountInfo(
42         const std::string &accountName, const std::string &uid, const std::string &eventStr) = 0;
43     virtual std::pair<bool, OhosAccountInfo> QueryOhosAccountInfo(void) = 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 };
48 }  // namespace AccountSA
49 }  // namespace OHOS
50 
51 #endif  // BASE_ACCOUNT_IACCOUNT_H
52