Skip to content

feat: add CarLink and CarLife projection plugins and host integration - #59

Open
seasonyuu wants to merge 14 commits into
fython:mainfrom
seasonyuu:codex/iccoa-carlink-plugin
Open

seasonyuu wants to merge 14 commits into
fython:mainfrom
seasonyuu:codex/iccoa-carlink-plugin

Conversation

@seasonyuu

@seasonyuu seasonyuu commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

改动说明

新增 ICCOA CarLink 插件和内置 CarLife 输入源,让兼容手机通过 WheelPlay 向浏览器投屏,并接入触控、音频、麦克风和媒体控制。CarLife 接收层直接集成在 common 中,无需安装独立 CarLife 插件;支持本机、远端 Wi-Fi 和实验性 USB 有线连接。

  • CarLink 插件:配置与连接界面、P2P / USB / 手动热点入口、SDK 获取与打包校验、音视频和媒体会话集成,以及组件工厂和资源清理。
  • CarLife 协议与连接:原生 UDP 发现、3.0 明文与 4.1 RSA/AES 协商、视频/媒体音频/TTS、按源端请求启停的麦克风上行、单指/双指触控、尺寸协商与 TCP 重连恢复。自动模式优先 4.1,仅收到明确版本拒绝时回退到 3.0;本机、Wi-Fi、USB 分别保存协议选择,设置使用原生 Activity。
  • CarLife USB / AOA:与 Android Auto 共用授权、配件模式切换和端点访问实现;单一 Bulk 读取线程分发有界逻辑通道,串行发送外层头和消息体,声明 USB 连接能力。半帧写入失败会终止连接并拒绝后续写入;接收结束保留已收完整帧,由命令通道按序处理后报告断线,避免吞掉版本拒绝回复。USB 普通错误提示拔插重连,不套用 TCP 自动重试。
  • 宿主与浏览器:扩展插件接口的编码视频、尺寸协商、连接准备、音频/麦克风和媒体控制;接入浏览器输入源操作与设置请求,修复设置快速回复后界面卡在忙碌状态的问题。共享设置主题,增加默认关闭的“连接后进入全屏”,修复 48 kHz PCM 连续播放。
  • 本机音频准备:本机 CarLife / Android Auto 在输出未设为浏览器时,先要求用户确认切换再连接,避免本机播放回环;远端 Wi-Fi 和 USB 不触发此确认。
  • 构建与兼容性:提供宿主及 CarLink 调试 APK,复用签名配置,完善 SDK 校验、第三方声明和使用文档;修复宿主权限与兼容性问题,以及 HTTPS CA Base64 校验和 macOS 测试可移植性。

验证

最新提交 395901a:

  • CarLife、AapUsbConnectionTest、SourceNavigationTest 共 115 项通过,:mobile:assembleDebug 成功,git diff --check 通过。
  • USB 回环覆盖 3.0 / 4.1 握手、加密视频、媒体音频、TTS、麦克风启停/上行及触控;覆盖非法长度、队列溢出、取消等待、并发写入,以及半帧失败、EOF/读错误后的完整命令交付和协议回退。
  • 首轮整组执行出现一次 TCP 双指集成测试超时;整组重跑 115 项全部通过,保留此偶发失败记录。

此前分支验证记录:Node 244 项、7 个模块 JVM / Robolectric 1,241 项(部分复用 Gradle 缓存)、Python SDK 工具 14 项、网站 17 项及构建、Chrome 媒体端到端与 WebGL 测试通过。这些是此前结果,并非在最新提交上重新执行的全量验证;不将本地结果等同于远端 CI 状态。

真机验证与限制

  • CarLink:vivo → Pixel 3 / Chrome 的发现、配对、认证、兼容模式画面及单指触控通过;低延迟 WebRTC 两次连接均未解码显示,仍是已知问题。见跨设备验证记录。
  • CarLife 本机 / Wi-Fi:此前记录覆盖 vivo 本机 3.0 / 4.1、自动协议、跨 Wi-Fi 4.1、浏览器画面、单双指触控、非静音 PCM 及正常停止;另有一次 Canvas + WebGL 显示验证。vivo 麦克风有用户反馈可用,但未明确输入路由,不扩大为所有设备及路由验收。见本机验证记录。
  • CarLife USB:Mac 作为 USB Host 的独立探针已在 vivo 上验证 AOA 切换、3.0 握手、1280×720 H.264 接收/解码及单指点击。Android 适配 APK 已安装到 Pixel,确认 USB 选择和准备页;Pixel → vivo 双手机 USB 投影尚待人工验收,探针结果不代表 Android 宿主端到端通过。USB 音频、麦克风及 4.1 加密目前以模拟对端回归为依据。见USB 适配与验证记录。
  • 开启自适应尺寸时,须先让浏览器配对并启动显示,之后才开始 USB 授权与握手。扬声器听感、音画同步、长时间稳定性、多轮拔插/断线恢复及跨品牌兼容性仍待验证,不宣称稳定 30 fps 或完整音频路由验收。

@seasonyuu
seasonyuu marked this pull request as draft November 16, 2026 04:15
Fix host permission checks, Bluetooth availability, desktop readiness and media runtime compatibility. Include the associated regression tests.
Extract the reusable settings theme into ui-theme while preserving the host appearance.
Add encoded video transport, display size negotiation, host settings commands, preparation and pairing callbacks. Connect browser source selection and controls to the plugin runtime, with protocol and host regression coverage.
Add the independent ICCOA CarLink APK, SDK provisioning, device preparation and settings. Integrate encoded video, microphone and audio transport, media session controls, desktop settings requests and variant-safe initialization. Include protocol, device-integration and provisioning tests plus setup documentation.
Default to leaving browser fullscreen unchanged and expose an opt-in setting with localization and regression coverage.
@seasonyuu
seasonyuu force-pushed the codex/iccoa-carlink-plugin branch from d132cf7 to 34dda62 Compare November 16, 2026 14:24
@seasonyuu seasonyuu changed the title feat: add ICCOA CarLink projection plugin and host integration feat: add CarLink and CarLife projection plugins and host integration Nov 16, 2026
Implement CarLife protocol, discovery, connection preparation, video, touch, audio and media controls directly in the host source lifecycle. Share playback and capture workers with plugins, bound stale PCM queues, and suppress duplicate Android media sessions for local sources.

Include protocol, lifecycle, media, audio and navigation regression coverage. No standalone receiver, probe or CarLife plugin modules are introduced.
Use a 48 kHz mixing context to avoid per-packet downsampling seams and retain enough queued nodes for buffered PCM bursts.
Provision and sign the CarLink and sample plugin artifacts, validate SDK inputs, and retain host build coverage for built-in CarLife without separate CarLife module jobs.
Document the current common-module architecture, protocol references, setup and verified behavior. Label the earlier probe and standalone-plugin experiments as historical records.
@seasonyuu
seasonyuu force-pushed the codex/iccoa-carlink-plugin branch from 34dda62 to e1168ed Compare November 17, 2026 07:09
@seasonyuu
seasonyuu marked this pull request as ready for review November 17, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant