fadedbee
fadedbee

Reputation: 44807

Controlling the AOSP power-reporting functionality from new code

In the Android Open Source Project, where would I add/override the code which tells Android about the battery level and AC power?

I need to poll a component on an i2c bus to get this information, on my board, and pass it to Android.

Upvotes: 2

Views: 273

Answers (1)

Simpl
Simpl

Reputation: 2046

It depends on your Android version:

Oreo and Newer

You have to replace the existing Health HAL service with a custom one that provides the information you want. You don't have to write the service from scratch but change the provided dummy implementation.

Nougat and Older

These version do not yet have a Health HAL. You have to update the healthd directly in system/core/healthd.

Upvotes: 3

Related Questions