Skip to main content

Crate ohos_basic_services_kit_sys

Crate ohos_basic_services_kit_sys 

Source
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:

ModuleFeatureLibraryMin API
commonevent / commonevent_supportcommoneventlibohcommonevent.so12
battery_infobattery-infolibohbattery_info.so13
[print]printlibohprint.so12
scanscanlibohscan.so12
os_account / os_account_commonos-accountlibos_account_ndk.so12
time_servicetime-servicelibtime_service_ndk.so12

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). Requires api-12.
  • battery-info — Enables the BatteryInfo NDK (libohbattery_info.so). Requires api-13.
  • print — Enables the Print NDK (libohprint.so). Requires api-12.
  • scan — Enables the Scan NDK (libohscan.so). Requires api-12.
  • os-account — Enables the OS Account NDK (libos_account_ndk.so). Requires api-12.
  • time-service — Enables the Time Service NDK (libtime_service_ndk.so). Requires api-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 CommonEvent SENDING_LIMIT_EXCEEDED error 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_infobattery-info and api-13
commoneventcommonevent and api-12
commonevent_supportcommonevent and api-12
os_accountos-account and api-12
os_account_commonos-account and api-12
printprint and api-12
scanscan and api-12
time_servicetime-service and api-12