信号管理层:CarPropertyMgrPreferenceController / SettingsCarPropertyManager
本篇概述后屏投影依赖的信号管理层。这些类是全项目共用的信号基础设施,非后屏投影专属,故不重复展开,仅梳理「后屏投影用到的关键 API」并指向深度文档。
一、三层结构
flowchart TB subgraph 业务["业务 Controller"] M["RearProjectionModeTabController"] end subgraph 信号管理["CarPropertyMgrPreferenceController<br/>(抽象,业务基类)"] A1["+getProperty(id)<br/>+getIntProperty(id)<br/>+setVehicleProperty()"] A2["#shouldIgnorePropertyFeedback<br/>#getTimeoutFlag<br/>#onSetPropertyTimeout"] A3["+restorePropertyToPrevious"] end subgraph 信号服务["SettingsCarPropertyManager<br/>(单例服务)"] B1["+registerPropertyCallback(ids)<br/>+setCarProperty()"] B2["-cachePropVal / getCachedProp<br/>-startTimeOutMonitor"] B3["SettingsCarPropertyEventCallback"] end subgraph 全局["CarPropertyCacheManager<br/>(全局单例)"] C1["mCallBackMap: propId→callbacks<br/>mPropertiesCache"] end M --> A1 & A2 & A3 A1 --> B1 B1 --> C1
二、后屏投影用到的关键 API
| API | 所在类 | 后屏投影用途 |
|---|---|---|
getProperty(id) / getIntProperty(id) | CarPropertyMgrPreferenceController | 读主信号缓存值刷新 Tab 可用性(:172)、读不可用原因(:143-158) |
setVehicleProperty(propId, val, areaId) | 同上 | 下发 SCREEN_CONTROL_COMMAND(:106) |
registerPropertyCallback() | 同上(:280) | 注册 6 个观察信号,含 mHasRegistered 去重(:275-278) |
shouldIgnorePropertyFeedback | 同上(:349,674-690) | HMI 等待期内忽略回弹刷新 |
getTimeoutFlag | 同上(:315-343) | 决定超时计时器命运(CONTINUE/REMOVE/RESTART) |
restorePropertyToPrevious | 同上(:125-133,393-396) | 超时后 UI 回退 |
setCarProperty | SettingsCarPropertyManager(:423) | 实际下发 + 超时监控启动(:476) |
三、深入阅读
这些类的完整源码解析见既有文档:
docs/SettingsCarPropertyManager源码解析/—SettingsCarPropertyManager与CarPropertyCacheManager的缓存、回调分发、超时机制深度解析。docs/05-车辆接口层与IPC.md— 信号层 IPC 架构。- 本知识库
04-从信号到显示全链路.md— 这些类在后屏投影上下行链路中的具体调用时序。 - 本知识库
07-异常态与依赖信号.md—shouldIgnorePropertyFeedback/getTimeoutFlag/ 超时回退的业务表现。
CarPropertyCacheManager是全局单例,维护propId → callback 集合与缓存。memory 记录它是应用启动耗时病根之一(CarPropertyCacheManager:192附近),详见docs/应用启动初始化知识库/。