Using Android HAL

Hi,

it looks like that Android O is using HAL instead of a socket for the RIL communication. I know little about the Android HAL. Hence my questions:

  • Would it be OK to use that HAL from B2G? Or is that one layer to high?
  • Does the current B2G already use some HAL? Is there a simple one for me to see how it works?

Cheers,
Volker

B2G uses the HAL for many hardware interfaces. A very simple one you can look at is the vibrator (https://dxr.mozilla.org/mozilla-b2g44_v2_5/source/hal/gonk/GonkHal.cpp#342).

The light control are using the hw_module system (https://dxr.mozilla.org/mozilla-b2g44_v2_5/source/hal/gonk/GonkHal.cpp#116) and is likely more in line with what’s coming for O.

So yes, if there is a HAL, this is the thing to use. Looking around I ended up in http://androidxref.com/4.4.3_r1.1/xref/hardware/ril/reference-ril/ and I wonder how complete or incomplete this is.

1 Like

Here’s one start of the new Radio HAL https://android.googlesource.com/platform/hardware/interfaces/+/4cb7b84aba6b82287c7aa1b575d32188cb9115b7

Easiest is to search for “Bug: 32020264” in the Android commits. The bug isn’t public, but it seems to be about the transition from the rild Socket to HAL. Code changes can be seen in the RIL implementation as well as the Java Telephony part.