Kể từ ngày 27 tháng 3 năm 2025, bạn nên sử dụng android-latest-release
thay vì aosp-main
để xây dựng và đóng góp cho AOSP. Để biết thêm thông tin, hãy xem phần Thay đổi đối với AOSP.
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Tham chiếu cấu trúc GpsNavigationMessageInterface
#include <
gps.h
>
Giao diện mở rộng để hỗ trợ báo cáo thông báo điều hướng GPS.
Định nghĩa tại dòng
2157
của tệp
gps.h
.
Dừng cập nhật từ HAL và huỷ đăng ký các quy trình gọi lại. Sau khi lệnh gọi dừng, HAL phải coi các lệnh gọi lại đã đăng ký trước đó là không hợp lệ. Nếu lệnh dừng được gọi mà không có lệnh "khởi chạy" trước đó, thì hàm này sẽ không thực hiện bất kỳ thao tác nào.
Định nghĩa tại dòng
2181
của tệp
gps.h
.
Khởi chạy giao diện và đăng ký các quy trình gọi lại với HAL. Sau khi gọi thành công lệnh "init", HAL phải bắt đầu cung cấp nội dung cập nhật khi có.
Trạng thái: GPS_NAVIGATION_MESSAGE_OPERATION_SUCCESS GPS_NAVIGATION_MESSAGE_ERROR_ALREADY_INIT – nếu một lệnh gọi lại đã được đăng ký mà không có lệnh gọi tương ứng để "đóng". GPS_NAVIGATION_MESSAGE_ERROR_GENERIC – nếu xảy ra lỗi nào khác, HAL dự kiến sẽ không tạo bất kỳ nội dung cập nhật nào khi trả về mã lỗi này.
Định nghĩa tại dòng
2173
của tệp
gps.h
.
Đặt thành sizeof(GpsNavigationMessageInterface)
Định nghĩa tại dòng
2159
của tệp
gps.h
.
Tài liệu cho cấu trúc này được tạo từ tệp sau:
-
hardware/libhardware/include/hardware/
gps.h
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[],null,["# Android Hardware Abstraction Layer: GpsNavigationMessageInterface Struct Reference\n\nGpsNavigationMessageInterface Struct Reference\n==============================================\n\n[Data Fields](#pub-attribs) \nGpsNavigationMessageInterface 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_navigation_message_interface#a854352f53b148adc24983a58a1866d66) |\n| ||\n| int(\\* | [init](/reference/hal/struct_gps_navigation_message_interface#aff4b47b76fd1ebedee4ef8f23e1fd850) )( [GpsNavigationMessageCallbacks](/reference/hal/struct_gps_navigation_message_callbacks) \\*callbacks) |\n| ||\n| void(\\* | [close](/reference/hal/struct_gps_navigation_message_interface#a9736ff1cda7d1d558f5cd251e0049c49) )() |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nExtended interface for GPS navigation message reporting support.\n\n\nDefinition at line\n[2157](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(\\* close)() |\n\n\nStops updates from the HAL, and unregisters the callback routines. After a call to stop, the previously registered callbacks must be considered invalid by the HAL. If stop is invoked without a previous 'init', this function should perform no work.\n\n\nDefinition at line\n[2181](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| int(\\* init)( [GpsNavigationMessageCallbacks](/reference/hal/struct_gps_navigation_message_callbacks) \\*callbacks) |\n\n\nInitializes the interface and registers the callback routines with the HAL. After a successful call to 'init' the HAL must begin to provide updates as they become available.\n\n\nStatus: GPS_NAVIGATION_MESSAGE_OPERATION_SUCCESS GPS_NAVIGATION_MESSAGE_ERROR_ALREADY_INIT - if a callback has already been registered without a corresponding call to 'close'. GPS_NAVIGATION_MESSAGE_ERROR_GENERIC - if any other error occurred, it is expected that the HAL will not generate any updates upon returning this error code.\n\n\nDefinition at line\n[2173](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(GpsNavigationMessageInterface)\n\n\nDefinition at line\n[2159](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)"]]