Expand description
Bindings to the OpenHarmony BasicServicesKit NDK.
§Overview
BasicServicesKit groups several unrelated system-service NDKs under one upstream kit. Each lives in a separate shared library, so this crate exposes each behind its own cargo feature:
| Module | Feature | Library | Min API |
|---|---|---|---|
commonevent / commonevent_support | commonevent | libohcommonevent.so | 12 |
battery_info | battery-info | libohbattery_info.so | 13 |
[print] | print | libohprint.so | 12 |
scan | scan | libohscan.so | 12 |
os_account / os_account_common | os-account | libos_account_ndk.so | 12 |
time_service | time-service | libtime_service_ndk.so | 12 |
A sub-API feature is a no-op unless the matching api-XX feature is also
enabled — i.e. enabling commonevent without api-12 (or higher) leaves
the module hidden and the .so unlinked.
§Feature flags
§Sub-APIs
BasicServicesKit groups several unrelated system-service APIs under one
upstream kit. Each NDK lives in a separate shared library, so each is
exposed behind its own cargo feature. A sub-API feature is a no-op unless
the matching api-XX feature is also enabled (CommonEvent / Print / Scan
/ OS Account / Time Service require api-12; BatteryInfo requires
api-13).
commonevent— Enables the CommonEvent NDK (libohcommonevent.so). Requiresapi-12.battery-info— Enables the BatteryInfo NDK (libohbattery_info.so). Requiresapi-13.print— Enables the Print NDK (libohprint.so). Requiresapi-12.scan— Enables the Scan NDK (libohscan.so). Requiresapi-12.os-account— Enables the OS Account NDK (libos_account_ndk.so). Requiresapi-12.time-service— Enables the Time Service NDK (libtime_service_ndk.so). Requiresapi-12.all-apis— Enables every sub-API in this kit.
§OpenHarmony API level
api-12— Enables bindings for OpenHarmony API-level 12. BasicServicesKit is first available at this API level, so this is the minimum supported feature.api-13— Enables bindings for OpenHarmony API-level 13. Adds BatteryInfo.api-14— Enables bindings for OpenHarmony API-level 14 (No changes).api-15— Enables bindings for OpenHarmony API-level 15 (No changes).api-16— Enables bindings for OpenHarmony API-level 16 (No changes).api-17— Enables bindings for OpenHarmony API-level 17 (No changes).api-18— Enables bindings for OpenHarmony API-level 18. Adds the CommonEvent publish APIs and the ordered-event subscriber APIs.api-19— Enables bindings for OpenHarmony API-level 19 (No changes).api-20— Enables bindings for OpenHarmony API-level 20. Adds the CommonEventSENDING_LIMIT_EXCEEDEDerror variant.api-21— Enables bindings for OpenHarmony API-level 21 (No changes).api-22— Enables bindings for OpenHarmony API-level 22 (No changes).api-23— Enables bindings for OpenHarmony API-level 23 (No changes).
§Internal features
document-features— Document available features when building the documentation
Modules§
- battery_
info battery-infoandapi-13 - commonevent
commoneventandapi-12 - commonevent_
support commoneventandapi-12 - os_
account os-accountandapi-12 - os_
account_ common os-accountandapi-12 - print
printandapi-12 - scan
scanandapi-12 - time_
service time-serviceandapi-12