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 #ifndef BASE_LOCATION_MOCK_SERVICE_REGISTRY_H
16 #define BASE_LOCATION_MOCK_SERVICE_REGISTRY_H
17 
18 #include "iservice_registry.h"
19 #include "system_ability_definition.h"
20 #include "system_ability_manager_proxy.h"
21 
22 #include "location_log.h"
23 
24 namespace OHOS {
GetInstance()25 SystemAbilityManagerClient& SystemAbilityManagerClient::GetInstance()
26 {
27     LBSLOGI(Location::LOCATOR, "%{public}s return instance", __func__);
28     static auto instance = new SystemAbilityManagerClient();
29     return *instance;
30 }
31 
GetSystemAbilityManager()32 sptr<ISystemAbilityManager> SystemAbilityManagerClient::GetSystemAbilityManager()
33 {
34     LBSLOGI(Location::LOCATOR, "%{public}s return nullptr", __func__);
35     return nullptr;
36 }
37 
GetSystemAbility(int32_t systemAbilityId)38 sptr<IRemoteObject> SystemAbilityManagerProxy::GetSystemAbility(int32_t systemAbilityId)
39 {
40     LBSLOGI(Location::LOCATOR, "%{public}s return nullptr", __func__);
41     return nullptr;
42 }
43 
GetSystemAbility(int32_t systemAbilityId,const std::string & deviceId)44 sptr<IRemoteObject> SystemAbilityManagerProxy::GetSystemAbility(int32_t systemAbilityId,
45     const std::string& deviceId)
46 {
47     LBSLOGI(Location::LOCATOR, "%{public}s return nullptr", __func__);
48     return GetSystemAbility(systemAbilityId);
49 }
50 
CheckSystemAbilityWrapper(int32_t code,MessageParcel & data)51 sptr<IRemoteObject> SystemAbilityManagerProxy::CheckSystemAbilityWrapper(int32_t code, MessageParcel& data)
52 {
53     LBSLOGI(Location::LOCATOR, "%{public}s return nullptr", __func__);
54     return nullptr;
55 }
56 
CheckSystemAbility(int32_t systemAbilityId)57 sptr<IRemoteObject> SystemAbilityManagerProxy::CheckSystemAbility(int32_t systemAbilityId)
58 {
59     LBSLOGI(Location::LOCATOR, "%{public}s return nullptr", __func__);
60     return GetSystemAbility(systemAbilityId);
61 }
62 
CheckSystemAbility(int32_t systemAbilityId,const std::string & deviceId)63 sptr<IRemoteObject> SystemAbilityManagerProxy::CheckSystemAbility(int32_t systemAbilityId, const std::string& deviceId)
64 {
65     LBSLOGI(Location::LOCATOR, "%{public}s return nullptr", __func__);
66     return GetSystemAbility(systemAbilityId);
67 }
68 
CheckSystemAbility(int32_t systemAbilityId,bool & isExist)69 sptr<IRemoteObject> SystemAbilityManagerProxy::CheckSystemAbility(int32_t systemAbilityId, bool& isExist)
70 {
71     LBSLOGI(Location::LOCATOR, "%{public}s return nullptr", __func__);
72     return GetSystemAbility(systemAbilityId);
73 }
74 
AddOnDemandSystemAbilityInfo(int32_t systemAbilityId,const std::u16string & localAbilityManagerName)75 int32_t SystemAbilityManagerProxy::AddOnDemandSystemAbilityInfo(int32_t systemAbilityId,
76     const std::u16string& localAbilityManagerName)
77 {
78     LBSLOGI(Location::LOCATOR, "%{public}s return ERR_OK", __func__);
79     return ERR_OK;
80 }
81 
RemoveSystemAbilityWrapper(int32_t code,MessageParcel & data)82 int32_t SystemAbilityManagerProxy::RemoveSystemAbilityWrapper(int32_t code, MessageParcel& data)
83 {
84     LBSLOGI(Location::LOCATOR, "%{public}s return ERR_OK", __func__);
85     return ERR_OK;
86 }
87 
RemoveSystemAbility(int32_t systemAbilityId)88 int32_t SystemAbilityManagerProxy::RemoveSystemAbility(int32_t systemAbilityId)
89 {
90     LBSLOGI(Location::LOCATOR, "%{public}s return ERR_OK", __func__);
91     return ERR_OK;
92 }
93 
ListSystemAbilities(unsigned int dumpFlags)94 std::vector<std::u16string> SystemAbilityManagerProxy::ListSystemAbilities(unsigned int dumpFlags)
95 {
96     LBSLOGI(Location::LOCATOR, "%{public}s return empty vector", __func__);
97     std::vector<std::u16string> saNames;
98     return saNames;
99 }
100 
SubscribeSystemAbility(int32_t systemAbilityId,const sptr<ISystemAbilityStatusChange> & listener)101 int32_t SystemAbilityManagerProxy::SubscribeSystemAbility(int32_t systemAbilityId,
102     const sptr<ISystemAbilityStatusChange>& listener)
103 {
104     LBSLOGI(Location::LOCATOR, "%{public}s return ERR_OK", __func__);
105     return ERR_OK;
106 }
107 
UnSubscribeSystemAbility(int32_t systemAbilityId,const sptr<ISystemAbilityStatusChange> & listener)108 int32_t SystemAbilityManagerProxy::UnSubscribeSystemAbility(int32_t systemAbilityId,
109     const sptr<ISystemAbilityStatusChange>& listener)
110 {
111     LBSLOGI(Location::LOCATOR, "%{public}s return ERR_OK", __func__);
112     return ERR_OK;
113 }
114 
LoadSystemAbility(int32_t systemAbilityId,const sptr<ISystemAbilityLoadCallback> & callback)115 int32_t SystemAbilityManagerProxy::LoadSystemAbility(int32_t systemAbilityId,
116     const sptr<ISystemAbilityLoadCallback>& callback)
117 {
118     LBSLOGI(Location::LOCATOR, "%{public}s return ERR_OK", __func__);
119     return ERR_OK;
120 }
121 
UnloadSystemAbility(int32_t systemAbilityId)122 int32_t SystemAbilityManagerProxy::UnloadSystemAbility(int32_t systemAbilityId)
123 {
124     LBSLOGI(Location::LOCATOR, "%{public}s return ERR_OK", __func__);
125     return ERR_OK;
126 }
127 
CancelUnloadSystemAbility(int32_t systemAbilityId)128 int32_t SystemAbilityManagerProxy::CancelUnloadSystemAbility(int32_t systemAbilityId)
129 {
130     LBSLOGI(Location::LOCATOR, "%{public}s return ERR_OK", __func__);
131     return ERR_OK;
132 }
133 
LoadSystemAbility(int32_t systemAbilityId,const std::string & deviceId,const sptr<ISystemAbilityLoadCallback> & callback)134 int32_t SystemAbilityManagerProxy::LoadSystemAbility(int32_t systemAbilityId, const std::string& deviceId,
135     const sptr<ISystemAbilityLoadCallback>& callback)
136 {
137     LBSLOGI(Location::LOCATOR, "%{public}s return ERR_OK", __func__);
138     return ERR_OK;
139 }
140 
GetRunningSystemProcess(std::list<SystemProcessInfo> & systemProcessInfos)141 int32_t SystemAbilityManagerProxy::GetRunningSystemProcess(std::list<SystemProcessInfo>& systemProcessInfos)
142 {
143     LBSLOGI(Location::LOCATOR, "%{public}s return ERR_OK", __func__);
144     return ERR_OK;
145 }
146 
SubscribeSystemProcess(const sptr<ISystemProcessStatusChange> & listener)147 int32_t SystemAbilityManagerProxy::SubscribeSystemProcess(const sptr<ISystemProcessStatusChange>& listener)
148 {
149     LBSLOGI(Location::LOCATOR, "%{public}s return ERR_OK", __func__);
150     return ERR_OK;
151 }
152 
UnSubscribeSystemProcess(const sptr<ISystemProcessStatusChange> & listener)153 int32_t SystemAbilityManagerProxy::UnSubscribeSystemProcess(const sptr<ISystemProcessStatusChange>& listener)
154 {
155     LBSLOGI(Location::LOCATOR, "%{public}s return ERR_OK", __func__);
156     return ERR_OK;
157 }
158 
AddSystemAbility(int32_t systemAbilityId,const sptr<IRemoteObject> & ability,const SAExtraProp & extraProp)159 int32_t SystemAbilityManagerProxy::AddSystemAbility(int32_t systemAbilityId, const sptr<IRemoteObject>& ability,
160     const SAExtraProp& extraProp)
161 {
162     LBSLOGI(Location::LOCATOR, "%{public}s return ERR_OK", __func__);
163     return ERR_OK;
164 }
165 
AddSystemAbilityWrapper(int32_t code,MessageParcel & data)166 int32_t SystemAbilityManagerProxy::AddSystemAbilityWrapper(int32_t code, MessageParcel& data)
167 {
168     LBSLOGI(Location::LOCATOR, "%{public}s return ERR_OK", __func__);
169     return ERR_OK;
170 }
171 
AddSystemProcess(const std::u16string & procName,const sptr<IRemoteObject> & procObject)172 int32_t SystemAbilityManagerProxy::AddSystemProcess(
173     const std::u16string& procName, const sptr<IRemoteObject>& procObject)
174 {
175     LBSLOGI(Location::LOCATOR, "%{public}s return ERR_OK", __func__);
176     return ERR_OK;
177 }
178 
GetOnDemandSystemAbilityIds(std::vector<int32_t> & systemAbilityIds)179 int32_t SystemAbilityManagerProxy::GetOnDemandSystemAbilityIds(std::vector<int32_t>& systemAbilityIds)
180 {
181     LBSLOGI(Location::LOCATOR, "%{public}s return ERR_OK", __func__);
182     return ERR_OK;
183 }
184 
Recompute(int32_t systemAbilityId,int32_t code)185 sptr<IRemoteObject> SystemAbilityManagerProxy::Recompute(int32_t systemAbilityId, int32_t code)
186 {
187     LBSLOGI(Location::LOCATOR, "%{public}s return nullptr", __func__);
188     return nullptr;
189 }
190 } // namespace OHOS
191 #endif