harmony 鸿蒙Power Subsystem ChangeLog
Power Subsystem ChangeLog
cl.powermgr.1 Error Information Return Method Change of APIs
The following APIs used service logic return values to indicate error information, which did not comply with the error code specifications of OpenHarmony. Therefore, they are modified in API version 9 and later.
- Power consumption statistics: @ohos.batteryStatistics
- Brightness: @ohos.brightness
- Power manager: @ohos.power
- RunningLock: @ohos.runningLock
- Thermal manager: @ohos.thermal
Asynchronous API: An error message is returned via AsyncCallback or the error object of Promise.
Synchronous API: An error message is returned via an exception.
Change Impacts
The application developed based on earlier versions needs to adapt the method for returning API error information. Otherwise, the original service logic will be affected.
Key API/Component Changes
Error code processing is added for the following APIs:
- getBatteryStats(callback: AsyncCallback
Adaptation Guide
For details, see the API reference document of each API.
cl.powermgr.2 System API Change
Change Impacts
The application developed based on earlier versions needs to adapt to new API names and the new method for returning API error information. Otherwise, the original service logic will be affected.
Key API/Component Changes
Bundle Name | Original API | New API |
---|---|---|
@ohos.power | shutdownDevice(reason: string): void | shutdown(reason: string): void |
@ohos.power | rebootDevice(reason: string): void | reboot(reason: string): void |
@ohos.power | wakeupDevice(detail: string): void | wakeup(detail: string): void |
@ohos.power | suspendDevice(): void | suspend(): void |
Adaptation Guide
For details, see @ohos.power.
你可能感兴趣的鸿蒙文章
harmony 鸿蒙Account Subsystem ChangeLog
harmony 鸿蒙ChangeLog of JS API Changes in the Multimedia Subsystem
harmony 鸿蒙Device Manager ChangeLog
harmony 鸿蒙USB Manager ChangeLog
harmony 鸿蒙DSoftBus Subsystem ChangeLog
harmony 鸿蒙File Management Subsystem ChangeLog
harmony 鸿蒙Globalization Subsystem ChangeLog
harmony 鸿蒙Input Method Framework ChangeLog
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦