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