Hikey960 Telephony Capabilities: How To Add in Android 9 (Pie)

Since I recently started working with an almost Android 9 manifest for Hikey960, I’m listing here the steps to enable the Hikey960 telephony capabilities, like I previously did for Android 8.

Hikey960 telephony

The first step, as usual, is to take a look at the makefiles that the Hikey960 is inheriting. Analyzing the file

device/linaro/hikey/hikey960.mk

We can see that the standard Hykey960 build is deriving from full_base.mk. To enable the Hikey960 telephony capabilities change

$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)

to

$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)

Then customize the overlays in

device/linaro/hikey/overlay/frameworks/base/core/res/res/values/config.xml

according to the type of device you would like to build. Relevant parts are, for example, config_voice_capable and config_sms_capable that should be set to true if the device supports voice and/or sms, e.g.

<!-- This device is not "voice capable"; it's data-only. -->
<bool name="config_voice_capable">true</bool>

<!-- This device does not allow sms service. -->
<bool name="config_sms_capable">true</bool>

Another important element is the supported data networks definition, called networkAttributes, where the item “mobile” should be added to allow the data connection through the modem, something like:

<string-array translatable="false" name="networkAttributes">
    <item>"wifi,1,1,1,-1,true"</item>
    <item>"mobile,0,0,1,-1,true"</item>
    <item>"ethernet,9,9,2,-1,true"</item>
</string-array>

Iradio HAL Service

One more thing is still missing: due to Project Treble the interaction with the native part of the RIL is now done through the IRadio HAL service. By default this HAL service is not enabled in Hikey960, so, when the platform RIL starts, the following errors can be found in the radio logcat:

08-13 10:52:26.899  2598  2598 E RILJ    : IRadio service is not on the device HAL: java.util.NoSuchElementException [SUB0]

The solutions is to explicitly add the HAL part in the Hikey960 manifest (device/linaro/hikey/manifest.xml):

<hal format="hidl">
    <name>android.hardware.radio</name>
    <transport>hwbinder</transport>
    <version>1.1</version>
    <interface>
        <name>IRadio</name>
        <instance>slot1</instance>
    </interface>
</hal>

Now, after starting the RIL, you should see in the radio logcat something like:

08-13 13:42:26.847  2199  2199 D RILC    : setResponseFunctions
08-13 13:42:26.851  2199  2199 D RILC    : rilConnectedInd

and the requests flowing from the platform layer to the native one.

This should be enough for a standard AOSP telephony build.

Additional items for customizing Hikey960 Telephony capabilities

Below, a few other useful hints for customizing a build to make it more complete:

  • Additional packages could be added modifying variable PRODUCT_PACKAGES in file device/linaro/hikey/hikey960/device-hikey960.mk
  • Additional files could be added modifying variable PRODUCT_COPY_FILES in file device/linaro/hikey/hikey960/device-hikey960.mk
  • Additional properties could be added creating a system.prop file in device/linaro/hikey/hikey960/
  • Additional services (e.g. ppp) can be added in device/linaro/hikey/init.common.rc
  • Additional usb devices permissions can be added in device/linaro/hikey/ueventd.common.rc
  • Additional SE Policies can be added to device/linaro/hikey/sepolicy/ (though this deserves a dedicated post)

Vendor goodies

If you are implementing a commercial solution by a modem vendor, then you’ll probably have to add the vendor native ril library (switched to the vendor directory for pie) and, if needed, other custom patches. Usually vendors have detailed documents that explain what more need to be modified: good luck!

Una risposta a “Hikey960 Telephony Capabilities: How To Add in Android 9 (Pie)”

I commenti sono chiusi.