1# Power Subsystem Changelog 2 3## cl.powermgr.1 CommonEventBatteryChangedCode API Change 4 5Changed the **CommonEventBatteryChangedCode** enum class in [@ohos.batteryInfo](../../../application-dev/reference/apis/js-apis-battery-info.md) as follows: 6 7- Changed the class name to **CommonEventBatteryChangedKey**. 8- Deleted **EXTRA_MAX_CURRENT**, **EXTRA_MAX_VOLTAGE**, and **EXTRA_CHARGE_COUNTER**. 9- Changed the enum value type from numeric to string. 10 11#### Change Impact 12 13The JS API needs to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected. 14 15#### Key API/Component Changes 16 17Before change: 18 19| Name | Value | Description | 20| -------------------- | ---- | -------------------------------------------------- | 21| EXTRA_SOC | 0 | Remaining battery level in percentage. | 22| EXTRA_VOLTAGE | 1 | Battery voltage of the device. | 23| EXTRA_TEMPERATURE | 2 | Battery temperature of the device. | 24| EXTRA_HEALTH_STATE | 3 | Battery health status of the device. | 25| EXTRA_PLUGGED_TYPE | 4 | Type of the charger connected to the device. | 26| EXTRA_MAX_CURRENT | 5 | Maximum battery current of the device. | 27| EXTRA_MAX_VOLTAGE | 6 | Maximum battery voltage of the device. | 28| EXTRA_CHARGE_STATE | 7 | Battery charging status of the device. | 29| EXTRA_CHARGE_COUNTER | 8 | Number of battery charging times of the device. | 30| EXTRA_PRESENT | 9 | Whether the battery is supported by the device or installed.| 31| EXTRA_TECHNOLOGY | 10 | Battery technology of the device. | 32| EXTRA_CAPACITY_LEVEL | 11 | Battery level of the device. | 33 34After change: 35 36| Name | Value | Description | 37| -------------------- | --------------- | -------------------------------------------------- | 38| EXTRA_SOC | "soc" | Remaining battery level in percentage. | 39| EXTRA_CHARGE_STATE | "chargeState" | Battery charging status of the device. | 40| EXTRA_HEALTH_STATE | "healthState" | Battery health status of the device. | 41| EXTRA_PLUGGED_TYPE | "pluggedType" | Type of the charger connected to the device. | 42| EXTRA_VOLTAGE | "voltage" | Battery voltage of the device. | 43| EXTRA_TECHNOLOGY | "technology" | Battery technology of the device. | 44| EXTRA_TEMPERATURE | "temperature" | Battery temperature of the device. | 45| EXTRA_PRESENT | "present" | Whether the battery is supported by the device or installed.| 46| EXTRA_CAPACITY_LEVEL | "capacityLevel" | Battery level of the device. | 47 48#### Adaptation Guide 49 50For details, see the API reference of the [@ohos.batteryInfo](../../../application-dev/reference/apis/js-apis-battery-info.md) API. 51## cl.powermgr.2 estimatedRemainingChargeTime API Change 52 53Changed the **estimatedRemainingChargeTime** API in [@ohos.batteryInfo](../../../application-dev/reference/apis/js-apis-battery-info.md) to a system API. 54 55#### Change Impact 56 57The JS API needs to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected. 58 59#### Adaptation Guide 60 61For details, see the API reference of the [@ohos.batteryInfo](../../../application-dev/reference/apis/js-apis-battery-info.md) API. 62 63## cl.powermgr.3 System Common Event Behavior Change 64 65The following common events are provided in the battery information through [@ohos.commonEventManager (common event module)](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-commonEventManager.md): 66 67- COMMON_EVENT_BATTERY_LOW: common event for low battery level. It includes the remaining battery in percentage. 68- COMMON_EVENT_BATTERY_OKAY: common event for normal battery level. It includes the remaining battery in percentage. 69- COMMON_EVENT_POWER_CONNECTED: common event for connection to an external power supply. It includes the type of the power supply to which the device is connected. 70- COMMON_EVENT_POWER_DISCONNECTED: common event for disconnection from an external power supply. It includes the type of the power supply from which the device is disconnected. 71- COMMON_EVENT_CHARGING: common event for starting of battery charging. It includes the battery charging status. 72- COMMON_EVENT_DISCHARGING: common event for ending of battery charging. It includes the battery charging status. 73 74Changed the method of obtaining data from common events from **CommonEventData.data** to **CommonEventData.code**. 75 76#### Change Impact 77 78The application developed based on earlier versions needs to adapt the method for obtaining common events in the battery information. Otherwise, the original service logic will be affected. 79 80#### Adaptation Guide 81 82For details, see the API reference of the [@ohos.commonEventManager (Common Event Manager)](../../../application-dev/reference/apis/js-apis-commonEventManager.md) API. 83