Starting March 27, 2025, we recommend using android-latest-release instead of aosp-main to build and contribute to AOSP. For more information, see Changes to AOSP.
         
       
     
  
  
  
  
  
    
    
      
    
    
      
      Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
    
  
  
  
  
    
  
  
    
    
  
  GpsGeofencingInterface Struct Reference
 
  
   #include <
   
    gps.h
   
   >
  
 
 
 
 
 
 
  
   Extended interface for GPS_Geofencing support
  
  
   Definition at line
   
    1361
   
   of file
   
    gps.h
   
   .
  
  
 
 
 
 
  
   
    
     | void(* add_geofence_area)(int32_t geofence_id, double latitude, double longitude, double radius_meters, int last_transition, int monitor_transitions, int notification_responsiveness_ms, int unknown_timer_ms) | 
   
   
  
   
    Add a geofence area. This api currently supports circular geofences. Parameters: geofence_id - The id for the geofence. If a geofence with this id already exists, an error value (GPS_GEOFENCE_ERROR_ID_EXISTS) should be returned. latitude, longtitude, radius_meters - The lat, long and radius (in meters) for the geofence last_transition - 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 GPS_GEOFENCE_ENTERED. In most cases, it will be GPS_GEOFENCE_UNCERTAIN. monitor_transition - Which transitions to monitor. Bitwise OR of GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED and GPS_GEOFENCE_UNCERTAIN. notification_responsiveness_ms - Defines the best-effort description of how soon should the callback be called when the transition associated with the
    
     Geofence
    
    is triggered. For instance, if set to 1000 millseconds with GPS_GEOFENCE_ENTERED, the callback should 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 GPS is polled at. It is acceptable to dynamically vary the rate of sampling the GPS for power-saving reasons; thus the rate of sampling may be faster or slower than this. unknown_timer_ms - The time limit after which the UNCERTAIN transition should be triggered. This parameter is defined in milliseconds. See above for a detailed explanation.
   
   
    Definition at line
    
     1400
    
    of file
    
     gps.h
    
    .
   
   
  
 
 
 
  
  
   
    Opens the geofence interface and provides the callback routines to the implementation of this interface.
   
   
    Definition at line
    
     1369
    
    of file
    
     gps.h
    
    .
   
   
  
 
 
 
  
   
    
     | void(* pause_geofence)(int32_t geofence_id) | 
   
   
  
   
    Pause monitoring a particular geofence. Parameters: geofence_id - The id for the geofence.
   
   
    Definition at line
    
     1409
    
    of file
    
     gps.h
    
    .
   
   
  
 
 
 
  
   
    
     | void(* remove_geofence_area)(int32_t geofence_id) | 
   
   
  
   
    Remove a geofence area. After the function returns, no notifications should be sent. Parameter: geofence_id - The id for the geofence.
   
   
    Definition at line
    
     1429
    
    of file
    
     gps.h
    
    .
   
   
  
 
 
 
  
   
    
     | void(* resume_geofence)(int32_t geofence_id, int monitor_transitions) | 
   
   
  
   
    Resume monitoring a particular geofence. Parameters: geofence_id - The id for the geofence. monitor_transitions - Which transitions to monitor. Bitwise OR of GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED and GPS_GEOFENCE_UNCERTAIN. This supersedes the value associated provided in the add_geofence_area call.
   
   
    Definition at line
    
     1421
    
    of file
    
     gps.h
    
    .
   
   
  
 
 
 
  
  
   
    set to sizeof(GpsGeofencingInterface)
   
   
    Definition at line
    
     1363
    
    of file
    
     gps.h
    
    .
   
   
  
 
 The documentation for this struct was generated from the following file:
 
  - 
   hardware/libhardware/include/hardware/
   
    gps.h
   
  
 
 
  
  
 
  
    
    
      
    
    
  
       
    
    
  
  
  Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
  Last updated 2019-10-02 UTC.
  
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2019-10-02 UTC."],[],[]]