Начиная с 27 марта 2025 г. мы рекомендуем использовать android-latest-release
вместо aosp-main
для создания и участия в AOSP. Дополнительные сведения см. в разделе Изменения в AOSP .
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Справочник по структуре интерфейса GpsGeofencingInterface
#include < gps.h >
Расширенный интерфейс для поддержки GPS_Geofencing.
Определение в строке 1361 файла gps.h.
void(* add_geofence_area)(int32_t geofence_id, двойная широта, двойная долгота, двойной радиус_метры, int Last_transition, int Monitor_transitions, int Notification_Responseness_ms, int Unknown_timer_ms) |
Добавьте зону геозоны. Этот API в настоящее время поддерживает круговые геозоны. Параметры: geofence_id — идентификатор геозоны. Если геозона с таким идентификатором уже существует, должно быть возвращено значение ошибки (GPS_GEOFENCE_ERROR_ID_EXISTS). широта, долгота, радиус_метры — широта, долгота и радиус (в метрах) геозоны. Last_transition — текущее состояние геозоны. Например, если система уже знает, что пользователь находится внутри геозоны, для этого параметра будет установлено значение GPS_GEOFENCE_ENTERED. В большинстве случаев это будет GPS_GEOFENCE_UNCERTAIN. Monitor_transition — Какие переходы отслеживать. Побитовое ИЛИ для GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED и GPS_GEOFENCE_UNCERTAIN. Notification_Responseness_ms — определяет максимально возможное описание того, как скоро должен быть вызван обратный вызов при запуске перехода, связанного с геозоной . Например, если для GPS_GEOFENCE_ENTERED установлено значение 1000 миллисекунд, обратный вызов должен быть вызван через 1000 миллисекунд при входе в геозону. Этот параметр определяется в миллисекундах. ПРИМЕЧАНИЕ. Не следует путать это значение со скоростью опроса GPS. Допускается динамическое изменение частоты выборки GPS из соображений энергосбережения; таким образом, скорость выборки может быть выше или медленнее этой. неизвестное_таймер_мс — ограничение времени, по истечении которого должен сработать НЕОПРЕДЕЛЕННЫЙ переход. Этот параметр определяется в миллисекундах. Подробное объяснение смотрите выше.
Определение в строке 1400 файла gps.h.
Открывает интерфейс геозоны и предоставляет процедуры обратного вызова для реализации этого интерфейса.
Определение в строке 1369 файла gps.h.
void (* пауза_geofence) (int32_t geofence_id) |
Приостановить мониторинг определенной геозоны. Параметры: geofence_id — идентификатор геозоны.
Определение в строке 1409 файла gps.h.
void(* remove_geofence_area)(int32_t geofence_id) |
Удаление зоны геозоны. После возврата функции уведомления отправляться не должны. Параметр: geofence_id — идентификатор геозоны.
Определение в строке 1429 файла gps.h.
void(*sume_geofence)(int32_t geofence_id, int Monitor_transitions) |
Возобновить мониторинг определенной геозоны. Параметры: geofence_id — идентификатор геозоны. Monitor_transitions — Какие переходы отслеживать. Побитовое ИЛИ для GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED и GPS_GEOFENCE_UNCERTAIN. Это заменяет связанное значение, указанное в вызове add_geofence_area.
Определение в строке 1421 файла gps.h.
установлено sizeof(GpsGeofencingInterface)
Определение в строке 1363 файла gps.h.
Документация для этой структуры была создана из следующего файла:
- оборудование/libhardware/include/hardware/ gps.h
Контент и образцы кода на этой странице предоставлены по лицензиям. Java и OpenJDK – это зарегистрированные товарные знаки корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-29 UTC.
[[["Прост для понимания","easyToUnderstand","thumb-up"],["Помог мне решить мою проблему","solvedMyProblem","thumb-up"],["Другое","otherUp","thumb-up"]],[["Отсутствует нужная мне информация","missingTheInformationINeed","thumb-down"],["Слишком сложен/слишком много шагов","tooComplicatedTooManySteps","thumb-down"],["Устарел","outOfDate","thumb-down"],["Проблема с переводом текста","translationIssue","thumb-down"],["Проблемы образцов/кода","samplesCodeIssue","thumb-down"],["Другое","otherDown","thumb-down"]],["Последнее обновление: 2025-07-29 UTC."],[],[],null,["# Android Hardware Abstraction Layer: GpsGeofencingInterface Struct Reference\n\nGpsGeofencingInterface Struct Reference\n=======================================\n\n[Data Fields](#pub-attribs) \nGpsGeofencingInterface Struct Reference \n\n`\n#include \u003c\n`[gps.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)`\n\u003e\n`\n\n|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Data Fields ----------- ||\n| size_t | [size](/reference/hal/struct_gps_geofencing_interface#a854352f53b148adc24983a58a1866d66) |\n| ||\n| void(\\* | [init](/reference/hal/struct_gps_geofencing_interface#a4504d0e82b1d377fa32d56ec5004774f) )( [GpsGeofenceCallbacks](/reference/hal/struct_gps_geofence_callbacks) \\*callbacks) |\n| ||\n| void(\\* | [add_geofence_area](/reference/hal/struct_gps_geofencing_interface#add2c5bdb0d1496ac9ee6a2460fb12a08) )(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) |\n| ||\n| void(\\* | [pause_geofence](/reference/hal/struct_gps_geofencing_interface#a850b900b8eabf9328ec853978936ed4f) )(int32_t geofence_id) |\n| ||\n| void(\\* | [resume_geofence](/reference/hal/struct_gps_geofencing_interface#af409f9b64a5b9b42a5417ae381fabc88) )(int32_t geofence_id, int monitor_transitions) |\n| ||\n| void(\\* | [remove_geofence_area](/reference/hal/struct_gps_geofencing_interface#a4cff265eb49bb5d94d9be5a4c55ceea7) )(int32_t geofence_id) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nExtended interface for GPS_Geofencing support\n\n\nDefinition at line\n[1361](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\nof file\n[gps.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\n.\n\nField Documentation\n-------------------\n\n\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 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) |\n\n\nAdd 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\n[Geofence](/reference/hal/struct_geofence)\nis 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.\n\n\nDefinition at line\n[1400](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\nof file\n[gps.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\n.\n\n|--------------------------------------------------------------------------------------------------|\n| void(\\* init)( [GpsGeofenceCallbacks](/reference/hal/struct_gps_geofence_callbacks) \\*callbacks) |\n\n\nOpens the geofence interface and provides the callback routines to the implementation of this interface.\n\n\nDefinition at line\n[1369](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\nof file\n[gps.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\n.\n\n|----------------------------------------------|\n| void(\\* pause_geofence)(int32_t geofence_id) |\n\n\nPause monitoring a particular geofence. Parameters: geofence_id - The id for the geofence.\n\n\nDefinition at line\n[1409](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\nof file\n[gps.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\n.\n\n|----------------------------------------------------|\n| void(\\* remove_geofence_area)(int32_t geofence_id) |\n\n\nRemove a geofence area. After the function returns, no notifications should be sent. Parameter: geofence_id - The id for the geofence.\n\n\nDefinition at line\n[1429](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\nof file\n[gps.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\n.\n\n|------------------------------------------------------------------------|\n| void(\\* resume_geofence)(int32_t geofence_id, int monitor_transitions) |\n\n\nResume 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.\n\n\nDefinition at line\n[1421](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\nof file\n[gps.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\n.\n\n|-------------|\n| size_t size |\n\n\nset to sizeof(GpsGeofencingInterface)\n\n\nDefinition at line\n[1363](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\nof file\n[gps.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)\n.\n\n*** ** * ** ***\n\nThe documentation for this struct was generated from the following file:\n\n- hardware/libhardware/include/hardware/ [gps.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h)"]]