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
This commit is contained in:
Alexander Koskovich
2022-03-02 13:22:16 -07:00
committed by Michael Bestas
parent b6a6e1ca2e
commit d9700cfc9b

View File

@@ -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`