This library provides a lightweight, thin client for interfacing with the platform's OnDeviceIntelligenceManager directly. It serves as an alternative for accessing on-device AI capabilities without requiring strict external dependencies or heavy external AiCore SDK AARs.
It abstracts the custom wire-format serialization engine (SafeParcelable) and pure data models for prompt requests and responses (GenerateContentRequest, GenerateContentResponse, etc.).
Add the following to the static_libs section of your Android.bp:
android_app { // or android_library name: "your_module_name", ... static_libs: [ "ondeviceintelligence-client", ], plugins: [ "safeparcel-processor", // If you need to generate creators for custom SafeParcelables ], }
[!NOTE] Since this library compiles against full platform APIs (
platform_apis: true), your consuming module must also be allowed to access platform APIs (e.g., be a system app withplatform_apis: true). It cannot be used by vendor modules that are restricted tosystem_current.