2025년 3월 27일부터 AOSP를 빌드하고 기여하려면 aosp-main
대신 android-latest-release
를 사용하는 것이 좋습니다. 자세한 내용은 AOSP 변경사항을 참고하세요.
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
GpsGeofencingInterface 구조체 참조
#include <
gps.h
>
GPS_Geofencing 지원을 위한 확장된 인터페이스
gps.h
파일의
1361
행에 정의가 있습니다.
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)
|
지오펜스 영역을 추가합니다. 이 API는 현재 원형 지오펜스를 지원합니다. 매개변수: geofence_id - 지오펜싱의 ID입니다. 이 ID의 지오펜스가 이미 있는 경우 오류 값 (GPS_GEOFENCE_ERROR_ID_EXISTS)이 반환되어야 합니다. latitude, longtitude, radius_meters - 지오펜스의 lat, long, radius (미터) last_transition - 지오펜스의 현재 상태입니다. 예를 들어 시스템이 사용자가 지오펜싱 내에 있음을 이미 알고 있는 경우 GPS_GEOFENCE_ENTERED로 설정됩니다. 대부분의 경우 GPS_GEOFENCE_UNCERTAIN입니다. monitor_transition - 모니터링할 전환입니다. GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED, GPS_GEOFENCE_UNCERTAIN의 비트 OR입니다. notification_responsiveness_ms -
지오펜스
와 관련된 전환이 트리거될 때 콜백을 얼마나 빨리 호출해야 하는지에 관한 최선의 설명을 정의합니다. 예를 들어 GPS_GEOFENCE_ENTERED와 함께 1, 000밀리초로 설정하면 콜백은 지오펜스를 진입한 후 1, 000밀리초 이내에 호출되어야 합니다. 이 매개변수는 밀리초 단위로 정의됩니다. 참고: GPS가 폴링되는 속도와 혼동해서는 안 됩니다. 절전상의 이유로 GPS 샘플링 속도를 동적으로 변경하는 것은 허용됩니다. 따라서 샘플링 속도는 이보다 빠르거나 느릴 수 있습니다. unknown_timer_ms - UNCERTAIN 전환이 트리거되어야 하는 시간 제한입니다. 이 매개변수는 밀리초 단위로 정의됩니다. 자세한 내용은 위의 내용을 참고하세요.
gps.h
파일의
1400
행에 정의되어 있습니다.
지오펜스 인터페이스를 열고 이 인터페이스의 구현에 콜백 루틴을 제공합니다.
gps.h
파일의
1369
줄에 정의가 있습니다.
void(* pause_geofence)(int32_t geofence_id)
|
특정 지오펜싱의 모니터링을 일시중지합니다. 매개변수: geofence_id - 지오펜싱의 ID입니다.
gps.h
파일의
1409
라인에 정의가 있습니다.
void(* remove_geofence_area)(int32_t geofence_id)
|
지오펜스 영역을 삭제합니다. 함수가 반환된 후에는 알림을 전송하면 안 됩니다. 매개변수: geofence_id - 지오펜싱의 ID입니다.
gps.h
파일의
1429
라인에 정의가 있습니다.
void(* resume_geofence)(int32_t geofence_id, int monitor_transitions)
|
특정 지오펜싱 모니터링을 재개합니다. 매개변수: geofence_id - 지오펜싱의 ID입니다. monitor_transitions - 모니터링할 전환입니다. GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED, GPS_GEOFENCE_UNCERTAIN의 비트 OR입니다. 이 값은 add_geofence_area 호출에서 제공된 연결된 값을 대체합니다.
gps.h
FILE의
1421
라인에 정의되어 있습니다.
sizeof(GpsGeofencingInterface)로 설정
gps.h
FILE의
1363
라인에 정의되어 있습니다.
이 구조체에 관한 문서는 다음 파일에서 생성되었습니다.
-
hardware/libhardware/include/hardware/
gps.h
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-27(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-27(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)"]]