• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 LOCATOR_IMPL_H
16 #define LOCATOR_IMPL_H
17 
18 #include <vector>
19 
20 #include "iremote_object.h"
21 
22 #include "constant_definition.h"
23 #include "country_code.h"
24 #include "country_code_manager.h"
25 #include "geo_address.h"
26 #include "geo_coding_mock_info.h"
27 #include "i_cached_locations_callback.h"
28 #include "locator_proxy.h"
29 #include "i_locating_required_data_callback.h"
30 #include "locating_required_data_config.h"
31 #include "location_data_manager.h"
32 namespace OHOS {
33 namespace Location {
34 class ICallbackResumeManager {
35 public:
36     virtual ~ICallbackResumeManager() = default;
37     virtual void ResumeCallback() = 0;
38 };
39 
40 class LocatorImpl {
41 public:
42     static std::shared_ptr<LocatorImpl> GetInstance();
43     explicit LocatorImpl();
44     ~LocatorImpl();
45     bool Init();
46 
47     /**
48      * @brief Obtain current location switch status.
49      *
50      * @return Returns true if the location switch on, returns false otherwise.
51      */
52     bool IsLocationEnabled();
53     void ShowNotification();
54     void RequestPermission();
55     void RequestEnableLocation();
56 
57     /**
58      * @brief Enable location switch.
59      *
60      * @param enable Status of the location switch to be set.
61      */
62     void EnableAbility(bool enable);
63 
64     /**
65      * @brief Subscribe location changed.
66      *
67      * @param requestConfig Indicates the location request parameters.
68      * @param callback Indicates the callback for reporting the location result.
69      */
70     void StartLocating(std::unique_ptr<RequestConfig>& requestConfig,
71         sptr<ILocatorCallback>& callback);
72 
73     /**
74      * @brief Unsubscribe location changed.
75      *
76      * @param callback Indicates the callback for reporting the location result.
77      */
78     void StopLocating(sptr<ILocatorCallback>& callback);
79 
80     /**
81      * @brief Obtain last known location.
82      *
83      * @return The last known location information.
84      */
85     std::unique_ptr<Location> GetCachedLocation();
86 
87     /**
88      * @brief Subscribe location switch changed.
89      *
90      * @param callback Indicates the callback for reporting the location switch status.
91      * @param uid Indicates the calling uid
92      * @return Return whether the registration is successful.
93      */
94     bool RegisterSwitchCallback(const sptr<IRemoteObject>& callback, pid_t uid);
95 
96     /**
97      * @brief Unsubscribe location switch changed.
98      *
99      * @param callback Indicates the callback for reporting the location switch status.
100      * @return Return whether the deregistration is successful.
101      */
102     bool UnregisterSwitchCallback(const sptr<IRemoteObject>& callback);
103 
104     /**
105      * @brief Subscribe satellite status changed.
106      *
107      * @param callback Indicates the callback for reporting the satellite status.
108      * @param uid Indicates the calling uid
109      * @return Return whether the registration is successful.
110      */
111     bool RegisterGnssStatusCallback(const sptr<IRemoteObject>& callback, pid_t uid);
112 
113     /**
114      * @brief Unsubscribe satellite status changed.
115      *
116      * @param callback Indicates the callback for reporting the satellite status.
117      * @return Return whether the deregistration is successful.
118      */
119     bool UnregisterGnssStatusCallback(const sptr<IRemoteObject>& callback);
120 
121     /**
122      * @brief Subscribe nmea message changed.
123      *
124      * @param callback Indicates the callback for reporting the nmea message.
125      * @param uid Indicates the calling uid
126      * @return Return whether the registration is successful.
127      */
128     bool RegisterNmeaMessageCallback(const sptr<IRemoteObject>& callback, pid_t uid);
129 
130     /**
131      * @brief Unsubscribe nmea message changed.
132      *
133      * @param callback Indicates the callback for reporting the nmea message.
134      * @return Return whether the deregistration is successful.
135      */
136     bool UnregisterNmeaMessageCallback(const sptr<IRemoteObject>& callback);
137 
138     /**
139      * @brief Registering the callback function for listening to country code changes.
140      *
141      * @param callback Indicates the callback for reporting country code changes.
142      * @param uid Indicates the calling uid
143      * @return Return whether the registration is successful.
144      */
145     bool RegisterCountryCodeCallback(const sptr<IRemoteObject>& callback, pid_t uid);
146 
147     /**
148      * @brief Unregistering the callback function for listening to country code changes.
149      *
150      * @param callback Indicates the callback for reporting country code changes.
151      * @return Return whether the deregistration is successful.
152      */
153     bool UnregisterCountryCodeCallback(const sptr<IRemoteObject>& callback);
154 
155     /**
156      * @brief Subscribe to cache GNSS locations update messages.
157      *
158      * @param request Indicates the cached GNSS locations request parameters.
159      * @param callback Indicates the callback for reporting the cached GNSS locations.
160      * @return Return whether the registration is successful.
161      */
162     void RegisterCachedLocationCallback(std::unique_ptr<CachedGnssLocationsRequest>& request,
163         sptr<ICachedLocationsCallback>& callback);
164 
165     /**
166      * @brief Unsubscribe to cache GNSS locations update messages.
167      *
168      * @param callback Indicates the callback for reporting the cached gnss locations.
169      * @return Return whether the deregistration is successful.
170      */
171     void UnregisterCachedLocationCallback(sptr<ICachedLocationsCallback>& callback);
172 
173     /**
174      * @brief Obtain geocoding service status.
175      *
176      * @return Returns true if geocoding service is available, returns false otherwise.
177      */
178     bool IsGeoServiceAvailable();
179 
180     /**
181      * @brief Obtain address info from location.
182      *
183      * @param data Indicates the reverse geocode query parameters.
184      * @param replyList Indicates the result of the address info.
185      */
186     void GetAddressByCoordinate(MessageParcel &data, std::list<std::shared_ptr<GeoAddress>>& replyList);
187 
188     /**
189      * @brief Obtain latitude and longitude info from location address.
190      *
191      * @param data Indicates the geocode query parameters.
192      * @param replyList Indicates the result of the address info.
193      */
194     void GetAddressByLocationName(MessageParcel &data, std::list<std::shared_ptr<GeoAddress>>& replyList);
195 
196     /**
197      * @brief Querying location privacy protocol confirmation status.
198      *
199      * @param type Indicates location privacy protocol type.
200      * @return Returns true if the location privacy protocol has been confirmed, returns false otherwise.
201      */
202     bool IsLocationPrivacyConfirmed(const int type);
203 
204     /**
205      * @brief Set location privacy protocol confirmation status.
206      *
207      * @param type Indicates location privacy protocol type.
208      * @param isConfirmed Indicates whether the location privacy protocol should be confirmed.
209      * @return Returns 1 if the location privacy protocol has been set, returns 0 otherwise.
210      */
211     int SetLocationPrivacyConfirmStatus(const int type, bool isConfirmed);
212 
213     /**
214      * @brief Obtain the number of cached GNSS locations.
215      *
216      * @return Returns the result of the cached GNSS locations size.
217      */
218     int GetCachedGnssLocationsSize();
219 
220     /**
221      * @brief All prepared GNSS locations are returned to the application through the callback function,
222      * and the bottom-layer buffer is cleared.
223      *
224      * @return Returns 1 if the cached gnss location has been flushed, returns 0 otherwise.
225      */
226     int FlushCachedGnssLocations();
227 
228     /**
229      * @brief Send extended commands to location subsystem.
230      *
231      * @param commands Indicates the extended command message body.
232      * @return Returns true if the command has been sent successfully, returns false otherwise.
233      */
234     bool SendCommand(std::unique_ptr<LocationCommand>& commands);
235 
236     /**
237      * @brief Add a geofence and subscribe geo fence status changed.
238      *
239      * @param request Indicates the Geofence configuration parameters.
240      * @return Returns true if the fence has been added successfully, returns false otherwise.
241      */
242     bool AddFence(std::unique_ptr<GeofenceRequest>& request);
243 
244     /**
245      * @brief Remove a geofence and unsubscribe geo fence status changed.
246      *
247      * @param request Indicates the Geofence configuration parameters.
248      * @return Returns true if the fence has been removed successfully, returns false otherwise.
249      */
250     bool RemoveFence(std::unique_ptr<GeofenceRequest>& request);
251 
252     /**
253      * @brief Obtain the current country code.
254      *
255      * @return Returns the result of the country code.
256      */
257     std::shared_ptr<CountryCode> GetIsoCountryCode();
258 
259     /**
260      * @brief Enable the geographical location simulation function.
261      *
262      * @return Returns true if the mock location function has been enabled successfully, returns false otherwise.
263      */
264     bool EnableLocationMock();
265 
266     /**
267      * @brief Disable the geographical location simulation function.
268      *
269      * @return Returns true if the mock location function has been disabled successfully, returns false otherwise.
270      */
271     bool DisableLocationMock();
272 
273     /**
274      * @brief Set the configuration parameters for location simulation.
275      *
276      * @param timeInterval Indicates how often the simulated location is reported.
277      * @param location Indicates the simulated location to be reported.
278      * @return Returns true if the mock location config has been set successfully, returns false otherwise.
279      */
280     bool SetMockedLocations(
281         const int timeInterval, const std::vector<std::shared_ptr<Location>> &location);
282 
283     /**
284      * @brief Enable the reverse geocoding simulation function.
285      *
286      * @return Returns true if the mock reverse geocoding function has been enabled successfully,
287      * returns false otherwise.
288      */
289     bool EnableReverseGeocodingMock();
290 
291     /**
292      * @brief Disable the reverse geocoding simulation function.
293      *
294      * @return Returns true if the mock reverse geocoding function has been disabled successfully,
295      * returns false otherwise.
296      */
297     bool DisableReverseGeocodingMock();
298 
299     /**
300      * @brief Set the configuration parameters for simulating reverse geocoding.
301      *
302      * @param mockInfo Indicates the set of locations and place names to be simulated.
303      * @return Returns true if the mock reverse geocoding config has been set successfully, returns false otherwise.
304      */
305     bool SetReverseGeocodingMockInfo(std::vector<std::shared_ptr<GeocodingMockInfo>>& mockInfo);
306 
307     /**
308      * @brief Used to freeze locating process with specified uid.
309      *
310      * @param uid Indicates the calling uid.
311      * @param isProxy Indicates if the locating process should be freezed.
312      * @return Returns true if the process has been frozen successfully, returns false otherwise.
313      */
314     bool ProxyUidForFreeze(int32_t uid, bool isProxy);
315 
316     /**
317      * @brief Used to reset the frozen status of all location processes.
318      *
319      * @return Returns true if the frozen status of process has been reset successfully, returns false otherwise.
320      */
321     bool ResetAllProxy();
322 
323     /**
324      * @brief Obtain current location switch status.
325      *
326      * @param isEnabled Indicates if the location switch on.
327      * @return Returns ERRCODE_SUCCESS if obtain current location switch status succeed.
328      */
329     LocationErrCode IsLocationEnabledV9(bool &isEnabled);
330 
331     /**
332      * @brief Enable location switch.
333      *
334      * @param enable Status of the location switch to be set.
335      * @return Returns ERRCODE_SUCCESS if enable location switch succeed.
336      */
337     LocationErrCode EnableAbilityV9(bool enable);
338 
339     /**
340      * @brief Subscribe location changed.
341      *
342      * @param requestConfig Indicates the location request parameters.
343      * @param callback Indicates the callback for reporting the location result.
344      * @return Returns ERRCODE_SUCCESS if subscribe location changed succeed.
345      */
346     LocationErrCode StartLocatingV9(std::unique_ptr<RequestConfig>& requestConfig,
347         sptr<ILocatorCallback>& callback);
348 
349     /**
350      * @brief Unsubscribe location changed.
351      *
352      * @param callback Indicates the callback for reporting the location result.
353      * @return Returns ERRCODE_SUCCESS if Unsubscribe location changed succeed.
354      */
355     LocationErrCode StopLocatingV9(sptr<ILocatorCallback>& callback);
356 
357     /**
358      * @brief Obtain last known location.
359      *
360      * @param loc Indicates the last known location information.
361      * @return Returns ERRCODE_SUCCESS if obtain last known location succeed.
362      */
363     LocationErrCode GetCachedLocationV9(std::unique_ptr<Location> &loc);
364 
365     /**
366      * @brief Subscribe location switch changed.
367      *
368      * @param callback Indicates the callback for reporting the location switch status.
369      * @return Return ERRCODE_SUCCESS if the registration is successful.
370      */
371     LocationErrCode RegisterSwitchCallbackV9(const sptr<IRemoteObject>& callback);
372 
373     /**
374      * @brief Unsubscribe location switch changed.
375      *
376      * @param callback Indicates the callback for reporting the location switch status.
377      * @return Return ERRCODE_SUCCESS if the deregistration is successful.
378      */
379     LocationErrCode UnregisterSwitchCallbackV9(const sptr<IRemoteObject>& callback);
380 
381     /**
382      * @brief Subscribe satellite status changed.
383      *
384      * @param callback Indicates the callback for reporting the satellite status.
385      * @return Return ERRCODE_SUCCESS if the registration is successful.
386      */
387     LocationErrCode RegisterGnssStatusCallbackV9(const sptr<IRemoteObject>& callback);
388 
389     /**
390      * @brief Unsubscribe satellite status changed.
391      *
392      * @param callback Indicates the callback for reporting the satellite status.
393      * @return Return ERRCODE_SUCCESS if the deregistration is successful.
394      */
395     LocationErrCode UnregisterGnssStatusCallbackV9(const sptr<IRemoteObject>& callback);
396 
397     /**
398      * @brief Subscribe nmea message changed.
399      *
400      * @param callback Indicates the callback for reporting the nmea message.
401      * @return Return ERRCODE_SUCCESS if the registration is successful.
402      */
403     LocationErrCode RegisterNmeaMessageCallbackV9(const sptr<IRemoteObject>& callback);
404 
405     /**
406      * @brief Unsubscribe nmea message changed.
407      *
408      * @param callback Indicates the callback for reporting the nmea message.
409      * @return Return ERRCODE_SUCCESS if the deregistration is successful.
410      */
411     LocationErrCode UnregisterNmeaMessageCallbackV9(const sptr<IRemoteObject>& callback);
412 
413     /**
414      * @brief Registering the callback function for listening to country code changes.
415      *
416      * @param callback Indicates the callback for reporting country code changes.
417      * @return Return ERRCODE_SUCCESS if the registration is successful.
418      */
419     LocationErrCode RegisterCountryCodeCallbackV9(const sptr<IRemoteObject>& callback);
420 
421     /**
422      * @brief Unregistering the callback function for listening to country code changes.
423      *
424      * @param callback Indicates the callback for reporting country code changes.
425      * @return Return ERRCODE_SUCCESS if the deregistration is successful.
426      */
427     LocationErrCode UnregisterCountryCodeCallbackV9(const sptr<IRemoteObject>& callback);
428 
429     /**
430      * @brief Subscribe to cache GNSS locations update messages.
431      *
432      * @param request Indicates the cached GNSS locations request parameters.
433      * @param callback Indicates the callback for reporting the cached GNSS locations.
434      * @return Return ERRCODE_SUCCESS if the registration is successful.
435      */
436     LocationErrCode RegisterCachedLocationCallbackV9(std::unique_ptr<CachedGnssLocationsRequest>& request,
437         sptr<ICachedLocationsCallback>& callback);
438 
439     /**
440      * @brief Unsubscribe to cache GNSS locations update messages.
441      *
442      * @param callback Indicates the callback for reporting the cached gnss locations.
443      * @return Return ERRCODE_SUCCESS if the deregistration is successful.
444      */
445     LocationErrCode UnregisterCachedLocationCallbackV9(sptr<ICachedLocationsCallback>& callback);
446 
447     /**
448      * @brief Obtain geocoding service status.
449      *
450      * @param isAvailable Indicates if geocoding service is available
451      * @return Return ERRCODE_SUCCESS if obtain geocoding service status is successful.
452      */
453     LocationErrCode IsGeoServiceAvailableV9(bool &isAvailable);
454 
455     /**
456      * @brief Obtain address info from location.
457      *
458      * @param data Indicates the reverse geocode query parameters.
459      * @param replyList Indicates the result of the address info.
460      * @return Return ERRCODE_SUCCESS if obtain address info from location is successful.
461      */
462     LocationErrCode GetAddressByCoordinateV9(MessageParcel &data,
463         std::list<std::shared_ptr<GeoAddress>>& replyList);
464 
465     /**
466      * @brief Obtain latitude and longitude info from location address.
467      *
468      * @param data Indicates the geocode query parameters.
469      * @param replyList Indicates the result of the address info.
470      * @return Return ERRCODE_SUCCESS if obtain latitude and longitude info from location address is successful.
471      */
472     LocationErrCode GetAddressByLocationNameV9(MessageParcel &data,
473         std::list<std::shared_ptr<GeoAddress>>& replyList);
474 
475     /**
476      * @brief Querying location privacy protocol confirmation status.
477      *
478      * @param type Indicates location privacy protocol type.
479      * @param isConfirmed Indicates if the location privacy protocol has been confirmed
480      * @return Return ERRCODE_SUCCESS if querying location privacy protocol confirmation status is successful.
481      */
482     LocationErrCode IsLocationPrivacyConfirmedV9(const int type, bool &isConfirmed);
483 
484     /**
485      * @brief Set location privacy protocol confirmation status.
486      *
487      * @param type Indicates location privacy protocol type.
488      * @param isConfirmed Indicates whether the location privacy protocol should be confirmed.
489      * @return Return ERRCODE_SUCCESS if set location privacy protocol confirmation status is successful.
490      */
491     LocationErrCode SetLocationPrivacyConfirmStatusV9(const int type, bool isConfirmed);
492 
493     /**
494      * @brief Obtain the number of cached GNSS locations.
495      *
496      * @param size Indicates the cached GNSS locations size
497      * @return Return ERRCODE_SUCCESS if obtain the number of cached GNSS locations is successful.
498      */
499     LocationErrCode GetCachedGnssLocationsSizeV9(int &size);
500 
501     /**
502      * @brief All prepared GNSS locations are returned to the application through the callback function,
503      * and the bottom-layer buffer is cleared.
504      *
505      * @return Return ERRCODE_SUCCESS if flush cached gnss locations is successful.
506      */
507     LocationErrCode FlushCachedGnssLocationsV9();
508 
509     /**
510      * @brief Send extended commands to location subsystem.
511      *
512      * @param commands Indicates the extended command message body.
513      * @return Returns ERRCODE_SUCCESS if the command has been sent successfully.
514      */
515     LocationErrCode SendCommandV9(std::unique_ptr<LocationCommand>& commands);
516 
517     /**
518      * @brief Add a geofence and subscribe geo fence status changed.
519      *
520      * @param request Indicates the Geofence configuration parameters.
521      * @return Returns ERRCODE_SUCCESS if the fence has been added successfully.
522      */
523     LocationErrCode AddFenceV9(std::unique_ptr<GeofenceRequest>& request);
524 
525     /**
526      * @brief Remove a geofence and unsubscribe geo fence status changed.
527      *
528      * @param request Indicates the Geofence configuration parameters.
529      * @return Returns ERRCODE_SUCCESS if the fence has been removed successfully.
530      */
531     LocationErrCode RemoveFenceV9(std::unique_ptr<GeofenceRequest>& request);
532 
533     /**
534      * @brief Obtain the current country code.
535      *
536      * @param countryCode the result of the country code
537      * @return Returns ERRCODE_SUCCESS if obtain the current country code successfully.
538      */
539     LocationErrCode GetIsoCountryCodeV9(std::shared_ptr<CountryCode>& countryCode);
540 
541     /**
542      * @brief Enable the geographical location simulation function.
543      *
544      * @return Returns ERRCODE_SUCCESS if the mock location function has been enabled successfully.
545      */
546     LocationErrCode EnableLocationMockV9();
547 
548     /**
549      * @brief Disable the geographical location simulation function.
550      *
551      * @return Returns ERRCODE_SUCCESS if the mock location function has been disabled successfully.
552      */
553     LocationErrCode DisableLocationMockV9();
554 
555     /**
556      * @brief Set the configuration parameters for location simulation.
557      *
558      * @param timeInterval Indicates how often the simulated location is reported.
559      * @param location Indicates the simulated location to be reported.
560      * @return Returns ERRCODE_SUCCESS if the mock location config has been set successfully.
561      */
562     LocationErrCode SetMockedLocationsV9(
563         const int timeInterval, const std::vector<std::shared_ptr<Location>> &location);
564 
565     /**
566      * @brief Enable the reverse geocoding simulation function.
567      *
568      * @return Returns ERRCODE_SUCCESS if the mock reverse geocoding function has been enabled successfully.
569      */
570     LocationErrCode EnableReverseGeocodingMockV9();
571 
572     /**
573      * @brief Disable the reverse geocoding simulation function.
574      *
575      * @return Returns ERRCODE_SUCCESS if the mock reverse geocoding function has been disabled successfully.
576      */
577     LocationErrCode DisableReverseGeocodingMockV9();
578 
579     /**
580      * @brief Set the configuration parameters for simulating reverse geocoding.
581      *
582      * @param mockInfo Indicates the set of locations and place names to be simulated.
583      * @return Returns ERRCODE_SUCCESS if the mock reverse geocoding config has been set successfully.
584      */
585     LocationErrCode SetReverseGeocodingMockInfoV9(std::vector<std::shared_ptr<GeocodingMockInfo>>& mockInfo);
586 
587     /**
588      * @brief Used to freeze locating process with specified uid.
589      *
590      * @param uid Indicates the calling uid.
591      * @param isProxy Indicates if the locating process should be freezed.
592      * @return Returns ERRCODE_SUCCESS if the process has been frozen successfully.
593      */
594     LocationErrCode ProxyUidForFreezeV9(int32_t uid, bool isProxy);
595 
596     /**
597      * @brief Used to reset the frozen status of all location processes.
598      *
599      * @return Returns ERRCODE_SUCCESS if the frozen status of process has been reset successfully.
600      */
601     LocationErrCode ResetAllProxyV9();
602 
603     /**
604      * @brief Subscribe to changes in WiFi/BT scanning information.
605      *
606      * @param dataConfig Indicates the locating required data configuration parameters.
607      * @param callback Indicates the callback for reporting WiFi/BT scan info.
608      * @return Returns ERRCODE_SUCCESS if subscribe to changes in WiFi/BT scanning information successfully.
609      */
610     LocationErrCode RegisterLocatingRequiredDataCallback(std::unique_ptr<LocatingRequiredDataConfig>& dataConfig,
611         sptr<ILocatingRequiredDataCallback>& callback);
612 
613     /**
614      * @brief Unsubscribe to changes in WiFi/BT scanning information.
615      *
616      * @param callback Indicates the callback for reporting WiFi/BT scan info.
617      * @return Returns ERRCODE_SUCCESS if Unsubscribe to changes in WiFi/BT scanning information successfully.
618      */
619     LocationErrCode UnRegisterLocatingRequiredDataCallback(sptr<ILocatingRequiredDataCallback>& callback);
620     void ResetLocatorProxy(const wptr<IRemoteObject> &remote);
621     void SetResumer(std::shared_ptr<ICallbackResumeManager> resumer);
622 
623 private:
624     LocationErrCode CheckEdmPolicy(bool enable);
625 
626 private:
627     class LocatorDeathRecipient : public IRemoteObject::DeathRecipient {
628     public:
LocatorDeathRecipient(LocatorImpl & impl)629         explicit LocatorDeathRecipient(LocatorImpl &impl) : impl_(impl) {}
630         ~LocatorDeathRecipient() override = default;
OnRemoteDied(const wptr<IRemoteObject> & remote)631         void OnRemoteDied(const wptr<IRemoteObject> &remote) override
632         {
633             impl_.ResetLocatorProxy(remote);
634         }
635     private:
636         LocatorImpl &impl_;
637     };
638 
639 private:
640     sptr<LocatorProxy> GetProxy();
641     bool IsCallbackResuming();
642     void UpdateCallbackResumingState(bool state);
643 
644     sptr<LocatorProxy> client_ { nullptr };
645     sptr<IRemoteObject::DeathRecipient> recipient_ { nullptr };
646     std::shared_ptr<ICallbackResumeManager> resumer_ { nullptr };
647     std::shared_ptr<LocationDataManager> locationDataManager_ { nullptr };
648     bool isServerExist_ = false;
649     bool isCallbackResuming_ = false;
650     std::mutex mutex_;
651     std::mutex resumeMutex_;
652     static std::mutex locatorMutex_;
653     static std::shared_ptr<LocatorImpl> instance_;
654     std::shared_ptr<CountryCodeManager> countryCodeManager_ = nullptr;
655     bool isObserverReg_ = false;
656 };
657 }  // namespace Location
658 }  // namespace OHOS
659 #endif // LOCATOR_IMPL_H
660