healthd 和 android.hardware.health@2.0-service.imx 都应该是 运行 吗?

Should both healthd and android.hardware.health@2.0-service.imx be running?

在我的 Android 系统上,有两个独立的 healthd 进程:

$ adb shell "ps -ef | grep health"
root          3535     1 3 14:33:18 ?     00:00:00 healthd
system        3548     1 5 14:33:18 ?     00:00:00 android.hardware.health@2.0-service.imx

他们都使用来自 system/core/healthdhardware/interfaces/health/2.0/default 的相同代码,但只有 android.hardware.health@2.0-service.imx 使用来自 vendor/nxp-opensource/imx/health.

的代码

更新:

两个服务的 .rc 文件不同:

smarc_mx8mq:/etc/init # cat healthd.rc                                                                                                                                     
service healthd /system/bin/healthd
    class hal
    critical
    group root system wakelock

smarc_mx8mq:/etc/init # cat /vendor/etc/init/android.hardware.health@2.0-service.imx.rc                                                                                    
service vendor.health-hal-2-0 /vendor/bin/hw/android.hardware.health@2.0-service.imx
    class hal
    user system
    group system
    capabilities WAKE_ALARM
    file /dev/kmsg w

从构建的系统中删除 /etc/init/healthd.rc 会导致 vanilla healthd 无法启动。我还没有发现任何不良影响。

healthd是1.0版hal,可以去掉。参考:Removing healthd