Android P Car 空调功能分析
2020-04-13 本文已影响0人
周鹤_006d
1.Android系统启动流程

上图中ActivityManagerService、SystemUI、Launcher流程都是在SystemServer中启动的,代码路径(platform/frameworks/base/services/java/com/android/server/SystemServer.java)
2.Car Service基本分析(官方文档:https://source.android.google.cn/devices/automotive?hl=zh-cn)
2.1Car系统中专有的app和服务,在(platform/packages/services/Car/car_product/build/car.mk)中定义

编好的app在系统中的安装路径:


3.空调应用分析


3.1应用分析
3.1.1入口寻找
从上图可以看出,空调界面的启动入口在SystemUI中,我们到SystemUI的res中寻找


根据car_ic_hvac找到应用这个图标的引用

找到这个布局xml引用的地方

稍加分析,我们可以看出空调界面的启动是通过Intent;action=android.car.intent.action.TOGGLE_HVAC_CONTROLS的广播发送
在通过搜索可以看出,这个广播被(platform/packages/apps/Car/Hvac/src/com/android/car/hvac/HvacUiService.java)接收

在platform/packages/apps/Car/Hvac应用中的HvacPanelController.java控制,界面是hvac_panel.xml
3.1.2分析乘客侧空调温度的调整过程




经过分析,如下为调用service层的位置

继续走



CarPropertyService实现了ICarProperty.Stub,实现了跨进程的调用

重新make编译
debug com.android.car进程


3.1.3 HAL层目录
platform/hardware/interfaces/automotive/vehicle/