Fix dualsim for some Huawei phones (#143)

* Fix dualsim for some Huawei phones

Huawei P20 Lite doesn't have /odm/phone.prop, we must use /vendor/phone.prop
This commit is contained in:
washinson 2020-01-14 12:40:43 +03:00 committed by Pierre-Hugues HUSSON
parent 2a42bd0ed2
commit 21cbb9b4c4

View File

@ -516,12 +516,15 @@ if [ "$has_hostapd" = false ];then
fi
#Weird /odm/phone.prop Huawei stuff
if [ -f /odm/phone.prop ];then
HW_PRODID="$(sed -nE 's/.*productid=([0-9x]*).*/\1/p' /proc/cmdline)"
HW_PRODID="$(sed -nE 's/.*productid=([0-9xa-f]*).*/\1/p' /proc/cmdline)"
[ -z "$HW_PRODID" ] && HW_PRODID="0x$(od -A none -t x1 /sys/firmware/devicetree/base/hisi,modem_id | sed s/' '//g)"
for part in odm vendor;do
if [ -f /$part/phone.prop ];then
if [ -n "$HW_PRODID" ];then
eval "$(awk 'BEGIN { a=0 }; /\[.*\].*/ { a=0 }; tolower($0) ~ /.*0x39606014.*/ { a=1 }; /.*=.*/ { if(a == 1) print $0 }' /odm/phone.prop |sed -nE 's/(.*)=(.*)/setprop \1 "\2";/p')"
eval "$(awk 'BEGIN { a=0 }; /\[.*\].*/ { a=0 }; tolower($0) ~ /.*'"$HW_PRODID"'.*/ { a=1 }; /.*=.*/ { if(a == 1) print $0 }' /$part/phone.prop |sed -nE 's/(.*)=(.*)/setprop \1 "\2";/p')"
fi
fi
done
# Fix sprd adf for surfaceflinger to start
# Somehow the names of the device nodes are incorrect on Android 10; fix them by mknod