简体   繁体   中英

Send RIL requests for Android

I would like to know, how to send requests for RIL on Android, these requests are listed in ril.h, for example, follows some macro for requests:

RIL_REQUEST_GET_SIM_STATUS
RIL_REQUEST_ENTER_SIM_PIN
RIL_REQUEST_ENTER_SIM_PUK
RIL_REQUEST_DIAL
...

I would like to send these requests from C or C++.

Sorry for the late reply. I saw your question and figured that I might answer so that someone will find it useful.

As you said, there are a lot of requests listed in ril.h. These requests are for communicating between the RILJ (Android Telephony Java part) and RILD (native RIL library provided by chipset OEMs like Qualcomm, Broadcom, ST Ericcson, Intel Mobile Comm). Once RILD gets hold of these requests, these are further forwarded to modem via AT commands, IPC, or QMI mechanism.

If you are building a third party app, you cannot directly invoke the requests in ril.h. Any APIs that are used in your app, say for example, DIAL request translates to RIL_REQUEST_DIAL and is send to native RIL library. Note that you are not directly invoking these requests; you are using the telephony APIs exposed to use the ril.h requests.

However if you are building your app as part of the system build, you can make it a system app by using the same sharedID as phone process and importing telephony.jar in your mk file. This way you can try to invoke requests directly from phone object instead of using the Telephony APIs exposed by Google.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM