support tv Created-by: atreeof_wind Commit-by: atreeof_wind Merged-by: openharmony_ci Description: ### 一、内容说明(相关的Issue) https://gitcode.com/openharmony/powermgr_powermgr_cangjie_wrapper/issues/29 ### 二、建议测试周期和提测地址 建议测试完成时间:xxxx.xx.xx 投产上线时间:xxxx.xx.xx 提测地址:CI环境/压测环境 测试账号: ### 三、变更内容 * 3.1 关联PR列表 * 3.2 数据库和部署说明 1. 常规更新 2. 重启unicorn 3. 重启sidekiq 4. 迁移任务:是否有迁移任务,没有写 "无" 5. rake脚本:`bundle exec xxx RAILS_ENV = production`;没有写 "无" * 3.4 其他技术优化内容(做了什么,变更了什么) - 适配测试用例 * 3.5 废弃通知(什么字段、方法弃用?) * 3.6 后向不兼容变更(是否有无法向后兼容的变更?) ### 四、研发自测点(自测哪些?冒烟用例全部自测?) 自测测试结论:PASS ### 五、测试关注点(需要提醒QA重点关注的、可能会忽略的地方) 检查点: | 需求名称 | 是否影响xx公共模块 | 是否需要xx功能 | 需求升级是否依赖其他子产品 | |------|------------|----------|---------------| | xxx | 否 | 需要 | 不需要 | | | | | | 接口测试: 性能测试: 并发测试: 其他: See merge request: openharmony/powermgr_powermgr_cangjie_wrapper!46
powermgr_cangjie_wrapper(beta feature)
Introduction
The powermgr_cangjie_wrapper is a Cangjie API encapsulated on OpenHarmony for application developers to provide battery status and charge-discharge status query capabilities. The currently open power service Cangjie interface only supports standard devices.
Figure 1 powermgr_cangjie_wrapper architecture
As shown in the architecture diagram:
Interface layer description:
- Battery Service API: Cangjie public interfaces based on battery service encapsulation exposed to developers.
Framework layer description:
- Battery Service Wrapper: Provides battery level information query, charger type enumeration, battery status enumeration, and additional information query enumeration methods. This encapsulation layer is a Cangjie encapsulation implementation of battery service functionality based on the power management service.
Cangjie Power Service Dependencies:
- Power Management Service: Calls the underlying power driver to provide native basic power management service functionality implementation.
- Cangjie Interop: Encapsulates public interfaces for C language interoperation, and provides Cangjie tag class implementation for annotating Cangjie APIs, as well as providing BusinessException exception class definitions thrown to users.
Directory Structure
base/powermgr/powermgr_cangjie_wrapper
├── figures # architecture pictures
├── ohos # Cangjie Power Management code
│ └── battery_info # Cangjie battery_info code
├── test # Test cases
│ └── battery_info # Battery service tests
└── bundle.json # Component description file
Usage
The following power service functions are provided:
- Battery Service: Supports charging and discharging, and displays information on battery and charging status
Power service usage examples please refer to Battery Information Development Guide.
Constraints
Compared with the API capabilities provided by ArkTS, the following functions are currently not supported:
- Restart Service: System restart and power off
- System Power Management Service: System power status management and sleep running lock management
- Display-related energy consumption adjustment: Including adjusting backlight brightness according to ambient light, and turning the screen on and off according to proximity light
- Power saving mode: Provides a low-power operation mode without damaging main functions and performance
- Battery service: Battery status detection, including status updates and reporting, as well as shutdown charging
- Temperature control: After the device temperature reaches a certain level, manage applications, SoC, and peripherals to limit temperature rise
- Power consumption statistics: Mainly includes software power consumption and hardware power consumption statistics, as well as power consumption statistics for individual applications
- Battery service for lightweight devices
- Power management service for lightweight devices
Code Contribution
Developers are welcome to contribute code, documentation, etc. For specific contribution processes and methods, please refer to Code Contribution.
