自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
FlpBatchOptions 結構體參考資料
#include <
fused_location.h
>
使用批次處理 FLP API 的選項
定義位於檔案
fused_location.h
的
258
行。
FLP_BATCH_WAKEUP_ON_FIFO_FULL - 如果設定此值,硬體會在緩衝區已滿時喚醒 AP。如果未設定,硬體會捨棄最舊的位置物件。
FLP_BATCH_CALLBACK_ON_LOCATION_FIX - 如果設定此值,系統會在每次有位置修正時呼叫位置回呼。如果上層 (呼叫端) 知道 AP 可能會進入休眠狀態,則有責任將其關閉。在批次處理工作階段中,如果這個位元開啟,則應在即時回報位置修正資訊時繼續進行批次處理。
日後要以位元運算 OR 的其他旗標。
定義位於檔案
fused_location.h
的
284
行。
double max_power_allocation_mW
|
基礎實作項目可為此批次呼叫使用的最大功率 (以 mW 為單位)。如果 max_power_allocation_mW 為 0,系統只會回報不需額外耗電的修正項目。
定義位於檔案
fused_location.h
的
265
行。
float smallest_displacement_meters
|
兩個回報位置之間的最小位移量,以公尺為單位。
如果設為 0,即使裝置處於靜止狀態,您也應按照要求的間隔回報位置。如果為正值,您可以使用這個參數做為省電提示 (例如,如果使用者未移動到接近位移閾值,就限制位置期間)。即使是小正值,也可能表示您不必在裝置靜止時計算位置。
您不需要根據這個參數篩選地區放送。即使位置的位移距離小於要求值,位置資訊仍可傳送。您可以放心忽略這個參數,但可能會犧牲省電的潛力。
定義位於檔案
fused_location.h
的
307
行。
這個結構體的說明文件是由下列檔案產生:
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。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: FlpBatchOptions Struct Reference\n\nFlpBatchOptions Struct Reference\n================================\n\n[Data Fields](#pub-attribs) \nFlpBatchOptions Struct Reference \n\n`\n#include \u003c\n`[fused_location.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)`\n\u003e\n`\n\n|----------|-----------------------------------------------------------------------------------------------------------|\n| Data Fields ----------- ||\n| double | [max_power_allocation_mW](/reference/hal/struct_flp_batch_options#ae300330f3b7cb10809a7e67735e02410) |\n| ||\n| uint32_t | [sources_to_use](/reference/hal/struct_flp_batch_options#a352dd652f7b9c6033433ad53089fe281) |\n| ||\n| uint32_t | [flags](/reference/hal/struct_flp_batch_options#a773b39d480759f67926cb18ae2219281) |\n| ||\n| int64_t | [period_ns](/reference/hal/struct_flp_batch_options#a9d1968cb4382e5653d8d5a31c8a2ee6b) |\n| ||\n| float | [smallest_displacement_meters](/reference/hal/struct_flp_batch_options#a1b30671f2f5bdad79f87fdd30f6bb8a8) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nOptions with the batching FLP APIs\n\n\nDefinition at line\n[258](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)\nof file\n[fused_location.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)\n.\n\nField Documentation\n-------------------\n\n\n|----------------|\n| uint32_t flags |\n\n\nFLP_BATCH_WAKEUP_ON_FIFO_FULL - If set the hardware will wake up the AP when the buffer is full. If not set, the hardware will drop the oldest location object.\n\n\nFLP_BATCH_CALLBACK_ON_LOCATION_FIX - If set the location callback will be called every time there is a location fix. Its the responsibility of the upper layers (caller) to switch it off, if it knows that the AP might go to sleep. When this bit is on amidst a batching session, batching should continue while location fixes are reported in real time.\n\n\nOther flags to be bitwised ORed in the future.\n\n\nDefinition at line\n[284](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)\nof file\n[fused_location.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)\n.\n\n|--------------------------------|\n| double max_power_allocation_mW |\n\n\nMaximum power in mW that the underlying implementation can use for this batching call. If max_power_allocation_mW is 0, only fixes that are generated at no additional cost of power shall be reported.\n\n\nDefinition at line\n[265](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)\nof file\n[fused_location.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)\n.\n\n|-------------------|\n| int64_t period_ns |\n\n\nFrequency with which location needs to be batched in nano seconds.\n\n\nDefinition at line\n[290](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)\nof file\n[fused_location.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)\n.\n\n|------------------------------------|\n| float smallest_displacement_meters |\n\n\nThe smallest displacement between reported locations in meters.\n\n\nIf set to 0, then you should report locations at the requested interval even if the device is stationary. If positive, you can use this parameter as a hint to save power (e.g. throttling location period if the user hasn't traveled close to the displacement threshold). Even small positive values can be interpreted to mean that you don't have to compute location when the device is stationary.\n\n\nThere is no need to filter location delivery based on this parameter. Locations can be delivered even if they have a displacement smaller than requested. This parameter can safely be ignored at the cost of potential power savings.\n\n\nDefinition at line\n[307](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)\nof file\n[fused_location.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)\n.\n\n|-------------------------|\n| uint32_t sources_to_use |\n\n\nBitwise OR of the FLP_TECH_MASKS to use\n\n\nDefinition at line\n[268](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)\nof file\n[fused_location.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)\n.\n\n*** ** * ** ***\n\nThe documentation for this struct was generated from the following file:\n\n- hardware/libhardware/include/hardware/ [fused_location.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/fused_location.h)"]]