feat: add Tlp mode and short idle support to power management#161
Conversation
Add TLP mode and short idle state properties and methods to the power management D-Bus interface. This enables new power management capabilities for controlling system power states more granularly. Log: Added TlpMode property and SetTlpMode method for TLP power management, plus ShortIdleState property and SetShortIdleState method for short idle state control Influence: 1. Verify TlpMode property is exposed correctly and returns expected values 2. Test SetTlpMode with valid and invalid mode strings 3. Verify ShortIdleState property correctly reflects current state 4. Test SetShortIdleState with both true and false values 5. Verify no regression in existing power management functionalities 6. Test mock implementations for both new methods and properties feat: 为电源管理模块添加Tlp模式和短idle支持 为电源管理D-Bus接口添加TLP模式和短空闲状态属性和方法。这使得系统电源状态 控制更加精细化。 Log: 新增TlpMode属性和SetTlpMode方法用于TLP电源管理,以及ShortIdleState 属性和SetShortIdleState方法用于短空闲状态控制 Influence: 1. 验证TlpMode属性是否正确暴露并返回预期值 2. 使用有效和无效的模式字符串测试SetTlpMode方法 3. 验证ShortIdleState属性是否正确反映当前状态 4. 测试SetShortIdleState方法,包括true和false值 5. 验证现有电源管理功能无回归 6. 测试新方法和属性的Mock实现 PMS: TASK-389737 Change-Id: Iec37ad890c9fb830c0f08c6514f6471045b614e4
deepin pr auto review你好!我是CodeGeeX。我已仔细审查了你提供的 Git Diff 内容。本次修改主要为 DDE 的电源管理 DBus 接口新增了 以下是我从语法逻辑、代码质量、代码性能和代码安全四个维度提出的审查意见和改进建议: 1. 语法与逻辑
2. 代码质量
3. 代码性能
4. 代码安全
总结本次代码变更主要是接口和绑定代码的扩展,整体结构清晰,与原有代码风格保持了一致。最需要关注的是版权年份的逻辑错误以及后端实现中对 |
mhduiy
left a comment
There was a problem hiding this comment.
Code Review: PR #161
整体来看,XML 定义和自动生成的代码(auto.go、auto_mock.go)符合项目规范,代码结构清晰。有以下几个建议:
建议
-
TlpMode属性仅access="read",是否需要readwrite?- XML 中
TlpMode定义为type="s" access="read",但从 dde-daemon 的实现来看,SetTlpMode方法会间接改变 TLP 的实际配置状态。如果TlpMode属性始终是 read-only,调用方如何通过 property 变化信号感知 TLP 模式已切换?建议确认属性是否应该是readwrite,或者是否有对应的PropertiesChanged信号机制。
- XML 中
-
ShortIdleState同理 - 当前定义为access="read",session 侧通过SetShortIdleState修改状态后,是否有机制通知 property 变化? -
headRefName 为
master- 建议使用 feature 分支提交 PR,避免直接向 master 提交。
细节
- ✅ 自动生成代码风格与现有代码一致
- ✅ Mock 实现完整
- ✅ Copyright 年份更新合理
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fly602, mhduiy, xionglinlin The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Add TLP mode and short idle state properties and methods to the power management D-Bus interface. This enables new power management capabilities for controlling system power states more granularly.
Log: Added TlpMode property and SetTlpMode method for TLP power management, plus ShortIdleState property and SetShortIdleState method for short idle state control
Influence:
feat: 为电源管理模块添加Tlp模式和短idle支持
为电源管理D-Bus接口添加TLP模式和短空闲状态属性和方法。这使得系统电源状态
控制更加精细化。
Log: 新增TlpMode属性和SetTlpMode方法用于TLP电源管理,以及ShortIdleState 属性和SetShortIdleState方法用于短空闲状态控制
Influence:
PMS: TASK-389737
Change-Id: Iec37ad890c9fb830c0f08c6514f6471045b614e4