fix: 解决低电量进入系统后, 系统触发的节能模式, 电量没有变化的问题#1039
Merged
fly602 merged 1 commit intolinuxdeepin:masterfrom Mar 3, 2026
Merged
Conversation
mhduiy
reviewed
Mar 3, 2026
曾经一笔修改, 添加了一个启动时的状态标记, 在这个状态下,不会设置亮度, 因此不会触发亮度变化 回退该修改, 它原本解决问题已不存在, 电源管理f方案已变更. 启动时不在会有模式变更. 因此除了初始化就不会再有亮度跳变的问题. Log: 解决电源管理亮度变化问题 PMS: BUG-345885 Influence: 电源管理亮度变化
deepin pr auto review这份代码变更主要涉及移除 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
改进建议总结
修改后的代码片段示例 (针对注释清理)// system/power1/manager.go
type Manager struct {
// 当前模式
Mode string
// 上次非低电量时的模式
lastMode string
displayManager DisplayManager.DisplayManager
isLowBatteryMode bool
dspcMu sync.Mutex
// ... 其他字段
}总体而言,本次代码变更通过引入互斥锁提高了并发安全性,并通过移除过时的启动检查逻辑简化了代码。只要移除启动检查符合产品需求,这是一次积极的代码重构。 |
mhduiy
approved these changes
Mar 3, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fly602, mhduiy 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
曾经一笔修改, 添加了一个启动时的状态标记, 在这个状态下,不会设置亮度, 因此不会触发亮度变化
回退该修改, 它原本解决问题已不存在, 电源管理f方案已变更. 启动时不在会有模式变更. 因此除了初始化就不会再有亮度跳变的问题.
Log: 解决电源管理亮度变化问题
PMS: BUG-345885
Influence: 电源管理亮度变化