1 /*
2  * Copyright (C) 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 #include "accessibility_mt_helper.h"
17 #include "os_account_manager.h"
18 #include "ffrt.h"
19 
20 namespace OHOS {
21 namespace AccountSA {
22 const int32_t accountId = 100;
23 
QueryActiveOsAccountIds(std::vector<int32_t> & accountIds)24 ErrCode OsAccountManager::QueryActiveOsAccountIds(std::vector<int32_t>& accountIds)
25 {
26     accountIds.push_back(accountId);
27     return ERR_OK;
28 }
29 
SubscribeOsAccount(const std::shared_ptr<OsAccountSubscriber> & subscriberAccount)30 ErrCode OsAccountManager::SubscribeOsAccount(const std::shared_ptr<OsAccountSubscriber>& subscriberAccount)
31 {
32     (void)subscriberAccount;
33     return ERR_OK;
34 }
35 
OsAccountSubscriber()36 OsAccountSubscriber::OsAccountSubscriber()
37 {
38 }
39 
OsAccountSubscriber(const OsAccountSubscribeInfo & subscribeInfo)40 OsAccountSubscriber::OsAccountSubscriber(const OsAccountSubscribeInfo &subscribeInfo) : subscribeInfo_(subscribeInfo)
41 {
42 }
43 
~OsAccountSubscriber()44 OsAccountSubscriber::~OsAccountSubscriber()
45 {
46 }
47 
GetSubscribeInfo(OsAccountSubscribeInfo & info) const48 void OsAccountSubscriber::GetSubscribeInfo(OsAccountSubscribeInfo &info) const
49 {
50     info = subscribeInfo_;
51 }
52 
OsAccountSubscribeInfo()53 OsAccountSubscribeInfo::OsAccountSubscribeInfo()
54     : osAccountSubscribeType_(ACTIVATING), name_("")
55 {}
56 
OsAccountSubscribeInfo(const OS_ACCOUNT_SUBSCRIBE_TYPE & osAccountSubscribeType,const std::string & name)57 OsAccountSubscribeInfo::OsAccountSubscribeInfo(const OS_ACCOUNT_SUBSCRIBE_TYPE &osAccountSubscribeType,
58     const std::string &name) : osAccountSubscribeType_(osAccountSubscribeType), name_(name)
59 {
60     (void)osAccountSubscribeType;
61 }
62 
~OsAccountSubscribeInfo()63 OsAccountSubscribeInfo::~OsAccountSubscribeInfo()
64 {}
65 
GetOsAccountSubscribeType(OS_ACCOUNT_SUBSCRIBE_TYPE & subscribetype) const66 void OsAccountSubscribeInfo::GetOsAccountSubscribeType(OS_ACCOUNT_SUBSCRIBE_TYPE &subscribetype) const
67 {
68     subscribetype = osAccountSubscribeType_;
69 }
70 
SetOsAccountSubscribeType(const OS_ACCOUNT_SUBSCRIBE_TYPE & subscribetype)71 void OsAccountSubscribeInfo::SetOsAccountSubscribeType(const OS_ACCOUNT_SUBSCRIBE_TYPE &subscribetype)
72 {
73     osAccountSubscribeType_ = subscribetype;
74 }
75 
GetName(std::string & subscribeName) const76 void OsAccountSubscribeInfo::GetName(std::string &subscribeName) const
77 {
78     subscribeName = name_;
79 }
80 
SetName(const std::string & subscribeName)81 void OsAccountSubscribeInfo::SetName(const std::string &subscribeName)
82 {
83     name_ = subscribeName;
84 }
85 
Marshalling(Parcel & parcel) const86 bool OsAccountSubscribeInfo::Marshalling(Parcel &parcel) const
87 {
88     (void)parcel;
89     return false;
90 }
91 
Unmarshalling(Parcel & parcel)92 OsAccountSubscribeInfo *OsAccountSubscribeInfo::Unmarshalling(Parcel &parcel)
93 {
94     (void)parcel;
95     return nullptr;
96 }
97 
ReadFromParcel(Parcel & parcel)98 bool OsAccountSubscribeInfo::ReadFromParcel(Parcel &parcel)
99 {
100     (void)parcel;
101     return false;
102 }
103 } // AccountSA
104 } // OHOS