I'm the author of this RIL. I added some detail to GNUtoo's graph, attached. (Sorry it's weird; I don't know graphviz.)
Since my repo is lacking in documentation, some notes:
Why Java?¶
I didn't want to deal with C or the rild <-> libril interface, so I implemented a Java RIL class that replaces the one that usually talks to rild. Android is directed to use my class by a build.prop.
BuildRilWrapper¶
BuildRilWrapper runs at build time, and autogenerates code to dispatch incoming method calls to the corresponding module (e.g. SmsModule.) Most methods are asynchronous and cannot run on the thread that received the method call, so a Runnable is posted to another thread that does the necessary work and then invokes the callback.
I find my way far more convenient than the Message junk, so I wonder if there is some performance reason (memory usage?) it isn't usually done this way. Or maybe it is just the legacy of starting over 10 years ago.
The target method is found by looking for a method amongst the modules with a matching signature (same argument types, except omitting the Message that is for the callback.)
Modules¶
Modules are methods grouped by functionality type, and correspond closely to oFono interfaces. When oFono notifies that a given interface has loaded/unloaded, we load/unload the corresponding module. When a module is not loaded and the framework requests something that is implemented in the module, BuildRilWrapper's generated code detects this condition and reports an error to the framework.