Android Battery Management System

1、 Android Battery Service

Android Battery Service is used to monitor the battery events reported by the kernel and report the latest battery data to the system. After receiving the new data, the system will update the battery display status, remaining power and other information. If the over temperature alarm and low power alarm are received, the system will automatically trigger the shutdown process to protect the battery and machine from harm.

Startup and operation process of Android Battery Service:

Source code structure of battery service

Framework\base\services\java\com\android\server ├── SystemServer. Create batteryservices, powermanagerservice and activitymanagerservice in Java -- batterysevices Java listens to the battery events reported by the bottom layer and broadcasts the message of battery change framework \ base \ services \ Java \ com \ Android \ server \ am ♪ -- activitymanagerservice Create batterystatsservice in Java -- batterystatsservice Java counts and records battery parameter information framework \ base \ services \ Java \ com \ Android \ server \ power ♪ -- powermanagerservice Java monitors broadcast messages of battery changes and adjusts the power status of the system, such as bright screen framework \ base \ core \ Java \ com \ internal \ OS \ -- batterystatisimpl Java counts and records the information of battery parameters and notifies other modules system \ core \ Healthd ♪ -- Healthd CPP creates uevent socket and listens for kernel events reported by the kernel -- batterymonitor CPP initializes the local battery data structure_ Fill in the path of the attribute node under the supply path, and enter batterymonitor h ├── BatteryPropertiesRegistrar. CPP creates a battery property listener and registers it in the system service of Android - batterypropertiesregistrar h

2、 Healthd

The model listens down to the battery events from the bottom layer and transmits the battery data information upward to the batteryservice of the framework layer to calculate the battery power related information. The batteryservice calculates the battery power and other information through the transmitted data. Therefore, Healthd plays a connecting role in the battery management system.

In depth analysis of the specific call process of Healthd Android 5 1 Healthd this article is very clear.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>