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_ut_helper.h" 17 #include "os_account_manager.h" 18 19 namespace OHOS { 20 namespace AccountSA { 21 const int32_t accountId = 100; 22 QueryActiveOsAccountIds(std::vector<int32_t> & ids)23ErrCode OsAccountManager::QueryActiveOsAccountIds(std::vector<int32_t>& ids) 24 { 25 ids.push_back(accountId); 26 return ERR_OK; 27 } 28 SubscribeOsAccount(const std::shared_ptr<OsAccountSubscriber> & subscriber)29ErrCode OsAccountManager::SubscribeOsAccount(const std::shared_ptr<OsAccountSubscriber> &subscriber) 30 { 31 (void)subscriber; 32 return ERR_OK; 33 } 34 OsAccountSubscriber()35OsAccountSubscriber::OsAccountSubscriber() 36 {} 37 OsAccountSubscriber(const OsAccountSubscribeInfo & subscribeInfo)38OsAccountSubscriber::OsAccountSubscriber(const OsAccountSubscribeInfo &subscribeInfo) : subscribeInfo_(subscribeInfo) 39 {} 40 ~OsAccountSubscriber()41OsAccountSubscriber::~OsAccountSubscriber() 42 {} 43 GetSubscribeInfo(OsAccountSubscribeInfo & subscribeInfo) const44void OsAccountSubscriber::GetSubscribeInfo(OsAccountSubscribeInfo &subscribeInfo) const 45 { 46 subscribeInfo = subscribeInfo_; 47 } 48 OsAccountSubscribeInfo()49OsAccountSubscribeInfo::OsAccountSubscribeInfo() 50 : osAccountSubscribeType_(ACTIVATING), name_("") 51 {} 52 OsAccountSubscribeInfo(const OS_ACCOUNT_SUBSCRIBE_TYPE & osAccountSubscribeType,const std::string & name)53OsAccountSubscribeInfo::OsAccountSubscribeInfo(const OS_ACCOUNT_SUBSCRIBE_TYPE &osAccountSubscribeType, 54 const std::string &name) : osAccountSubscribeType_(osAccountSubscribeType), name_(name) 55 {} 56 ~OsAccountSubscribeInfo()57OsAccountSubscribeInfo::~OsAccountSubscribeInfo() 58 {} 59 GetOsAccountSubscribeType(OS_ACCOUNT_SUBSCRIBE_TYPE & osAccountSubscribeType) const60void OsAccountSubscribeInfo::GetOsAccountSubscribeType(OS_ACCOUNT_SUBSCRIBE_TYPE &osAccountSubscribeType) const 61 { 62 osAccountSubscribeType = osAccountSubscribeType_; 63 } 64 SetOsAccountSubscribeType(const OS_ACCOUNT_SUBSCRIBE_TYPE & osAccountSubscribeType)65void OsAccountSubscribeInfo::SetOsAccountSubscribeType(const OS_ACCOUNT_SUBSCRIBE_TYPE &osAccountSubscribeType) 66 { 67 osAccountSubscribeType_ = osAccountSubscribeType; 68 } 69 GetName(std::string & name) const70void OsAccountSubscribeInfo::GetName(std::string &name) const 71 { 72 name = name_; 73 } 74 SetName(const std::string & name)75void OsAccountSubscribeInfo::SetName(const std::string &name) 76 { 77 name_ = name; 78 } 79 Marshalling(Parcel & parcel) const80bool OsAccountSubscribeInfo::Marshalling(Parcel &parcel) const 81 { 82 return false; 83 } 84 Unmarshalling(Parcel & parcel)85OsAccountSubscribeInfo *OsAccountSubscribeInfo::Unmarshalling(Parcel &parcel) 86 { 87 return nullptr; 88 } 89 ReadFromParcel(Parcel & parcel)90bool OsAccountSubscribeInfo::ReadFromParcel(Parcel &parcel) 91 { 92 return false; 93 } 94 } // AccountSA 95 } // OHOS