diff --git a/Android.bp b/Android.bp index e719cab..7156389 100644 --- a/Android.bp +++ b/Android.bp @@ -34,3 +34,10 @@ license { "NOTICE", ], } + +sh_binary { + name: "disable_contaminant_detection.sh", + src: "disable_contaminant_detection.sh", + vendor: true, + sub_dir: "hw", +} diff --git a/conf/init.zumapro.usb.rc b/conf/init.zumapro.usb.rc index 322e530..8f33d1e 100644 --- a/conf/init.zumapro.usb.rc +++ b/conf/init.zumapro.usb.rc @@ -296,6 +296,9 @@ on property:sys.usb.config=charger && property:sys.usb.configfs=1 on property:ro.bootmode=usbuwb setprop persist.vendor.usb.usbradio.config uwb_acm +on property:vendor.usb.contaminantdisable=true + exec /vendor/bin/hw/disable_contaminant_detection.sh + on property:persist.vendor.usb.displayport.enabled=1 write /sys/module/exynos_drm/parameters/dp_enabled 1 write /sys/class/typec/port0/port0.0/mode1/active "yes" diff --git a/device.mk b/device.mk index aea5c16..ca0e409 100644 --- a/device.mk +++ b/device.mk @@ -380,6 +380,10 @@ PRODUCT_COPY_FILES += \ device/google/$(TARGET_BOARD_PLATFORM)/conf/fstab.persist:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.persist \ device/google/$(TARGET_BOARD_PLATFORM)/conf/fstab.modem:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.modem +# Shell scripts +PRODUCT_PACKAGES += \ + disable_contaminant_detection.sh + include device/google/gs-common/insmod/insmod.mk # Insmod config files diff --git a/disable_contaminant_detection.sh b/disable_contaminant_detection.sh new file mode 100644 index 0000000..fde6eb4 --- /dev/null +++ b/disable_contaminant_detection.sh @@ -0,0 +1,7 @@ +#!/vendor/bin/sh + +for f in /sys/devices/platform/108d0000.hsi2c/i2c-*/*-0025; do + if [ -d $f ]; then + echo 0 > $f/contaminant_detection; + fi +done