1# ICarTelemetry Sample Client 2 3This is a sample vendor service that sends `CarData` to car telemetry service. 4 5## Running 6 7**1. Quick mode - under root** 8 9``` 10m -j android.automotive.telemetryd-sampleclient 11 12adb remount # make sure run "adb disable-verity" before remounting 13adb push $ANDROID_PRODUCT_OUT/vendor/bin/android.automotive.telemetryd-sampleclient /system/bin/ 14 15adb shell /system/bin/android.automotive.telemetryd-sampleclient 16 17# Then check logcat and dumpsys to verify the results. The following command enables VERBOSE logs. 18adb shell setprop log.tag.android.automotive.telemetryd@1.0 V 19adb logcat -v color -b all -T 1000 20``` 21 22**2. Under vendor** 23 24To include it in the final image, add 25`PRODUCT_PACKAGES += android.automotive.telemetryd-sampleclient` to 26`//packages/services/Car/cpp/telemetry/cartelemetryd/products/telemetry.mk` (or other suitable mk file). 27 28``` 29# this goes to products/telemetry.mk 30 31PRODUCT_PACKAGES += android.automotive.telemetryd-sampleclient 32``` 33 34The sampleclient doesn't automatically start during boot, to start manually, run: 35`adb shell /vendor/bin/android.automotive.telemetryd-sampleclient`. 36 37If you want to test it by running `init`, add these SELinux rules: 38 39``` 40# this goes to sepolicy/private/cartelemetryd.te 41 42type cartelemetryd_sample, domain; 43type cartelemetryd_sample_exec, vendor_file_type, exec_type, file_type; 44init_daemon_domain(cartelemetryd_sample) 45``` 46 47``` 48# this goes to sepolicy/private/file_contexts 49 50/vendor/bin/android\.automotive\.telemetryd-sampleclient u:object_r:cartelemetryd_sample_exec:s0 51``` 52 53And create an `.rc` file: 54 55``` 56# File: cartelemetryd-sampleclient.rc 57# Don't forget to add `init_rc: ["cartelemetryd-sampleclient.rc"],` to the Android.bp 58 59service cartelemetryd_sample /vendor/bin/android.automotive.telemetryd-sampleclient 60 class hal 61 user system 62 group system 63 oneshot # run once, otherwise init keeps restarting it 64 disabled # do not start automatically 65``` 66