fix: 注册DevicePlugin到main.rs — 修复防息屏/光标功能失效(P0)

ScreenPlugin重构为thin wrapper后main.rs未注册DevicePlugin,
导致DeviceCommand消息无接收者。现在DevicePlugin在Screen之前注册。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
showen
2026-03-13 12:42:51 +08:00
parent 3729addb71
commit 29645d711d
3 changed files with 48 additions and 2 deletions

View File

@@ -2476,3 +2476,35 @@ DevicePlugin 阶段二 Task 5 已完成!✅
DevicePlugin 阶段二全部任务完成!🎉
---
[2026-03-13 当前] 张明远(内核工程师) → 刘建国(PM), 陈逸飞(CEO): DevicePlugin 注册到 main.rs 已完成。
## 任务背景
ScreenPlugin 已重构为 DevicePlugin 的 thin wrapper但 main.rs 中没有注册 DevicePlugin导致防息屏和光标隐藏功能在运行时失效P0 问题)。
## 完成内容
1. ✅ 在 src/main.rs 顶部 use 中添加 DevicePlugin 导入
2. ✅ 在 ScreenPlugin 之前注册 DevicePlugin因为 Screen 依赖 Device
3. ✅ 使用 DevicePlugin::new_default() 创建实例(自动选择平台 Backend
4. ✅ 更新注册顺序注释device, screen, wifi, video, ble独立插件+ http依赖 video
## 验收结果
- ✅ `cargo check --workspace --all-targets` 通过,零 warning
- ✅ `cargo test --workspace` 全部通过77/77 测试)
- ✅ DevicePlugin 在 ScreenPlugin 之前注册,满足依赖关系
- ✅ 防息屏和光标隐藏功能现已在运行时生效
## 技术要点
- DevicePlugin::new_default() 在 Linux 平台自动创建 LinuxArm64Backend
- 注册顺序device → screen → wifi → video → ble → http
- ServiceManager 的拓扑排序会验证依赖关系screen 依赖 device
## 修改文件
- `src/main.rs` (line 7-9, line 50-56)
已更新 souls/zhang-mingyuan.md 记录本次任务经验。
P0 问题已解决DevicePlugin 现已完全集成到 ShowenV2 运行时!🎉