为了帮助模拟某些 OEM 配置,某些通用系统映像支持运行时可配置性。
这些配置使用运行时资源叠加层 (RRO) 实现,可以使用 adb shell cmd overlay
命令进行管理。
使用以下命令启用或停用 RRO:
adb shell cmd overlay enable NAME
adb shell cmd overlay disable NAME
修改系统栏位置
默认情况下,可配置的模拟器有两个系统栏:屏幕顶部的状态栏和底部的导航栏。虽然许多汽车共用这种布局,但有些汽车却不一样。需要特别注意的是,某些汽车的系统栏位于屏幕的横边,而非垂直,这可能会打破在针对移动设备的外形规格开发应用时所做的假设。如需了解详情和获取技术指南,请参阅系统栏、沉浸模式和无边框渲染。
以下 RRO 可用于修改系统栏:
com.android.systemui.rro.bottom
com.android.systemui.rro.bottom.rounded
com.android.systemui.rro.left
com.android.systemui.rro.right
模拟刘海屏
某些汽车的屏幕刘海屏与移动设备上的屏幕差异很大。某些 Android Automotive OS 车辆采用曲面屏幕,使屏幕不是矩形,而没有凹口或针孔摄像头刘海屏。如需了解详情和获取技术指南,请参阅适应不规则形状的显示屏。
以下 RRO 可用于模拟刘海屏:
com.android.internal.display.cutout.emulation.top_and_right
com.android.internal.display.cutout.emulation.free_form
com.android.internal.emulation.automotive_ultrawide_cutout
建议的测试配置
由于通过组合这些 RRO 可创建的配置总数非常庞大,因此我们建议您使用以下硬件配置文件和 RRO 的组合来测试您的应用,它们与当今道路上的某些车辆类似。
- 汽车(1080p 横向),采用
com.android.systemui.rro.left
或com.android.systemui.rro.right
- Automotive 超广角镜头(使用
com.android.systemui.rro.left
和com.android.internal.emulation.automotive_ultrawide_cutout
)