概述
RemoteCarTaskView 是 Car SDK 类(android.car.app 包),是一个 跨进程 SurfaceView。它在 CarLauncher 进程中作为普通 View 嵌入,但编排在 SystemUI 进程,而渲染在实际Activity所属的进程(如map应用)
流程图
怎么做到的
startActivity只是将intent传递到systemui,真正执行start操作的是在systemui,systemui将task的surfaceleash reparent到创建RemoteCarTaskView的进程传递过来的SurfaceControl(由RemoteCarTaskView【继承自SurfaceView】 创建)
手势事件
┌─────────────────────────────────────────────────────┐
│ 屏幕分层:从 top 到底部 │
│ │
│ 1. mSpyWindow (CarTaskViewInputInterceptor) ← 最顶层│
│ (悬浮透明,拦截所有触摸事件) │
│ │
│ 2. CarLauncher UI ← 原有的 Launcher UI │
│ │
│ 3. 地图 Surface (ControlledRemoteCarTaskView) │
│ ← 地图内容由 SystemUI 合成到此 │
└─────────────────────────────────────────────────────┘