Commit 95b5de7
committed
refactor: remove PowerManager interface dependency
1. Removed PowerManager D-Bus interface dependency from the
authentication system
2. Replaced PowerManager calls with direct login1 D-Bus interface calls
for power management
3. Added local power capability detection methods (canSuspend/
canHibernate) that check system files and login1 interface
4. Implemented virtual machine detection to disable power features in
VM environments
5. Removed all PowerManager related XML definitions, adaptors, and
constants
6. Simplified power info checking logic by removing environment variable
fallbacks
This change eliminates the dependency on the deprecated PowerManager
service and uses the standard login1 interface directly, making the code
more maintainable and reducing external dependencies.
Influence:
1. Test suspend/hibernate functionality on physical machines
2. Verify power options are disabled in virtual machine environments
3. Test power actions with different system configurations
4. Ensure power state detection works correctly with login1 interface
5. Verify no regression in lock screen power management features
重构:移除 PowerManager 接口依赖
1. 从认证系统中移除了 PowerManager D-Bus 接口依赖
2. 将 PowerManager 调用替换为直接的 login1 D-Bus 接口调用进行电源管理
3. 添加了本地电源能力检测方法(canSuspend/canHibernate),检查系统文件和
login1 接口
4. 实现了虚拟机检测功能,在虚拟环境中禁用电源功能
5. 移除了所有与 PowerManager 相关的 XML 定义、适配器和常量
6. 通过移除环境变量回退简化了电源信息检查逻辑
此更改消除了对已弃用的 PowerManager 服务的依赖,直接使用标准的 login1 接
口,使代码更易于维护并减少外部依赖。
影响:
1. 在物理机上测试挂起/休眠功能
2. 验证虚拟环境中电源选项被禁用
3. 使用不同系统配置测试电源操作
4. 确保通过 login1 接口的电源状态检测正常工作
5. 验证锁屏电源管理功能没有回归问题1 parent e88849d commit 95b5de7
File tree
7 files changed
+53
-37
lines changed- src
- dde-lock
- global_util
- session-widgets
- toolGenerate/qdbusxml2cpp
- xml/snipe
7 files changed
+53
-37
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
188 | 187 | | |
189 | 188 | | |
190 | 189 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
562 | | - | |
| 562 | + | |
563 | 563 | | |
564 | 564 | | |
565 | 565 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | 18 | | |
21 | 19 | | |
22 | 20 | | |
| |||
62 | 60 | | |
63 | 61 | | |
64 | 62 | | |
65 | | - | |
66 | | - | |
67 | 63 | | |
68 | 64 | | |
69 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
| 244 | + | |
| 245 | + | |
248 | 246 | | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
| 247 | + | |
| 248 | + | |
253 | 249 | | |
254 | 250 | | |
255 | 251 | | |
| |||
261 | 257 | | |
262 | 258 | | |
263 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | | - | |
25 | 23 | | |
26 | 24 | | |
27 | 25 | | |
| |||
34 | 32 | | |
35 | 33 | | |
36 | 34 | | |
37 | | - | |
38 | 35 | | |
39 | 36 | | |
40 | 37 | | |
41 | 38 | | |
42 | 39 | | |
43 | 40 | | |
44 | 41 | | |
45 | | - | |
46 | 42 | | |
47 | 43 | | |
48 | 44 | | |
| |||
96 | 92 | | |
97 | 93 | | |
98 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
106 | 105 | | |
107 | 106 | | |
108 | 107 | | |
| |||
112 | 111 | | |
113 | 112 | | |
114 | 113 | | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
| 66 | + | |
This file was deleted.
0 commit comments