harmony(鸿蒙)电源服务子系统JS API变更

2022-08-09 浏览 (895)

电源服务子系统JS API变更

OpenHarmony 3.2 Beta1版本相较于OpenHarmony 3.1 Release版本,电源服务子系统的API变更如下:

接口变更

模块名类名方法/属性/枚举/常量变更类型
ohos.batteryinfoCommonEventBatteryChangedCodeEXTRA_TECHNOLOGY新增
ohos.batteryinfoCommonEventBatteryChangedCodeEXTRA_PRESENT新增
ohos.batteryinfoCommonEventBatteryChangedCodeEXTRA_CHARGE_COUNTER新增
ohos.batteryinfoCommonEventBatteryChangedCodeEXTRA_CHARGE_STATE新增
ohos.batteryinfoCommonEventBatteryChangedCodeEXTRA_MAX_VOLTAGE新增
ohos.batteryinfoCommonEventBatteryChangedCodeEXTRA_MAX_CURRENT新增
ohos.batteryinfoCommonEventBatteryChangedCodeEXTRA_PLUGGED_TYPE新增
ohos.batteryinfoCommonEventBatteryChangedCodeEXTRA_HEALTH_STATE新增
ohos.batteryinfoCommonEventBatteryChangedCodeEXTRA_TEMPERATURE新增
ohos.batteryinfoCommonEventBatteryChangedCodeEXTRA_VOLTAGE新增
ohos.batteryinfoCommonEventBatteryChangedCodeEXTRA_SOC = 0新增
ohos.batteryinfoBatteryCapacityLevelLEVEL_CRITICAL新增
ohos.batteryinfoBatteryCapacityLevelLEVEL_LOW新增
ohos.batteryinfoBatteryCapacityLevelLEVEL_NORMAL新增
ohos.batteryinfoBatteryCapacityLevelLEVEL_HIGH新增
ohos.batteryinfoBatteryCapacityLevelLEVEL_FULL新增
ohos.batteryinfoBatteryCapacityLevelLEVEL_NONE新增
ohos.batteryinfobatteryInfoconst remainingEnergy: number;新增
ohos.batteryinfobatteryInfoconst nowCurrent: number;新增
ohos.batteryinfobatteryInfoconst totalEnergy: number;新增
ohos.batteryinfobatteryInfoconst estimatedRemainingChargeTime: number;新增
ohos.batteryinfobatteryInfoconst batteryCapacityLevel: BatteryCapacityLevel;新增
ohos.powerDevicePowerModeMODE_EXTREME_POWER_SAVE新增
ohos.powerDevicePowerModeMODE_PERFORMANCE新增
ohos.powerDevicePowerModeMODE_POWER_SAVE新增
ohos.powerDevicePowerModeMODE_NORMAL = 600新增
ohos.powerpowersetPowerMode(mode: DevicePowerMode, callback: AsyncCallback<void>): void;
setPowerMode(mode: DevicePowerMode): Promise<void>;
新增
ohos.powerpowergetPowerMode(callback: AsyncCallback<DevicePowerMode>): void;
getPowerMode(): Promise<DevicePowerMode>;
新增
ohos.powerpowersuspendDevice(): void;新增
ohos.powerpowerwakeupDevice(detail: string): void;新增

你可能感兴趣的鸿蒙文章

harmony(鸿蒙)Readme

harmony(鸿蒙)元能力子系统JS API变更

harmony(鸿蒙)ArkUI子系统JS API变更

harmony(鸿蒙)包管理子系统JS API变更

harmony(鸿蒙)基础通信子系统JS API变更

harmony(鸿蒙)DFX子系统JS API变更

harmony(鸿蒙)分布式数据管理子系统JS API变更

harmony(鸿蒙)事件通知子系统JS API变更

harmony(鸿蒙)文件管理子系统JS API变更

harmony(鸿蒙)全球化子系统JS API变更

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/1341e8f6ace04b209f2d73bb02867ffc