Commit e6908b7
fix: handle idle state properly in power save plan
1. Added isIdle field to track system idle state in powerSavePlan struct
2. Modified Update() method to check if system is already idle before
setting real delay
3. When system is idle, restart power delay tasks instead of setting
new delays
4. Extracted idle task startup logic into separate
startIdleTasksLocked() method
5. HandleIdleOn() now sets isIdle flag and calls startIdleTasksLocked()
6. HandleIdleOff() now resets isIdle flag to false
The fix ensures that when the system is already in idle state and power
settings are updated, the power delay tasks are properly restarted
rather than attempting to set new delays. This prevents issues where
screen saver and lock delays might not work correctly after system
settings changes during idle state.
fix: 正确处理电源节省计划中的空闲状态
1. 在powerSavePlan结构体中添加isIdle字段来跟踪系统空闲状态
2. 修改Update()方法,在设置实际延迟前检查系统是否已处于空闲状态
3. 当系统空闲时,重新启动电源延迟任务而不是设置新的延迟
4. 将空闲任务启动逻辑提取到单独的startIdleTasksLocked()方法中
5. HandleIdleOn()现在设置isIdle标志并调用startIdleTasksLocked()
6. HandleIdleOff()现在将isIdle标志重置为false
此修复确保当系统已处于空闲状态且电源设置更新时,正确重新启动电源延迟任
务,而不是尝试设置新的延迟。这防止了在空闲状态下更改系统设置后,屏幕保护
程序和锁定延迟可能无法正常工作的问题。
PMS: BUG-3539471 parent 1a61726 commit e6908b7
1 file changed
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| |||
486 | 487 | | |
487 | 488 | | |
488 | 489 | | |
489 | | - | |
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
496 | 503 | | |
497 | 504 | | |
498 | 505 | | |
| |||
697 | 704 | | |
698 | 705 | | |
699 | 706 | | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
700 | 712 | | |
701 | 713 | | |
702 | 714 | | |
| |||
766 | 778 | | |
767 | 779 | | |
768 | 780 | | |
| 781 | + | |
| 782 | + | |
769 | 783 | | |
770 | 784 | | |
771 | 785 | | |
| |||
0 commit comments