usb: 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 ZenFone 8 our model is ASUS_I006D.
This is not a suitable model to show users.
Change-Id: Ica487b993c215ad258cfc44062daffe868a65556
diff --git a/etc/init.qcom.usb.sh b/etc/init.qcom.usb.sh
index 4b73365..c0f7d5e 100644
--- a/etc/init.qcom.usb.sh
+++ b/etc/init.qcom.usb.sh
@@ -163,22 +163,12 @@
# check configfs is mounted or not
if [ -d /config/usb_gadget ]; then
- machine_type=`cat /sys/devices/soc0/machine`
-
- # Chip ID & serial are used for unique MSM identification in Product String
- # If not present, then omit them instead of using 0x00000000
- msm_chipid=`cat /sys/devices/soc0/nproduct_id`;
- if [ "$msm_chipid" != "" ]; then
- msm_chipid_hex=`printf _CID:%04X $msm_chipid`
+ 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
- msm_serial=`cat /sys/devices/soc0/serial_number`;
- if [ "$msm_serial" != "" ]; then
- msm_serial_hex=`printf _SN:%08X $msm_serial`
- fi
-
- setprop vendor.usb.product_string "$machine_type-$soc_hwplatform$msm_chipid_hex$msm_serial_hex"
-
# ADB requires valid iSerialNumber; if ro.serialno is missing, use dummy
serialnumber=`cat /config/usb_gadget/g1/strings/0x409/serialnumber 2> /dev/null`
if [ "$serialnumber" == "" ]; then