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 FlpBatchOptions
#include <
fused_location.h
>
Các tuỳ chọn với API FLP theo lô
Định nghĩa tại dòng
258
của tệp
fused_location.h
.
FLP_BATCH_WAKEUP_ON_FIFO_FULL – Nếu được đặt, phần cứng sẽ đánh thức AP khi vùng đệm đầy. Nếu bạn không đặt, phần cứng sẽ loại bỏ đối tượng vị trí cũ nhất.
FLP_BATCH_CALLBACK_ON_LOCATION_FIX – Nếu được đặt, lệnh gọi lại vị trí sẽ được gọi mỗi khi có bản sửa lỗi vị trí. Các lớp trên (phương thức gọi) có trách nhiệm tắt tính năng này nếu biết rằng AP có thể chuyển sang trạng thái ngủ. Khi bit này đang bật trong một phiên xử lý hàng loạt, quá trình xử lý hàng loạt sẽ tiếp tục trong khi các bản sửa lỗi vị trí được báo cáo theo thời gian thực.
Các cờ khác sẽ được OR theo bit trong tương lai.
Định nghĩa tại dòng
284
của tệp
fused_location.h
.
double max_power_allocation_mW
|
Công suất tối đa tính bằng mW mà phương thức triển khai cơ bản có thể sử dụng cho lệnh gọi theo lô này. Nếu max_power_allocation_mW là 0, thì chỉ những bản sửa lỗi được tạo mà không làm tăng thêm chi phí điện năng mới được báo cáo.
Định nghĩa tại dòng
265
của tệp
fused_location.h
.
Tần suất cần gửi thông tin vị trí theo lô tính bằng nano giây.
Định nghĩa tại dòng
290
của tệp
fused_location.h
.
float smallest_displacement_meters
|
Độ dịch chuyển nhỏ nhất giữa các vị trí được báo cáo tính bằng mét.
Nếu đặt thành 0, bạn nên báo cáo vị trí theo khoảng thời gian yêu cầu ngay cả khi thiết bị đứng yên. Nếu giá trị là dương, bạn có thể sử dụng tham số này làm gợi ý để tiết kiệm pin (ví dụ: điều tiết khoảng thời gian vị trí nếu người dùng chưa di chuyển gần đến ngưỡng dịch chuyển). Ngay cả các giá trị dương nhỏ cũng có thể được diễn giải là bạn không cần tính toán vị trí khi thiết bị đứng yên.
Bạn không cần lọc chế độ phân phối theo vị trí dựa trên tham số này. Bạn có thể phân phối vị trí ngay cả khi vị trí đó có độ dịch chuyển nhỏ hơn yêu cầu. Bạn có thể bỏ qua thông số này một cách an toàn với chi phí là khả năng tiết kiệm điện năng.
Định nghĩa tại dòng
307
của tệp
fused_location.h
.
Toán tử OR bit của FLP_TECH_MASKS cần sử dụng
Định nghĩa tại dòng
268
của tệp
fused_location.h
.
Tài liệu cho cấu trúc này được tạo từ tệp sau:
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: 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)"]]