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 #include "locator_impl.h"
16 #include "common_utils.h"
17 #include "location_log.h"
18 #include "system_ability_definition.h"
19 #include "country_code.h"
20
21 namespace OHOS {
22 namespace Location {
LocatorImpl()23 LocatorImpl::LocatorImpl()
24 {}
25
~LocatorImpl()26 LocatorImpl::~LocatorImpl()
27 {}
28
Init()29 bool LocatorImpl::Init()
30 {
31 client_ = std::make_unique<LocatorProxy>(CommonUtils::GetRemoteObject(LOCATION_LOCATOR_SA_ID,
32 CommonUtils::InitDeviceId()));
33 if (client_ == nullptr) {
34 LBSLOGE(LOCATOR_STANDARD, "locator init failed.");
35 return false;
36 }
37 return true;
38 }
39
IsLocationEnabled()40 bool LocatorImpl::IsLocationEnabled()
41 {
42 return client_->GetSwitchState() == 1;
43 }
44
ShowNotification()45 void LocatorImpl::ShowNotification()
46 {
47 LBSLOGI(LOCATION_NAPI, "ShowNotification");
48 }
49
RequestPermission()50 void LocatorImpl::RequestPermission()
51 {
52 LBSLOGI(LOCATION_NAPI, "permission need to be granted");
53 }
54
RequestEnableLocation()55 void LocatorImpl::RequestEnableLocation()
56 {
57 LBSLOGI(LOCATION_NAPI, "RequestEnableLocation");
58 }
59
EnableAbility(bool enable)60 void LocatorImpl::EnableAbility(bool enable)
61 {
62 client_->EnableAbility(enable);
63 }
64
StartLocating(std::unique_ptr<RequestConfig> & requestConfig,sptr<ILocatorCallback> & callback)65 void LocatorImpl::StartLocating(std::unique_ptr<RequestConfig>& requestConfig,
66 sptr<ILocatorCallback>& callback)
67 {
68 client_->StartLocating(requestConfig, callback, "location.ILocator", 0, 0);
69 }
70
StopLocating(sptr<ILocatorCallback> & callback)71 void LocatorImpl::StopLocating(sptr<ILocatorCallback>& callback)
72 {
73 client_->StopLocating(callback);
74 }
75
GetCachedLocation()76 std::unique_ptr<Location> LocatorImpl::GetCachedLocation()
77 {
78 std::unique_ptr<Location> location = nullptr;
79 MessageParcel reply;
80 client_->GetCacheLocation(reply);
81 int exception = reply.ReadInt32();
82 if (exception == ERRCODE_PERMISSION_DENIED) {
83 LBSLOGE(LOCATOR_STANDARD, "can not get cached location without location permission.");
84 } else if (exception != ERRCODE_SUCCESS) {
85 LBSLOGE(LOCATOR_STANDARD, "cause some exception happened in lower service.");
86 } else {
87 location = Location::Unmarshalling(reply);
88 }
89
90 return location;
91 }
92
RegisterSwitchCallback(const sptr<IRemoteObject> & callback,pid_t uid)93 bool LocatorImpl::RegisterSwitchCallback(const sptr<IRemoteObject>& callback, pid_t uid)
94 {
95 client_->RegisterSwitchCallback(callback, DEFAULT_UID);
96 return true;
97 }
98
UnregisterSwitchCallback(const sptr<IRemoteObject> & callback)99 bool LocatorImpl::UnregisterSwitchCallback(const sptr<IRemoteObject>& callback)
100 {
101 client_->UnregisterSwitchCallback(callback);
102 return true;
103 }
104
RegisterGnssStatusCallback(const sptr<IRemoteObject> & callback,pid_t uid)105 bool LocatorImpl::RegisterGnssStatusCallback(const sptr<IRemoteObject>& callback, pid_t uid)
106 {
107 client_->RegisterGnssStatusCallback(callback, DEFAULT_UID);
108 return true;
109 }
110
UnregisterGnssStatusCallback(const sptr<IRemoteObject> & callback)111 bool LocatorImpl::UnregisterGnssStatusCallback(const sptr<IRemoteObject>& callback)
112 {
113 client_->UnregisterGnssStatusCallback(callback);
114 return true;
115 }
116
RegisterNmeaMessageCallback(const sptr<IRemoteObject> & callback,pid_t uid)117 bool LocatorImpl::RegisterNmeaMessageCallback(const sptr<IRemoteObject>& callback, pid_t uid)
118 {
119 client_->RegisterNmeaMessageCallback(callback, DEFAULT_UID);
120 return true;
121 }
122
UnregisterNmeaMessageCallback(const sptr<IRemoteObject> & callback)123 bool LocatorImpl::UnregisterNmeaMessageCallback(const sptr<IRemoteObject>& callback)
124 {
125 client_->UnregisterNmeaMessageCallback(callback);
126 return true;
127 }
128
RegisterCountryCodeCallback(const sptr<IRemoteObject> & callback,pid_t uid)129 bool LocatorImpl::RegisterCountryCodeCallback(const sptr<IRemoteObject>& callback, pid_t uid)
130 {
131 client_->RegisterCountryCodeCallback(callback, uid);
132 return true;
133 }
134
UnregisterCountryCodeCallback(const sptr<IRemoteObject> & callback)135 bool LocatorImpl::UnregisterCountryCodeCallback(const sptr<IRemoteObject>& callback)
136 {
137 client_->UnregisterCountryCodeCallback(callback);
138 return true;
139 }
140
RegisterCachedLocationCallback(std::unique_ptr<CachedGnssLocationsRequest> & request,sptr<ICachedLocationsCallback> & callback)141 void LocatorImpl::RegisterCachedLocationCallback(std::unique_ptr<CachedGnssLocationsRequest>& request,
142 sptr<ICachedLocationsCallback>& callback)
143 {
144 client_->RegisterCachedLocationCallback(request, callback, "location.ILocator");
145 }
146
UnregisterCachedLocationCallback(sptr<ICachedLocationsCallback> & callback)147 void LocatorImpl::UnregisterCachedLocationCallback(sptr<ICachedLocationsCallback>& callback)
148 {
149 client_->UnregisterCachedLocationCallback(callback);
150 }
151
IsGeoServiceAvailable()152 bool LocatorImpl::IsGeoServiceAvailable()
153 {
154 bool result = false;
155 MessageParcel reply;
156 client_->IsGeoConvertAvailable(reply);
157 int exception = reply.ReadInt32();
158 if (exception == ERRCODE_PERMISSION_DENIED) {
159 LBSLOGE(LOCATOR_STANDARD, "can not get cached location without location permission.");
160 } else if (exception != ERRCODE_SUCCESS) {
161 LBSLOGE(LOCATOR_STANDARD, "cause some exception happened in lower service.");
162 } else {
163 result = reply.ReadBool();
164 }
165 return result;
166 }
167
GetAddressByCoordinate(MessageParcel & data,std::list<std::shared_ptr<GeoAddress>> & replyList)168 void LocatorImpl::GetAddressByCoordinate(MessageParcel &data, std::list<std::shared_ptr<GeoAddress>>& replyList)
169 {
170 MessageParcel reply;
171 client_->GetAddressByCoordinate(data, reply);
172 int exception = reply.ReadInt32();
173 if (exception == ERRCODE_PERMISSION_DENIED) {
174 LBSLOGE(LOCATOR_STANDARD, "can not get cached location without location permission.");
175 } else if (exception != ERRCODE_SUCCESS) {
176 LBSLOGE(LOCATOR_STANDARD, "cause some exception happened in lower service.");
177 } else {
178 int resultSize = reply.ReadInt32();
179 if (resultSize > GeoAddress::MAX_RESULT) {
180 resultSize = GeoAddress::MAX_RESULT;
181 }
182 for (int i = 0; i < resultSize; i++) {
183 replyList.push_back(GeoAddress::Unmarshalling(reply));
184 }
185 }
186 }
187
GetAddressByLocationName(MessageParcel & data,std::list<std::shared_ptr<GeoAddress>> & replyList)188 void LocatorImpl::GetAddressByLocationName(MessageParcel &data, std::list<std::shared_ptr<GeoAddress>>& replyList)
189 {
190 MessageParcel reply;
191 client_->GetAddressByLocationName(data, reply);
192 int exception = reply.ReadInt32();
193 if (exception == ERRCODE_PERMISSION_DENIED) {
194 LBSLOGE(LOCATOR_STANDARD, "can not get cached location without location permission.");
195 } else if (exception != ERRCODE_SUCCESS) {
196 LBSLOGE(LOCATOR_STANDARD, "cause some exception happened in lower service.");
197 } else {
198 int resultSize = reply.ReadInt32();
199 if (resultSize > GeoAddress::MAX_RESULT) {
200 resultSize = GeoAddress::MAX_RESULT;
201 }
202 for (int i = 0; i < resultSize; i++) {
203 replyList.push_back(GeoAddress::Unmarshalling(reply));
204 }
205 }
206 }
207
IsLocationPrivacyConfirmed(const int type)208 bool LocatorImpl::IsLocationPrivacyConfirmed(const int type)
209 {
210 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::IsLocationPrivacyConfirmed()");
211 return client_->IsLocationPrivacyConfirmed(type);
212 }
213
SetLocationPrivacyConfirmStatus(const int type,bool isConfirmed)214 int LocatorImpl::SetLocationPrivacyConfirmStatus(const int type, bool isConfirmed)
215 {
216 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::SetLocationPrivacyConfirmStatus()");
217 return client_->SetLocationPrivacyConfirmStatus(type, isConfirmed);
218 }
219
GetCachedGnssLocationsSize()220 int LocatorImpl::GetCachedGnssLocationsSize()
221 {
222 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::GetCachedGnssLocationsSize()");
223 return client_->GetCachedGnssLocationsSize();
224 }
225
FlushCachedGnssLocations()226 int LocatorImpl::FlushCachedGnssLocations()
227 {
228 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::FlushCachedGnssLocations()");
229 return client_->FlushCachedGnssLocations();
230 }
231
SendCommand(std::unique_ptr<LocationCommand> & commands)232 bool LocatorImpl::SendCommand(std::unique_ptr<LocationCommand>& commands)
233 {
234 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::SendCommand()");
235 client_->SendCommand(commands);
236 return true;
237 }
238
AddFence(std::unique_ptr<GeofenceRequest> & request)239 bool LocatorImpl::AddFence(std::unique_ptr<GeofenceRequest>& request)
240 {
241 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::AddFence()");
242 client_->AddFence(request);
243 return true;
244 }
245
RemoveFence(std::unique_ptr<GeofenceRequest> & request)246 bool LocatorImpl::RemoveFence(std::unique_ptr<GeofenceRequest>& request)
247 {
248 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::RemoveFence()");
249 client_->RemoveFence(request);
250 return true;
251 }
252
GetIsoCountryCode()253 std::shared_ptr<CountryCode> LocatorImpl::GetIsoCountryCode()
254
255 {
256 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::GetIsoCountryCode()");
257 return client_->GetIsoCountryCode();
258 }
259
EnableLocationMock()260 bool LocatorImpl::EnableLocationMock()
261 {
262 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::EnableLocationMock()");
263 return client_->EnableLocationMock();
264 }
265
DisableLocationMock()266 bool LocatorImpl::DisableLocationMock()
267 {
268 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::DisableLocationMock()");
269 return client_->DisableLocationMock();
270 }
271
SetMockedLocations(const int timeInterval,const std::vector<std::shared_ptr<Location>> & location)272 bool LocatorImpl::SetMockedLocations(
273 const int timeInterval, const std::vector<std::shared_ptr<Location>> &location)
274 {
275 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::SetMockedLocations()");
276 return client_->SetMockedLocations(timeInterval, location);
277 }
278
EnableReverseGeocodingMock()279 bool LocatorImpl::EnableReverseGeocodingMock()
280 {
281 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::EnableReverseGeocodingMock()");
282 return client_->EnableReverseGeocodingMock();
283 }
284
DisableReverseGeocodingMock()285 bool LocatorImpl::DisableReverseGeocodingMock()
286 {
287 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::DisableReverseGeocodingMock()");
288 return client_->DisableReverseGeocodingMock();
289 }
290
SetReverseGeocodingMockInfo(std::vector<std::shared_ptr<GeocodingMockInfo>> & mockInfo)291 bool LocatorImpl::SetReverseGeocodingMockInfo(std::vector<std::shared_ptr<GeocodingMockInfo>>& mockInfo)
292 {
293 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::SetReverseGeocodingMockInfo()");
294 return client_->SetReverseGeocodingMockInfo(mockInfo);
295 }
296
ProxyUidForFreeze(int32_t uid,bool isProxy)297 bool LocatorImpl::ProxyUidForFreeze(int32_t uid, bool isProxy)
298 {
299 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::ProxyUid()");
300 return client_->ProxyUidForFreeze(uid, isProxy);
301 }
302
ResetAllProxy()303 bool LocatorImpl::ResetAllProxy()
304 {
305 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::ResetAllProxy()");
306 return client_->ResetAllProxy();
307 }
308
IsLocationEnabledV9(bool & isEnabled)309 LocationErrCode LocatorImpl::IsLocationEnabledV9(bool &isEnabled)
310 {
311 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::IsLocationEnabledV9()");
312 return client_->GetSwitchStateV9(isEnabled);
313 }
314
EnableAbilityV9(bool enable)315 LocationErrCode LocatorImpl::EnableAbilityV9(bool enable)
316 {
317 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::EnableAbilityV9()");
318 return client_->EnableAbilityV9(enable);
319 }
320
StartLocatingV9(std::unique_ptr<RequestConfig> & requestConfig,sptr<ILocatorCallback> & callback)321 LocationErrCode LocatorImpl::StartLocatingV9(std::unique_ptr<RequestConfig>& requestConfig,
322 sptr<ILocatorCallback>& callback)
323 {
324 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::StartLocatingV9()");
325 return client_->StartLocatingV9(requestConfig, callback);
326 }
327
StopLocatingV9(sptr<ILocatorCallback> & callback)328 LocationErrCode LocatorImpl::StopLocatingV9(sptr<ILocatorCallback>& callback)
329 {
330 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::StopLocatingV9()");
331 return client_->StopLocatingV9(callback);
332 }
333
GetCachedLocationV9(std::unique_ptr<Location> & loc)334 LocationErrCode LocatorImpl::GetCachedLocationV9(std::unique_ptr<Location> &loc)
335 {
336 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::GetCachedLocationV9()");
337 return client_->GetCacheLocationV9(loc);
338 }
339
RegisterSwitchCallbackV9(const sptr<IRemoteObject> & callback)340 LocationErrCode LocatorImpl::RegisterSwitchCallbackV9(const sptr<IRemoteObject>& callback)
341 {
342 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::RegisterSwitchCallbackV9()");
343 return client_->RegisterSwitchCallbackV9(callback);
344 }
345
UnregisterSwitchCallbackV9(const sptr<IRemoteObject> & callback)346 LocationErrCode LocatorImpl::UnregisterSwitchCallbackV9(const sptr<IRemoteObject>& callback)
347 {
348 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::UnregisterSwitchCallbackV9()");
349 return client_->UnregisterSwitchCallbackV9(callback);
350 }
351
RegisterGnssStatusCallbackV9(const sptr<IRemoteObject> & callback)352 LocationErrCode LocatorImpl::RegisterGnssStatusCallbackV9(const sptr<IRemoteObject>& callback)
353 {
354 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::RegisterGnssStatusCallbackV9()");
355 return client_->RegisterGnssStatusCallbackV9(callback);
356 }
357
UnregisterGnssStatusCallbackV9(const sptr<IRemoteObject> & callback)358 LocationErrCode LocatorImpl::UnregisterGnssStatusCallbackV9(const sptr<IRemoteObject>& callback)
359 {
360 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::UnregisterGnssStatusCallbackV9()");
361 return client_->UnregisterGnssStatusCallbackV9(callback);
362 }
363
RegisterNmeaMessageCallbackV9(const sptr<IRemoteObject> & callback)364 LocationErrCode LocatorImpl::RegisterNmeaMessageCallbackV9(const sptr<IRemoteObject>& callback)
365 {
366 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::RegisterNmeaMessageCallbackV9()");
367 return client_->RegisterNmeaMessageCallbackV9(callback);
368 }
369
UnregisterNmeaMessageCallbackV9(const sptr<IRemoteObject> & callback)370 LocationErrCode LocatorImpl::UnregisterNmeaMessageCallbackV9(const sptr<IRemoteObject>& callback)
371 {
372 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::UnregisterNmeaMessageCallbackV9()");
373 return client_->UnregisterNmeaMessageCallbackV9(callback);
374 }
375
RegisterCountryCodeCallbackV9(const sptr<IRemoteObject> & callback)376 LocationErrCode LocatorImpl::RegisterCountryCodeCallbackV9(const sptr<IRemoteObject>& callback)
377 {
378 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::RegisterCountryCodeCallbackV9()");
379 return client_->RegisterCountryCodeCallbackV9(callback);
380 }
381
UnregisterCountryCodeCallbackV9(const sptr<IRemoteObject> & callback)382 LocationErrCode LocatorImpl::UnregisterCountryCodeCallbackV9(const sptr<IRemoteObject>& callback)
383 {
384 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::UnregisterCountryCodeCallbackV9()");
385 return client_->UnregisterCountryCodeCallbackV9(callback);
386 }
387
RegisterCachedLocationCallbackV9(std::unique_ptr<CachedGnssLocationsRequest> & request,sptr<ICachedLocationsCallback> & callback)388 LocationErrCode LocatorImpl::RegisterCachedLocationCallbackV9(std::unique_ptr<CachedGnssLocationsRequest>& request,
389 sptr<ICachedLocationsCallback>& callback)
390 {
391 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::RegisterCachedLocationCallbackV9()");
392 return client_->RegisterCachedLocationCallbackV9(request, callback, "location.ILocator");
393 }
394
UnregisterCachedLocationCallbackV9(sptr<ICachedLocationsCallback> & callback)395 LocationErrCode LocatorImpl::UnregisterCachedLocationCallbackV9(sptr<ICachedLocationsCallback>& callback)
396 {
397 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::UnregisterCachedLocationCallbackV9()");
398 return client_->UnregisterCachedLocationCallbackV9(callback);
399 }
400
IsGeoServiceAvailableV9(bool & isAvailable)401 LocationErrCode LocatorImpl::IsGeoServiceAvailableV9(bool &isAvailable)
402 {
403 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::IsGeoServiceAvailableV9()");
404 return client_->IsGeoConvertAvailableV9(isAvailable);
405 }
406
GetAddressByCoordinateV9(MessageParcel & data,std::list<std::shared_ptr<GeoAddress>> & replyList)407 LocationErrCode LocatorImpl::GetAddressByCoordinateV9(MessageParcel &data,
408 std::list<std::shared_ptr<GeoAddress>>& replyList)
409 {
410 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::GetAddressByCoordinateV9()");
411 return client_->GetAddressByCoordinateV9(data, replyList);
412 }
413
GetAddressByLocationNameV9(MessageParcel & data,std::list<std::shared_ptr<GeoAddress>> & replyList)414 LocationErrCode LocatorImpl::GetAddressByLocationNameV9(MessageParcel &data,
415 std::list<std::shared_ptr<GeoAddress>>& replyList)
416 {
417 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::GetAddressByLocationNameV9()");
418 return client_->GetAddressByLocationNameV9(data, replyList);
419 }
420
IsLocationPrivacyConfirmedV9(const int type,bool & isConfirmed)421 LocationErrCode LocatorImpl::IsLocationPrivacyConfirmedV9(const int type, bool &isConfirmed)
422 {
423 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::IsLocationPrivacyConfirmedV9()");
424 return client_->IsLocationPrivacyConfirmedV9(type, isConfirmed);
425 }
426
SetLocationPrivacyConfirmStatusV9(const int type,bool isConfirmed)427 LocationErrCode LocatorImpl::SetLocationPrivacyConfirmStatusV9(const int type, bool isConfirmed)
428 {
429 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::SetLocationPrivacyConfirmStatusV9()");
430 return client_->SetLocationPrivacyConfirmStatusV9(type, isConfirmed);
431 }
432
GetCachedGnssLocationsSizeV9(int & size)433 LocationErrCode LocatorImpl::GetCachedGnssLocationsSizeV9(int &size)
434 {
435 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::GetCachedGnssLocationsSizeV9()");
436 return client_->GetCachedGnssLocationsSizeV9(size);
437 }
438
FlushCachedGnssLocationsV9()439 LocationErrCode LocatorImpl::FlushCachedGnssLocationsV9()
440 {
441 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::FlushCachedGnssLocationsV9()");
442 return client_->FlushCachedGnssLocationsV9();
443 }
444
SendCommandV9(std::unique_ptr<LocationCommand> & commands)445 LocationErrCode LocatorImpl::SendCommandV9(std::unique_ptr<LocationCommand>& commands)
446 {
447 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::SendCommandV9()");
448 return client_->SendCommandV9(commands);
449 }
450
AddFenceV9(std::unique_ptr<GeofenceRequest> & request)451 LocationErrCode LocatorImpl::AddFenceV9(std::unique_ptr<GeofenceRequest>& request)
452 {
453 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::AddFenceV9()");
454 return client_->AddFenceV9(request);
455 }
456
RemoveFenceV9(std::unique_ptr<GeofenceRequest> & request)457 LocationErrCode LocatorImpl::RemoveFenceV9(std::unique_ptr<GeofenceRequest>& request)
458 {
459 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::RemoveFenceV9()");
460 return client_->RemoveFenceV9(request);
461 }
462
GetIsoCountryCodeV9(std::shared_ptr<CountryCode> & countryCode)463 LocationErrCode LocatorImpl::GetIsoCountryCodeV9(std::shared_ptr<CountryCode>& countryCode)
464 {
465 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::GetIsoCountryCodeV9()");
466 return client_->GetIsoCountryCodeV9(countryCode);
467 }
468
EnableLocationMockV9()469 LocationErrCode LocatorImpl::EnableLocationMockV9()
470 {
471 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::EnableLocationMockV9()");
472 return client_->EnableLocationMockV9();
473 }
474
DisableLocationMockV9()475 LocationErrCode LocatorImpl::DisableLocationMockV9()
476 {
477 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::DisableLocationMockV9()");
478 return client_->DisableLocationMockV9();
479 }
480
SetMockedLocationsV9(const int timeInterval,const std::vector<std::shared_ptr<Location>> & location)481 LocationErrCode LocatorImpl::SetMockedLocationsV9(
482 const int timeInterval, const std::vector<std::shared_ptr<Location>> &location)
483 {
484 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::SetMockedLocationsV9()");
485 return client_->SetMockedLocationsV9(timeInterval, location);
486 }
487
EnableReverseGeocodingMockV9()488 LocationErrCode LocatorImpl::EnableReverseGeocodingMockV9()
489 {
490 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::EnableReverseGeocodingMockV9()");
491 return client_->EnableReverseGeocodingMockV9();
492 }
493
DisableReverseGeocodingMockV9()494 LocationErrCode LocatorImpl::DisableReverseGeocodingMockV9()
495 {
496 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::DisableReverseGeocodingMockV9()");
497 return client_->DisableReverseGeocodingMockV9();
498 }
499
SetReverseGeocodingMockInfoV9(std::vector<std::shared_ptr<GeocodingMockInfo>> & mockInfo)500 LocationErrCode LocatorImpl::SetReverseGeocodingMockInfoV9(std::vector<std::shared_ptr<GeocodingMockInfo>>& mockInfo)
501 {
502 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::SetReverseGeocodingMockInfoV9()");
503 return client_->SetReverseGeocodingMockInfoV9(mockInfo);
504 }
505
ProxyUidForFreezeV9(int32_t uid,bool isProxy)506 LocationErrCode LocatorImpl::ProxyUidForFreezeV9(int32_t uid, bool isProxy)
507 {
508 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::ProxyUidForFreezeV9()");
509 return client_->ProxyUidForFreezeV9(uid, isProxy);
510 }
511
ResetAllProxyV9()512 LocationErrCode LocatorImpl::ResetAllProxyV9()
513 {
514 LBSLOGD(LOCATOR_STANDARD, "LocatorImpl::ResetAllProxyV9()");
515 return client_->ResetAllProxyV9();
516 }
517 } // namespace Location
518 } // namespace OHOS
519