Quectel Android RIL Driver User Guide V1.9
Quectel Android RIL Driver User Guide V1.9
User Guide
Rev. Android_RIL_Driver_User_Guide_V1.9
Date: 2020-05-11
Status: Released
www.quectel.com
Android RIL Driver User Guide
Our aim is to provide customers with timely and comprehensive service. For any
assistance, please contact our company headquarters:
GENERAL NOTES
QUECTEL OFFERS THE INFORMATION AS A SERVICE TO ITS CUSTOMERS. THE INFORMATION
PROVIDED IS BASED UPON CUSTOMERS’ REQUIREMENTS. QUECTEL MAKES EVERY EFFORT
TO ENSURE THE QUALITY OF THE INFORMATION IT MAKES AVAILABLE. QUECTEL DOES NOT
MAKE ANY WARRANTY AS TO THE INFORMATION CONTAINED HEREIN, AND DOES NOT ACCEPT
ANY LIABILITY FOR ANY INJURY, LOSS OR DAMAGE OF ANY KIND INCURRED BY USE OF OR
RELIANCE UPON THE INFORMATION. ALL INFORMATION SUPPLIED HEREIN IS SUBJECT TO
CHANGE WITHOUT PRIOR NOTICE.
COPYRIGHT
THE INFORMATION CONTAINED HERE IS PROPRIETARY TECHNICAL INFORMATION OF
QUECTEL WIRELESS SOLUTIONS CO., LTD. TRANSMITTING, REPRODUCTION, DISSEMINATION
AND EDITING OF THIS DOCUMENT AS WELL AS UTILIZATION OF THE CONTENT WITHOUT
PERMISSION ARE FORBIDDEN. OFFENDERS WILL BE HELD LIABLE FOR PAYMENT OF
DAMAGES. ALL RIGHTS ARE RESERVED IN THE EVENT OF A PATENT GRANT OR
REGISTRATION OF A UTILITY MODEL OR DESIGN.
Copyright © Quectel Wireless Solutions Co., Ltd. 2020. All rights reserved.
Android_RIL_Driver_User_Guide 1 / 25
Android RIL Driver User Guide
Revision History
1.7 2018-07-13 Macro GAO Added Android 8.x in supported Android versions
Android_RIL_Driver_User_Guide 2 / 25
Android RIL Driver User Guide
Chapter 2.3.
3. Added the supported IRadio versions in Chapter
2.4.
4. Updated the description in Chapter 3.2.
5. Updated reference documents for USB driver
installation of different modules in Chapter 3.3.
6. Updated Quectel RIL driver version for
customers using Android 8.0 or later versions in
Chapter 3.4.
7. Updated the description of service ril-daemon
configuration in Chapter 3.5.1.
8. Updated HIDL description in Chapter 3.5.3.
9. Updated how to configure SElinux in Chapter 4.
10. Updated how to catch logs in Chapter 5.
11. Removed the section of Why Short Messages
cannot be Sent or Received and added Why
Phone Process Does not Work in Chapter 6.
Android_RIL_Driver_User_Guide 3 / 25
Android RIL Driver User Guide
Contents
1 Introduction .......................................................................................................................................... 7
1.1. Applicable Modules ...................................................................................................................... 7
6 FAQs .................................................................................................................................................... 22
6.1. How to Set the APN ................................................................................................................... 22
6.2. Why Quectel RIL Driver Does not Work .................................................................................... 23
6.3. Why Phone Process Does not Work ......................................................................................... 23
7 Appendix A References..................................................................................................................... 25
Android_RIL_Driver_User_Guide 4 / 25
Android RIL Driver User Guide
Table Index
Android_RIL_Driver_User_Guide 5 / 25
Android RIL Driver User Guide
Figure Index
Android_RIL_Driver_User_Guide 6 / 25
Android RIL Driver User Guide
1 Introduction
This document mainly introduces how to integrate RIL (Radio Interface Layer) driver into Android OS of
customers’ target devices as well as how to modify the configuration files for starting RIL service.
EM05
Android_RIL_Driver_User_Guide 7 / 25
Android RIL Driver User Guide
NOTE
Quectel modules listed above may include multiple models. Please refer to the corresponding module
specifications for details.
Android_RIL_Driver_User_Guide 8 / 25
Android RIL Driver User Guide
Android_RIL_Driver_User_Guide 9 / 25
Android RIL Driver User Guide
SMS YES
Phonebook YES
Android_RIL_Driver_User_Guide 10 / 25
Android RIL Driver User Guide
IRadio 1.3 NO
IRadio 1.4 NO
Android_RIL_Driver_User_Guide 11 / 25
Android RIL Driver User Guide
3 RIL Integration
The chapter mainly describes the RIL driver structure and procedures of setting up an Android system
with the RIL driver.
Android RIL provides the abstract layer between Android telephony service and radio hardware.
The following figure illustrates the RIL in the context of Android telephony architecture.
Application Phone
Framework Java/android/telephony
RIL
Java/android/telephony/gsm
Unix
Libraries
Radio Daemon (RILD)
(User Space) /commands/rild
Vendor RIL
System/libs/libril-vendor.so
Packet Service
Linux Kernel Linux IP Stack
Voice and
Control
Packet Driver
PPP.for example
Baseband Baseband
Android_RIL_Driver_User_Guide 12 / 25
Android RIL Driver User Guide
The RIL in Android is located between kernel and application framework. It is divided into two parts: RILD
and Vendor RIL.
Vendor RIL is responsible for radio communication via AT command channel and data communication via
packet data channel (PDCH).
The java framework of RIL consists of two parts as well: RIL module and phone module. The RIL module
communicates with the lower RILD while the phone module directly provides phone function interfaces to
applications.
For modules accessed by UART interface, the kernel must be configured to support PPP dial-up. For
modules accessed by USB interface, the kernel needs to be configured to support PPP dial-up only when
the PPP function is used. For detailed operation procedures, please refer to Chapter 3.6 in
Quectel_WCDMA<E_Linux_USB_Driver_User_Guide.
For modules accessed by USB interface, please integrate USB serial driver, CDC ACM driver, GobiNet
driver or QMI_WWAN driver in Linux kernel. Otherwise, please skip this section.
Android_RIL_Driver_User_Guide 13 / 25
Android RIL Driver User Guide
Please put the following RIL library files provided by Quectel into the Android system.
NOTE
For customers using Android 8.0 or later versions, Quectel RIL driver V2.0.0 or later versions should be
used.
Android_RIL_Driver_User_Guide 14 / 25
Android RIL Driver User Guide
In order to use the RIL driver normally, some configuration files in Android system should be modified.
Service ril-daemon can be configured by adding the following lines to init.rc or rild.rc. The relevant lines
will vary depending on the accessing interface and the android version being used.
For modules accessed by USB interface, add the following lines to init.rc or rild.rc:
For modules accessed by UART interface, add the following lines to init.rc or rild.rc:
Android_RIL_Driver_User_Guide 15 / 25
Android RIL Driver User Guide
-B <baud rate>
The speed of UART port. Unit: bps. For example: 115200, 230400 or 460800. The default baud rate is
115200.
The location of init.rc file varies according to customers’ project settings. The following gives a
non-exhaustive list of file paths which may contain the init.rc file.
device/fsl/imx6dq/sabresd_6dq/init.rc
device/ti/am335xevm_sk/init.am335xevm.rc
device/rockchip/rk3399/init.rk3399.rc
device/samsung/smdkv210/init.smdkv210_sdmmc.rc
For Android versions prior to Android 8.0, RILD (ril-daemon) requires root privileges, which can be
achieved by commenting the function of switchUser() in the file ($Android_src)/hardware/ril/rild/rild.c.
Android_RIL_Driver_User_Guide 16 / 25
Android RIL Driver User Guide
On Android 8.0 or later versions, the communication interface between Android phone framework and
ril-daemon service has changed from socket to HIDL. Therefore the following HIDL description needs to
be added to manifest.xml.
<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>
<hal format="hidl">
<name>android.hardware.radio</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IRadio</name>
<instance>slot1</instance>
</interface>
</hal>
The location of manifest.xml file varies according to customers’ project settings. For example:
device/rockchip/rk3399/manifest.xml
device/fsl/imx6dq/sabresd_6dq/manifest.xml
Android_RIL_Driver_User_Guide 17 / 25
Android RIL Driver User Guide
4 SELinux Configuration
If the SELinux installed in customers’ Android devices is enabled and runs in enforcing mode, follow the
procedures below to make sure that Quectel RIL has full access to SELinux privileges. Otherwise,
customers can skip this chapter.
To make sure Quectel RIL has full access to SELinux priviledges, the user of service ril-daemon should be
radio. Therefore the user of service ril-daemon in the lines illustrated in Chapter 3.5.1 should be changed
from root to radio. An example with Android 8.0 for modules accessed by USB interface is shown below.
To make sure Quectel RIL has full access to SELinux priviledges, the function of switchUser() mentioned
in Chapter 3.5.2 should be uncommented.
#quectel port
/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
Android_RIL_Driver_User_Guide 18 / 25
Android RIL Driver User Guide
/dev/ttyUSB[0-9] u:object_r:radio_device:s0
/dev/ttyACM[0-9] u:object_r:radio_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_socket:s0
The locations of ueventd.rc, rild.te and file_contexts may vary according to customers’ project settings,
but in general, these files are located in the following paths respectively by default.
device/fsl/imx6dq/sabresd_6dq/ueventd.freescale.rc
device/fsl/imx6dq/sabresd_6dq/sepolicy/rild.te
device/fsl/imx6dq/sabresd_6dq/sepolicy/file_contexts
device/rockchip/common/ueventd.rockchip.rc
device/rockchip/common/sepolicy/file_contexts
Android_RIL_Driver_User_Guide 19 / 25
Android RIL Driver User Guide
5 Debugging Method
Catching logs automatically is recommended for Quectel RIL driver and it can be achieved by fulfilling two
prerequisites: disabling SELinux and applying the library files provided by Quectel. The detailed
procedures are as below:
adb root
adb shell setenforce 0
Quectel RIL driver also supports catching logs manually. The detailed procedures are as below:
1) Catch the logs of RIL module by typing the following command in Window’s CMD tool:
2) Catch the logs of Android system by typing the following command in Window’s CMD tool:
Android_RIL_Driver_User_Guide 20 / 25
Android RIL Driver User Guide
The following table lists some log tags that are commonly applied.
RIL /hardware/ril/reference-ril/refereince-ril.c
AT /hardware/ril/reference-ril/atchannel.c
RILD /hardware/ril/rild/rild.c
RILC /hardware/ril/libril/ril.cpp
RILB /frameworks/base/telephony/java/com/android/internal/telephony/BaseCommands.java
RILJ /frameworks/base/telephony/java/com/android/internal/telephony/gsm/RIL.java
GSM /frameworks/base/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java
Android_RIL_Driver_User_Guide 21 / 25
Android RIL Driver User Guide
6 FAQs
If the dialling process is interrupted, it is quite possible that the APN has not been set yet. Set the APN in
Android UI: “Settings” “WIRELESS & NETWORKS” “…” “Mobile Networks” “Access Point
Names”.
If nothing is found in “Access Point Names”, it indicates that the APN has not been set. In such a case,
customers need to add a new APN to the system. The following figure shows an example of the access
point editing interface. Please note that the Access Point Name varies according to the operators and
(U)SIM cards.
Android_RIL_Driver_User_Guide 22 / 25
Android RIL Driver User Guide
There are many reasons that may cause the failure of Quectel RIL operation. Some common causes are
listed as below for troubleshooting.
Use command getprop init.svc.ril-daemon to check RIL daemon status. If no value is returned or
Stopped/ Restarting is returned instead of Running, it indicates that RIL daemon is not running.
Check the "ril-daemon" service definition in init.rc through command cat /init*.rc | grep ril-daemon. The
expected result should be one of the following:
Check the arguments, word spelling, blank space, etc. to make sure the RIL library is loaded correctly.
Use ls -l /dev/ttyUSB* command to check the access right of the device file.
Use getenforce command to check whether the SELinux has been enabled. If yes, please use
setenforce 0 command to disable the SELinux.
Use getprop gsm.version.ril-impl command to check the Quectel RIL version, and the returned value
should start with Quectel_Android_RIL_Driver_V. If not, it indicates the RIL library is not provided by
Quectel.
Android system determines whether the system supports data access, phone, SMS and other features by
configuring items. The configuration items and APK names are listed below. Please check whether the
configuration is correct. Take imx6q as an example:
Android_RIL_Driver_User_Guide 23 / 25
Android RIL Driver User Guide
If data access is required, the attribute networkAttributes must contain the following items:
The above three configurations are in the file config.xml. The path can be, for example,
device/fsl/imx6dq/sabresd_6dq/overlay/frameworks/base/core/res/res/values/config.xml.
/vendor/bin/hw/rild
/vendor/lib/libril.so
/system/priv-app/TeleService/TeleService.apk
/system/priv-app/TelephonyProvider/TelephonyProvider.apk
/system/framework/telephony-common.jar
Android_RIL_Driver_User_Guide 24 / 25
Android RIL Driver User Guide
7 Appendix A References
Abbreviation Description
UI User Interface
Android_RIL_Driver_User_Guide 25 / 25