自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
AGpsRilInterface 結構體參考資料
#include <
gps.h
>
擴充 AGPS_RIL 支援的介面。
定義位於檔案
gps.h
的第
1145
行。
開啟 AGPS 介面,並為此介面的實作提供回呼例程式。
定義位於檔案
gps.h
的
1152
行。
void(* ni_message)(uint8_t *msg, size_t len)
|
void(* set_ref_location)(const
AGpsRefLocation
*agps_reflocation, size_t sz_struct)
|
設為 sizeof(AGpsRilInterface)
定義位於檔案
gps.h
的
1147
行。
void(* update_network_availability)(int avaiable, const char *apn)
|
通知 GPS 網路狀態變更。這些參數與 android.net.NetworkInfo 類別中的值相符。
定義位於檔案
gps.h
的
1178
行。
void(* update_network_state)(int connected, int type, int roaming, const char *extra_info)
|
通知 GPS 網路狀態變更。這些參數會與 android.net.NetworkInfo 類別中的值相符。
定義位於檔案
gps.h
的
1172
行。
這個結構體的說明文件是由下列檔案產生:
-
hardware/libhardware/include/hardware/
gps.h
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","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 (世界標準時間)。"],[],[],null,["# Android Hardware Abstraction Layer: AGpsRilInterface Struct Reference\n\nAGpsRilInterface Struct Reference\n=================================\n\n[Data Fields](#pub-attribs) \nAGpsRilInterface 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_a_gps_ril_interface#a854352f53b148adc24983a58a1866d66) |\n| ||\n| void(\\* | [init](/reference/hal/struct_a_gps_ril_interface#a6ecde4533873a8523bcc21de388ffa9a) )( [AGpsRilCallbacks](/reference/hal/struct_a_gps_ril_callbacks) \\*callbacks) |\n| ||\n| void(\\* | [set_ref_location](/reference/hal/struct_a_gps_ril_interface#a89daae6f347b02451c9e590e3aed4bc3) )(const [AGpsRefLocation](/reference/hal/struct_a_gps_ref_location) \\*agps_reflocation, size_t sz_struct) |\n| ||\n| void(\\* | [set_set_id](/reference/hal/struct_a_gps_ril_interface#a9e37e6820e27545df93790487e08e062) )( [AGpsSetIDType](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h) type, const char \\*setid) |\n| ||\n| void(\\* | [ni_message](/reference/hal/struct_a_gps_ril_interface#a47a5dbc152e1bfef40da67acc92352a4) )(uint8_t \\*msg, size_t len) |\n| ||\n| void(\\* | [update_network_state](/reference/hal/struct_a_gps_ril_interface#a18f3edddb80356092dd97986b41271cd) )(int connected, int type, int roaming, const char \\*extra_info) |\n| ||\n| void(\\* | [update_network_availability](/reference/hal/struct_a_gps_ril_interface#a4057912a4ed5c39cafce1eee01b19159) )(int avaiable, const char \\*apn) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nExtended interface for AGPS_RIL support.\n\n\nDefinition at line\n[1145](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(\\* init)( [AGpsRilCallbacks](/reference/hal/struct_a_gps_ril_callbacks) \\*callbacks) |\n\n\nOpens the AGPS interface and provides the callback routines to the implementation of this interface.\n\n\nDefinition at line\n[1152](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(\\* ni_message)(uint8_t \\*msg, size_t len) |\n\n\nSend network initiated message.\n\n\nDefinition at line\n[1166](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(\\* set_ref_location)(const [AGpsRefLocation](/reference/hal/struct_a_gps_ref_location) \\*agps_reflocation, size_t sz_struct) |\n\n\nSets the reference location.\n\n\nDefinition at line\n[1157](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(\\* set_set_id)( [AGpsSetIDType](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/gps.h) type, const char \\*setid) |\n\n\nSets the set ID.\n\n\nDefinition at line\n[1161](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(AGpsRilInterface)\n\n\nDefinition at line\n[1147](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(\\* update_network_availability)(int avaiable, const char \\*apn) |\n\n\nNotify GPS of network status changes. These parameters match values in the android.net.NetworkInfo class.\n\n\nDefinition at line\n[1178](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(\\* update_network_state)(int connected, int type, int roaming, const char \\*extra_info) |\n\n\nNotify GPS of network status changes. These parameters match values in the android.net.NetworkInfo class.\n\n\nDefinition at line\n[1172](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)"]]