Package: android.hardware.gnss@1.0

IGnssGeofencing

interface IGnssGeofencing

Extended interface for GNSS Geofencing support

Methods

setCallback

setCallback (IGnssGeofenceCallback callback)

Opens the geofence interface and provides the callback routines to the HAL.

Details
Parameters
callback
Handle to the IGnssGeofenceCallback interface.

addGeofence

addGeofence (int32_t geofenceId, double latitudeDegrees, double longitudeDegrees, double radiusMeters, GeofenceTransition lastTransition, bitfield<IGnssGeofenceCallback.GeofenceTransition> monitorTransitions, uint32_t notificationResponsivenessMs, uint32_t unknownTimerMs)

Add a geofence area.This api currently supports circular geofences.

Details
Parameters
geofenceId
The id for the geofence.If a geofence with this id already exists, an error value(ERROR_ID_EXISTS)must be returned.
latitudeDegrees
The latitude(in degrees)for the geofence lastTransition.
longitudeDegrees
radiusMeters
The radius(in meters)for the geofence lastTransition.
lastTransition
The current state of the geofence.For example, if the system already knows that the user is inside the geofence, this will be set to ENTERED.In most cases, it will be UNCERTAIN.
monitorTransitions
- Which transitions to monitor.Bitwise OR of ENTERED, EXITED and UNCERTAIN.
notificationResponsivenessMs
- Defines the best-effort description of how soon must the callback be called when the transition associated with the Geofence is triggered.For instance, if set to 1000 millseconds with ENTERED, the callback must be called 1000 milliseconds within entering the geofence.This parameter is defined in milliseconds.NOTE:This is not to be confused with the rate that the GNSS is polled at.It is acceptable to dynamically vary the rate of sampling the GNSS for power-saving reasons;thus the rate of sampling may be faster or slower than this.
unknownTimerMs
- The time limit after which the UNCERTAIN transition must be triggered.This parameter is defined in milliseconds.

pauseGeofence

pauseGeofence (int32_t geofenceId)

Pause monitoring a particular geofence.

Details
Parameters
geofenceId
The id for the geofence.

resumeGeofence

resumeGeofence (int32_t geofenceId, bitfield<IGnssGeofenceCallback.GeofenceTransition> monitorTransitions)

Resume monitoring a particular geofence.

Details
Parameters
geofenceId
- The id for the geofence.
monitorTransitions
Specifies which transitions to monitor.It can be a bitwise OR of ENTERED, EXITED and UNCERTAIN.This supersedes the value associated provided in the addGeofenceArea call.

removeGeofence

removeGeofence (int32_t geofenceId)

Remove a geofence area.After the function returns, no notifications must be sent.

Details
Parameters
geofenceId
The id of the geofence.