首先拿到供应商提供的so库,将so放到vendor\rockchip\common\phone\lib下
修改对应的phone.mk,将so库移动指定位置(Android7以下移动到system/lib,android8以后移动到vendor/lib)
CUR_PATH := vendor/rockchip/common
#########################################################
# 3G Dongle SUPPORT
#########################################################
PRODUCT_COPY_FILES += \
$(CUR_PATH)/phone/etc/ppp/ip-down:system/etc/ppp/ip-down \
$(CUR_PATH)/phone/etc/ppp/ip-up:system/etc/ppp/ip-up \
$(CUR_PATH)/phone/etc/ppp/ip-up:system/etc/ppp/ip-up-vpn \
$(CUR_PATH)/phone/etc/ppp/call-pppd:system/etc/ppp/call-pppd \
$(CUR_PATH)/phone/etc/operator_table:system/etc/operator_table \
$(CUR_PATH)/phone/lib/libreference-ril-n58.so:system/lib/libreference-ril-n58.so \
$(CUR_PATH)/phone/lib/libreference-ril.so:vendor/lib/libreference-ril.so
修改device/rockchip/common/BoardConfig.mk
#enable 3g dongle
BOARD_HAVE_DONGLE ?= true
修改device/rockchip/common/init.connectivity.rc,添加ppp,不然会没有网络使用
chmod 0777 /dev/ppp
修改device/rockchip/rk3288/init.rk3288.rc
service ril-daemon /vendor/bin/hw/rild -l /vendor/lib/libreference-ril.so
class main
user root
group radio cache inet misc audio sdcard_rw log
capabilities BLOCK_SUSPEND NET_ADMIN NET_RAW
修改device/rockchip/rk3288/manifest.xml
<hal format="hidl">
<name>android.hardware.radio</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IRadio</name>
<instance>slot1</instance>
</interface>
<interface>
<name>ISap</name>
<instance>slot1</instance>
</interface>
</hal>
<hal format="hidl">
<name>android.hardware.radio.deprecated</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IOemHook</name>
<instance>slot1</instance>
</interface>
</hal>
修改device/rockchip/common/ueventd.rockchip.rc
# for radio
/dev/ttyUSB0 0660 radio radio
/dev/ttyUSB1 0660 radio radio
/dev/ttyUSB2 0660 radio radio
/dev/ttyUSB3 0660 radio radio
/dev/ttyUSB4 0660 radio radio
/dev/ttyUSB5 0660 radio radio
/dev/ttyUSB6 0660 radio radio
/dev/ttyUSB7 0660 radio radio
/dev/ttyUSB8 0660 radio radio
/dev/ttyUSB9 0660 radio radio
/dev/ttyUSB* 0660 radio radio
/dev/ttyACM* 0660 radio radio
/dev/cdc-wdm* 0660 radio radio
/dev/qcqmi* 0660 radio radio
/dev/cdc-acm* 0660 radio radio
#PCIe
/dev/mhi_DUN 0660 radio radio
/dev/mhi_DIAG 0660 radio radio
/dev/mhi_BHI 0660 radio radio
/dev/mhi_LOOPBACK 0660 radio radio
/dev/mhi_QMI0 0660 radio radio
修改device/rockchip/common/sepolicy/file_contexts
/dev/ttyFIQ[0-9]* u:object_r:serial_device:s0
/dev/ttyUSB[0-9]* u:object_r:radio_device:s0
/dev/ttyCOM[0-9]* u:object_r:tty_device:s0
/dev/ttyACM[0-9]* u:object_r:tty_device:s0
/dev/cdc-wdm[0-9]* u:object_r:radio_device:s0
/dev/qcqmi[0-9]* u:object_r:radio_device:s0
/vendor/bin/hw/rild u:object_r:rild_exec:s0
/dev/socket/rildOemHook u:object_r:rild_exec:s0
#PCIe
/dev/mhi_DUN u:object_r:radio_device:s0
/dev/mhi_DIAG u:object_r:radio_device:s0
/dev/mhi_BHI u:object_r:radio_device:s0
/dev/mhi_LOOPBACK u:object_r:radio_device:s0
/dev/mhi_QMI0 u:object_r:radio_device:s0
修改device/rockchip/common/sepolicy/rild.te
allow rild self:packet_socket { create bind write read };
通过adb logcat -b radio -v time抓取radio日志
修改device/rockchip/rk3288/overlay/frameworks/base/core/res/res/values/config.xml
修改mobile
<string-array translatable="false" name="networkAttributes">
<item>"wifi,1,1,2,-1,true"</item>
<item>"mobile,0,0,0,-1,true"</item>
<item>"mobile_mms,2,0,4,60000,true"</item>
<item>"mobile_supl,3,0,2,60000,true"</item>
<item>"mobile_dun,4,0,2,60000,true"</item>
<item>"mobile_hipri,5,0,3,60000,true"</item>
<item>"mobile_fota,10,0,2,60000,true"</item>
<item>"mobile_ims,11,0,2,60000,true"</item>
<item>"mobile_cbs,12,0,2,60000,true"</item>
<item>"bluetooth,7,7,0,-1,true"</item>
<item>"ethernet,9,9,9,-1,true"</item>
<!--add by blb-->
<item>"pppoe,15,15,5,-1,true"</item>
</string-array>
修改device/rockchip/common/overlay/frameworks/base/core/res/res/values/config.xml
<bool name="config_voice_capable">true</bool>
<!-- This device does not allow sms service. -->
<bool name="config_sms_capable">true</bool>
device/rockchip/common/init.rk30board.rc
# for telephony function
on property:ro.boot.noril=false
setprop ro.radio.noril false
start ril-daemon
修改defconfig
CONFIG_USB_SERIAL=y
CONFIG_USB_SERIAL_GENERIC=y
CONFIG_USB_SERIAL_WWAN=y
CONFIG_USBNET=y
CONFIG_USB_SERIAL_OPTION=y