Merge "init.qcom.usb.sh: Include MSM Chip ID as part of product string"
diff --git a/etc/init.qcom.usb.sh b/etc/init.qcom.usb.sh
index 84df9df..aa9cc21 100644
--- a/etc/init.qcom.usb.sh
+++ b/etc/init.qcom.usb.sh
@@ -138,15 +138,21 @@
# 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`;
- # If MSM serial number is not available, then keep it blank instead of 0x00000000
- if [ "$msm_serial" != "" ]; then
- msm_serial_hex=`printf %08X $msm_serial`
+ 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`
fi
- machine_type=`cat /sys/devices/soc0/machine`
- setprop vendor.usb.product_string "$machine_type-$soc_hwplatform _SN:$msm_serial_hex"
+ 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`