1 /*
2 * Copyright (c) 2024 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 #ifdef HDF_DRIVERS_INTERFACE_GEOFENCE_ENABLE
16 #include "geofence_event_callback.h"
17 #include "location_log.h"
18 #include "gnss_ability.h"
19
20 #include "common_utils.h"
21
22 namespace OHOS {
23 namespace Location {
ReportGeofenceAvailability(bool isAvailable)24 int32_t GeofenceEventCallback::ReportGeofenceAvailability(bool isAvailable)
25 {
26 return 0;
27 }
28
ReportGeofenceEvent(int32_t fenceIndex,const HDI::Location::Geofence::V2_0::LocationInfo & location,GeofenceEvent event,int64_t timestamp)29 int32_t GeofenceEventCallback::ReportGeofenceEvent(int32_t fenceIndex,
30 const HDI::Location::Geofence::V2_0::LocationInfo& location, GeofenceEvent event, int64_t timestamp)
31 {
32 LBSLOGD(GNSS, "ReportGeofenceEvent enter");
33 auto gnssAbility = GnssAbility::GetInstance();
34 gnssAbility->ReportGeofenceEvent(fenceIndex, event);
35 return 0;
36 }
37
ReportGeofenceOperateResult(int32_t fenceIndex,GeofenceOperateType type,GeofenceOperateResult result)38 int32_t GeofenceEventCallback::ReportGeofenceOperateResult(
39 int32_t fenceIndex, GeofenceOperateType type, GeofenceOperateResult result)
40 {
41 LBSLOGD(GNSS, "ReportGeofenceOperateResult enter");
42 auto gnssAbility = GnssAbility::GetInstance();
43 gnssAbility->ReportGeofenceOperationResult(fenceIndex, type, result);
44 return 0;
45 }
46 } // namespace Location
47 } // namespace OHOS
48 #endif
49