Commit eccd126
committed
refactor: remove PowerManager dependency from session manager
1. Removed PowerManager D-Bus interface XML definition and generated
adaptor files
2. Replaced PowerManager dependency with direct system checks for power
operations
3. Added virtual machine detection using systemd-detect-virt
4. Modified CanHibernate() and CanSuspend() to check /sys/power/
mem_sleep directly
5. Removed m_powerInter member variable and related initialization
The PowerManager service dependency was unnecessary for basic power
state checks. The session manager can directly query system files and
detect VM environments to determine available power operations, reducing
service dependencies and improving reliability.
Influence:
1. Test hibernation functionality on physical machines with hibernation
support
2. Test suspend functionality on systems with different sleep states
3. Verify VM detection works correctly in virtualized environments
4. Test power operations are properly disabled in VMs
5. Check /sys/power/mem_sleep file access permissions
6. Verify no regression in shutdown and reboot functionality
重构:从会话管理器中移除 PowerManager 依赖
1. 删除了 PowerManager D-Bus 接口 XML 定义和生成的适配器文件
2. 使用直接的系统检查替换 PowerManager 依赖来获取电源操作状态
3. 添加了使用 systemd-detect-virt 的虚拟机检测功能
4. 修改 CanHibernate() 和 CanSuspend() 直接检查 /sys/power/mem_sleep
文件
5. 移除了 m_powerInter 成员变量和相关初始化
PowerManager 服务依赖对于基本的电源状态检查是不必要的。会话管理器可以直
接查询系统文件和检测 VM 环境来确定可用的电源操作,从而减少服务依赖并提高
可靠性。
Influence:
1. 在支持休眠的物理机器上测试休眠功能
2. 在不同睡眠状态的系统上测试挂起功能
3. 验证虚拟化环境中的 VM 检测功能正常工作
4. 测试 VM 中电源操作是否正确禁用
5. 检查 /sys/power/mem_sleep 文件访问权限
6. 验证关机和重启功能没有回归问题1 parent f39786d commit eccd126
File tree
6 files changed
+23
-159
lines changed- dbus/interface
- src/dde-session
- impl
- toolGenerate/qdbusxml2cpp
6 files changed
+23
-159
lines changedThis file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
73 | | - | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| 81 | + | |
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
| |||
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
93 | | - | |
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| |||
246 | 247 | | |
247 | 248 | | |
248 | 249 | | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
| 250 | + | |
255 | 251 | | |
256 | 252 | | |
257 | 253 | | |
| |||
279 | 275 | | |
280 | 276 | | |
281 | 277 | | |
282 | | - | |
| 278 | + | |
283 | 279 | | |
284 | 280 | | |
285 | 281 | | |
286 | | - | |
287 | | - | |
| 282 | + | |
| 283 | + | |
288 | 284 | | |
289 | 285 | | |
290 | 286 | | |
| |||
974 | 970 | | |
975 | 971 | | |
976 | 972 | | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
139 | | - | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
Lines changed: 0 additions & 67 deletions
This file was deleted.
Lines changed: 0 additions & 63 deletions
This file was deleted.
0 commit comments