Android上的ril库

ril:(radio interface layer)

ril库的结构如下:

Android上的ril库_第1张图片

The RIL is divided into two separate components, a RIL Driver and a RIL Proxy. The RIL Driver processes radio commands and events. The RIL Proxy performs arbitration between multiple clients for access to the single RIL driver.

  • ril driver
  • ril proxy

When a module first registers with the RIL, it passes in two callback functions. One is used for unsolicited notifications, and the other is used for responses to function calls. For example, when the phone receives a new incoming call, the RIL uses the unsolicited notification callback to notify each module about the incoming call.

When a module calls the RIL to get the signal strength, the function call immediately returns a response identifier. The RIL uses the function response callback to convey signal strength information to the module. To ensure that response callbacks are correctly matched with function calls, this callback structure also contains the same response identifier value that is returned by the original function call. This asynchronous architecture simplifies the RIL implementation. If a module needs to call a RIL function in a synchronous manner, it needs to make the function call and block until the module receives the function response callback.

你可能感兴趣的:(Android)