/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.hardware.gnss@1.0; import IGnssGeofenceCallback; /** Extended interface for GNSS Geofencing support */ interface IGnssGeofencing { /** * Opens the geofence interface and provides the callback routines * to the HAL. * * @param callback Handle to the IGnssGeofenceCallback interface. */ setCallback(IGnssGeofenceCallback callback); /** * Add a geofence area. This api currently supports circular geofences. * * @param geofenceId The id for the geofence. If a geofence with this id * already exists, an error value (ERROR_ID_EXISTS) must be returned. * @param latitudeDegrees The latitude(in degrees) for the geofence lastTransition. * @param longtitudeDegrees The longitude(in degrees) for the geofence lastTransition. * @param radiusMeters The radius(in meters) for the geofence lastTransition. * @param 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. * @param monitorTransitions - Which transitions to monitor. Bitwise OR of * ENTERED, EXITED and UNCERTAIN. * @param 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. * @param unknownTimerMs - The time limit after which the UNCERTAIN transition * must be triggered. This parameter is defined in milliseconds. */ addGeofence(int32_t geofenceId, double latitudeDegrees, double longitudeDegrees, double radiusMeters, GeofenceTransition lastTransition, bitfield monitorTransitions, uint32_t notificationResponsivenessMs, uint32_t unknownTimerMs); /** * Pause monitoring a particular geofence. * * @param geofenceId The id for the geofence. */ pauseGeofence(int32_t geofenceId); /** * Resume monitoring a particular geofence. * * @param geofenceId - The id for the geofence. * @param 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. */ resumeGeofence(int32_t geofenceId, bitfield monitorTransitions); /** * Remove a geofence area. After the function returns, no notifications * must be sent. * * @param geofenceId The id of the geofence. */ removeGeofence(int32_t geofenceId); };