power-management.md 3.8 KB
Newer Older
M
mamingshuai 已提交
1
# Power Management<a name="EN-US_TOPIC_0000001121107655"></a>
L
liudongmiao 已提交
2 3 4

-   [Introduction](#section11660541593)
-   [Directory Structure](#section19472752217)
M
mamingshuai 已提交
5
-   [Usage](#section19959125052315)
L
liudongmiao 已提交
6 7 8 9
-   [Repositories Involved](#section63151229062)

## Introduction<a name="section11660541593"></a>

S
shawn_he 已提交
10
The power management subsystem provides the following functions:
L
liudongmiao 已提交
11

S
shawn_he 已提交
12 13 14 15 16 17 18 19 20
1.  System restarting: restarts or shuts down the system.
2.  System power management: manages the system power status and running lock.
3.  Display-related power consumption adjustment: adjusts the backlight brightness based on the ambient light and turns off the screen based on the proximity light.
4.  Power saving: works in low power consumption mode without compromising main functions and performance.
5.  Battery management: supports charging and discharging, battery and charging status monitoring (including status updating and reporting), and charging upon power-off.
6.  Temperature control: restricts temperature rise through application, SoC, and peripheral control when the device temperature reaches the specified limit.
7.  Power consumption statistics: collects statistics on the power consumption of software, hardware, and a single application.
8.  Battery service for mini-, small-, and standard-system devices
9.  Power management service for mini-, small-, and standard-system devices
L
liudongmiao 已提交
21

S
shawn_he 已提交
22
**Figure  1**  Power management subsystem architecture<a name="fig7607759319"></a>
L
liudongmiao 已提交
23 24


M
mamingshuai 已提交
25
![](figures/power-management-subsystem-architecture.png)
L
liudongmiao 已提交
26 27 28 29

## Directory Structure<a name="section19472752217"></a>

```
M
mamingshuai 已提交
30
/base/powermgr
S
shawn_he 已提交
31 32 33 34 35 36 37
├── battery_lite			# Battery service for mini-, small-, and standard-system devices
├── battery_manager			# Battery service
├── battery_statistics		# Power consumption statistics service
├── display_manager			# Display energy efficiency management service
├── power_manager			# System power management service
├── powermgr_lite			# Power management service for mini-, small-, and standard-system devices
└── thermal_manager			# Temperature control and thermal management service
L
liudongmiao 已提交
38 39
```

M
mamingshuai 已提交
40 41
## Usage<a name="section19959125052315"></a>

S
shawn_he 已提交
42 43 44 45 46 47
As shown in the system architecture, the power management subsystem consists of seven modules. Some modules provide external APIs or public event notifications. You can use them based on your use cases. The functions of key modules are described as follows:

- Power Manager: provides APIs to request and release the running lock, enable the power saving mode, adjust the brightness, and restart or power off the device. It also provides public events for you to observe changes of the power saving mode and power-off status.
- Battery Manager: provides APIs to query battery information. It also provides public events for you to observer changes of the battery status and charging/discharging status.
- Thermal Manager: provides APIs to query the temperature rise status of a device. It also allows you to register callbacks and public events to listen for the temperature rise status of a device.
- Battery Statistics: provides power consumption statistics on hardware and software. It allows you to query the power consumption of hardware or applications.
M
mamingshuai 已提交
48

L
liudongmiao 已提交
49 50
## Repositories Involved<a name="section63151229062"></a>

S
shawn_he 已提交
51 52 53 54 55 56 57
**Power Management Subsystem**

[powermgr_power_manager](https://gitee.com/openharmony/powermgr_power_manager)

[powermgr_display_manager](https://gitee.com/openharmony/powermgr_display_manager)

[powermgr_battery_manager](https://gitee.com/openharmony/powermgr_battery_manager)
M
mamingshuai 已提交
58

S
shawn_he 已提交
59
[powermgr_thermal_manager](https://gitee.com/openharmony/powermgr_thermal_manager)
M
mamingshuai 已提交
60

S
shawn_he 已提交
61
[powermgr_battery_statistics](https://gitee.com/openharmony/powermgr_battery_statistics)
M
mamingshuai 已提交
62

S
shawn_he 已提交
63
[powermgr_battery_lite](https://gitee.com/openharmony/powermgr_battery_lite)
M
mamingshuai 已提交
64

S
shawn_he 已提交
65
[powermgr_powermgr_lite](https://gitee.com/openharmony/powermgr_powermgr_lite)