1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- #ifndef GEOFENCE_API_CLINET_H
- #define GEOFENCE_API_CLINET_H
- #include <mutex>
- #include <android/hardware/gnss/1.0/IGnssGeofenceCallback.h>
- #include <LocationAPIClientBase.h>
- namespace android {
- namespace hardware {
- namespace gnss {
- namespace V2_0 {
- namespace implementation {
- using ::android::sp;
- class GeofenceAPIClient : public LocationAPIClientBase
- {
- public:
- GeofenceAPIClient(const sp<V1_0::IGnssGeofenceCallback>& callback);
- void upcateCallback(const sp<V1_0::IGnssGeofenceCallback>& callback);
- void geofenceAdd(uint32_t geofence_id, double latitude, double longitude,
- double radius_meters, int32_t last_transition, int32_t monitor_transitions,
- uint32_t notification_responsiveness_ms, uint32_t unknown_timer_ms);
- void geofencePause(uint32_t geofence_id);
- void geofenceResume(uint32_t geofence_id, int32_t monitor_transitions);
- void geofenceRemove(uint32_t geofence_id);
- void geofenceRemoveAll();
-
- void onGeofenceBreachCb(GeofenceBreachNotification geofenceBreachNotification) final;
- void onGeofenceStatusCb(GeofenceStatusNotification geofenceStatusNotification) final;
- void onAddGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final;
- void onRemoveGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final;
- void onPauseGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final;
- void onResumeGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final;
- private:
- virtual ~GeofenceAPIClient() = default;
- std::mutex mMutex;
- sp<V1_0::IGnssGeofenceCallback> mGnssGeofencingCbIface;
- };
- }
- }
- }
- }
- }
- #endif
|