diff --git a/conf/init.gs201.usb.rc b/conf/init.gs201.usb.rc index 36203f40..4ac57f92 100644 --- a/conf/init.gs201.usb.rc +++ b/conf/init.gs201.usb.rc @@ -194,3 +194,6 @@ 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 diff --git a/device.mk b/device.mk index e6941bec..2a3a6287 100644 --- a/device.mk +++ b/device.mk @@ -313,6 +313,7 @@ PRODUCT_COPY_FILES += \ # Shell scripts PRODUCT_COPY_FILES += \ device/google/gs201/init.insmod.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.insmod.sh \ + device/google/gs201/disable_contaminant_detection.sh:$(TARGET_COPY_OUT_VENDOR)/bin/hw/disable_contaminant_detection.sh # insmod files PRODUCT_COPY_FILES += \ diff --git a/disable_contaminant_detection.sh b/disable_contaminant_detection.sh new file mode 100644 index 00000000..b5c22a78 --- /dev/null +++ b/disable_contaminant_detection.sh @@ -0,0 +1,7 @@ +#!/vendor/bin/sh + +for f in /sys/devices/platform/10d60000.hsi2c/i2c-*/i2c-max77759tcpc; do + if [ -d $f ]; then + echo 0 > $f/contaminant_detection; + fi +done diff --git a/usb/usb/android.hardware.usb-service.rc b/usb/usb/android.hardware.usb-service.rc index dcdabf7e..f06b46b7 100644 --- a/usb/usb/android.hardware.usb-service.rc +++ b/usb/usb/android.hardware.usb-service.rc @@ -20,16 +20,9 @@ on post-fs chown root system /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_sink_enable chown root system /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_source_enable chown root system /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_source_enable - chown root system /sys/devices/platform/11110000.usb/dwc3_exynos_otg_b_sess - chown root system /sys/devices/platform/11110000.usb/dwc3_exynos_otg_id - chown root system /sys/devices/platform/11110000.usb/usb_data_enabled - chown root system /sys/devices/platform/google,pogo/enable_usb chmod 664 /sys/class/typec/port0/power_role chmod 664 /sys/class/typec/port0/data_role chmod 664 /sys/class/typec/port0/port_type - chmod 664 /sys/devices/platform/11110000.usb/dwc3_exynos_otg_b_sess - chmod 664 /sys/devices/platform/11110000.usb/dwc3_exynos_otg_id - chmod 664 /sys/devices/platform/11110000.usb/usb_data_enabled chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/contaminant_detection chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/contaminant_detection chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_accessory_current @@ -42,4 +35,3 @@ on post-fs chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_sink_enable chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-5/i2c-max77759tcpc/usb_limit_source_enable chmod 664 /sys/devices/platform/10d60000.hsi2c/i2c-6/i2c-max77759tcpc/usb_limit_source_enable - chmod 664 /sys/devices/platform/google,pogo/enable_usb