从android emulate 调试多屏多用户

相关配置路径

car service相关的路径

packages/services/Car/service

car service 原始配置路径

packages/services/Car/service/res/values/config.xml

emulator overlay的路径

device/generic/car/emulator/cluster/overlay/packages/services/Car/service/res/values

emulator 冷启动

直接关掉模拟器,下次直接打开是热启动,所以有些配置不会加载,需要adb reboot启动之后才会价值

car service 多屏编译相关

https://stackoverflow.com/questions/66220433/android-r-automotive-emulator-with-multidiplay-supporting-cluster-screen-and-pas
需要export的环境变量:

export BUILD_EMULATOR_CLUSTER_DISPLAY=true

配置修改

android feature相关配置路径

feature配置在源码中的位置:frameworks/native/data/etc
比如车载相关的配置:
frameworks/native/data/etc/android.hardware.type.automotive.xml

<permissions>
    <feature name="android.hardware.type.automotive" />
    <!-- TODO: Revert this after enabling work profiles refer b/170332519 -->
    <unavailable-feature name="android.software.managed_users"/>
</permissions>

device/generic/car/sdk_car_md_x86_64.mk

PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.software.managed_users.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.managed_users.xml

carservice 调试

  • car相关的所有log
adb logcat | grep -iE "display|usermanager|car"
  • 仅car user manager相关的log
adb logcat | grep -iE "usermanager|CarUserService|carservice|CarOccupantZoneService"
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐