From d9700cfc9bede6de6fa4fd75cd39bb4030e410d4 Mon Sep 17 00:00:00 2001 From: Alexander Koskovich Date: Wed, 2 Mar 2022 13:22:16 -0700 Subject: [PATCH] sm8250-common: Set the USB model to something more device specific * Also allow devices to override ro.product.vendor.model in cases where it's not really suitable for UX facing stuff, e.g. on OnePlus 8T our model is KB2003. This is not a suitable model to show users. Change-Id: Ica487b993c215ad258cfc44062daffe868a65556 --- rootdir/bin/init.qcom.usb.sh | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/rootdir/bin/init.qcom.usb.sh b/rootdir/bin/init.qcom.usb.sh index 43b2f30..6952973 100755 --- a/rootdir/bin/init.qcom.usb.sh +++ b/rootdir/bin/init.qcom.usb.sh @@ -142,21 +142,11 @@ esac # check configfs is mounted or not if [ -d /config/usb_gadget ]; then - # Chip-serial is used for unique MSM identification in Product string - msm_serial=`cat /sys/devices/soc0/serial_number`; - msm_serial_hex=`printf %08X $msm_serial` - machine_type=`cat /sys/devices/soc0/machine` -#ifdef VENDOR_EDIT -#Fix product name for Android Auto/Ubuntu - product_string=`getprop ro.product.model` - if [ "$product_string" == "" ]; then - product_string="OnePlus" - fi -#else - #product_string="$machine_type-$soc_hwplatform _SN:$msm_serial_hex" -#endif - echo "$product_string" > /config/usb_gadget/g1/strings/0x409/product - setprop vendor.usb.product_string "$product_string" + usb_product=`getprop vendor.usb.product_string`; + vendor_model=`getprop ro.product.vendor.model`; + if [ "$usb_product" == "" ]; then + setprop vendor.usb.product_string "$vendor_model" + fi # ADB requires valid iSerialNumber; if ro.serialno is missing, use dummy serialnumber=`cat /config/usb_gadget/g1/strings/0x409/serialnumber 2> /dev/null`