CarService的创建与signal的传递三(数据模拟) 替换如下报错了 喜闻乐见07-3013:53:43.918216216I servicemanager: Found android.hardware.automotive.vehicle.IVehicle/defaultindevice VINTF manifest. 07-3013:53:43.918224224I ServiceManager: Waitingforserviceandroid.hardware.automotive.vehicle.IVehicle/defaulton/dev/binder... 07-3013:53:44.455476621D EGL_emulation: app_time_stats:avg33.70msmin30.92msmax38.32mscount3007-3013:53:44.64110321032W ServiceManager: Waited one secondforandroid.hardware.automotive.vehicle.IVehicle/default(isservicestarted? are binder threads started and available?)07-3013:53:44.642216216I servicemanager: Sinceandroid.hardware.automotive.vehicle.IVehicle/defaultcould not be found, trying to start it as a lazy AIDLservice07-3013:53:44.6482161260W libc:Unable tosetpropertyctl.interface_starttoaidl/android.hardware.automotive.vehicle.IVehicle/default:error code: 0x20 07-3013:53:44.6482161260I servicemanager: Tried to start aidlserviceandroid.hardware.automotive.vehicle.IVehicle/default as a lazy service, but was unable to. Usually this happens when aserviceis not installed, butiftheserviceis intended to be used as a lazy service,thenit may be configured incorrectly. 07-3013:53:44.76600E init:Control message: Could notfindaidl/android.hardware.automotive.vehicle.IVehicle/defaultforctl.interface_start from pid:216(/system/bin/servicemanager)07-3013:53:44.919224546W carwatchdogd: Watchdogserviceis not initialized.se权限/home/maqi/android13-r44/device/generic/car/common/sepolicy/file_contexts记得 s0后面空出一行不然能编过但是起不来# Audio HAL/vendor/bin/hw/android\.hardware\.audio\.service-caremu u:object_r:hal_audio_caremu_exec:s0 /(vendor|system/vendor)/bin/hw/android\.hardware\.automotive\.vehicle-OemVhalService u:object_r:hal_vehicle_default_exec:s0json路径automotive/vhal,三处配置都要对应上#car.mk# Auto modulesPRODUCT_PACKAGES\android.hardware.automotive.vehicle-OemVhalService\vehicle_props_oem.json\android.hardware.broadcastradio2.0-service\android.hardware.audio.service-caremu#Cauto hardwarestd::make_uniqueOemVehicleHardware(/vendor/etc/automotive/vhal/vehicle_props_oem.json, nullptr);# Android.bprebuilt_etc{name:vehicle_props_oem.json, src:vehicle_props.json, filename:vehicle_props_oem.json, // 重命名安装文件避免跟默认的 vehicle_props.json 冲突 sub_dir:automotive/vhal, // 安装路径/vendor/etc/automotive/vhal/vehicle_props_oem.json vendor: true,}adb获取属性adb shell cmd car_service get-carpropertyconfig **All properties** Property:0x11400101, Property name:0x11400101, access:0x1, changeMode:0x0, config:[], fs min:0.000000, fs max:0.000000 Property:0x11400207, Property name:0x11400207, access:0x1, changeMode:0x2, config:[], fs min:1.000000, fs max:10.000000 Property:0x11400407, Property name:0x11400407, access:0x1, changeMode:0x1, config:[], fs min:0.000000, fs max:0.000000 areaId:0x0, f min:0.000000, f max:0.000000, i min:1, i max:8, i64 min:0, i64 max:0 Property:0x11400408, Property name:TURN_SIGNAL_STATE, access:0x1, changeMode:0x1, config:[], fs min:0.000000, fs max:0.000000 Property:0x11400e03, Property name:HAZARD_LIGHTS_STATE, access:0x1, changeMode:0x1, config:[], fs min:0.000000, fs max:0.000000 Property:0x11400e13, Property name:HAZARD_LIGHTS_SWITCH, access:0x3, changeMode:0x1, config:[], fs min:0.000000, fs max:0.000000 Property:0x21400601, Property name:0x21400601, access:0x3, changeMode:0x1, config:[], fs min:0.000000, fs max:0.000000 areaId:0x1, f min:0.000000, f max:0.000000, i min:0, i max:3, i64 min:0, i64 max:0excel表格完美对应启动日志 所有类型得数据均已经初始化行1323: 07-3018:00:57.936240240I OemVhalService: OEM VHAL Service starting... 行1324: 07-3018:00:57.936240240I OemVehicleHardware: loading properties from /vendor/etc/automotive/vhal/vehicle_props_oem.json 行1326: 07-3018:00:57.937240240I OemVehicleHardware: InitProp 0x11400408 type:INT32(TURN_SIGNAL_STATE)initialValuewriteres ok?1行1327: 07-3018:00:57.937240240I OemVehicleHardware: InitProp 0x11400e03 type:INT32(HAZARD_LIGHTS_STATE)initialValuewriteres ok?1行1328: 07-3018:00:57.937240240I OemVehicleHardware: InitProp 0x11400e13 type:INT32(HAZARD_LIGHTS_SWITCH)initialValuewriteres ok?1行1329: 07-3018:00:57.937240240I OemVehicleHardware: InitProp 0x11400207 type:FLOAT(PERF_VEHICLE_SPEED)initialValuewriteres ok?1行1330: 07-3018:00:57.937240240I OemVehicleHardware: InitProp 0x11400407 type:INT32(GEAR_SELECTION)initialValuewriteres ok?1行1331: 07-3018:00:57.937240240I OemVehicleHardware: InitProp 0x11400101 type:STRING(INFO_VIN)initialValuewriteres ok?1行1332: 07-3018:00:57.937240240I OemVehicleHardware: InitProp 0x21400601 type:INT32(VENDOR_FRAGRANCE_SWITCH)initialValuewriteres ok?1行1333: 07-3018:00:57.937240240I OemVehicleHardware: loaded7properties 行1335: 07-3018:00:57.938240240I OemVhalService: OEM VHALserviceregistered as android.hardware.automotive.vehicle.IVehicle/default只读 写入会报错maqiQiMa:~/vhal-excel-demo$ adb shell cmd car_service set-property-value 0x1140040702Cannotseta property: android.os.ServiceSpecificException: Failed tosetvalue for: 0x11400407, areaId: 0x0, error: android.os.ServiceSpecificException: failed tosetvalue: android.hardware.automotive.vehicle.VehiclePropValue{timestamp:52746268485, areaId:0, prop:289408007, status:0, value: android.hardware.automotive.vehicle.RawPropValues{int32Values:[2], floatValues:[], int64Values:[], byteValues:[], stringValue:}}(code4)(code4)可读写属性手动下设和获取maqiQiMa:~/vhal-excel-demo$ adb shell cmd car_service set-property-value 0x11400e1300Property(0x11400e13)issetto0successfully maqiQiMa:~/vhal-excel-demo$ adb shell cmd car_service get-property-value 0x11400e130Property:0x11400e13, status:0, timestamp:117038357140, zone: 0x0, floatValues:[], int32Values:[0], int64Values:[], bytes:[], string:float类型获取maqiQiMa:~/vhal-excel-demo$ adb shell cmd car_service get-property-value 0x114002070Property:0x11400207, status:0, timestamp:7343356352, zone: 0x0, floatValues:[0.0], int32Values:[0], int64Values:[], bytes:[], string:String类型获取maqiQiMa:~/vhal-excel-demo$ adb shell cmd car_service get-property-value 0x114001010Property:0x11400101, status:0, timestamp:7343380825, zone: 0x0, floatValues:[], int32Values:[0], int64Values:[], bytes:[], string: MYOEM2024DEMO0001用到的指令汇总adb shell dumpsys car_service|grep-A20CAR.PropertyHalServiceadb shell cmd car_service list-vhal-props adb shell cmd car_service get-vhal-backend adb shell cmd car_service set-property-value 0x11400e1301adb shell cmd car_service get-property-value 0x114001010adb shellpkill-fcom.android.car