top of page

Viktor Mukha
Paradox Cat GmbH, Principal Software Architect
Although Viktor developed his first Android applications for a research institute back in 2012, he has always been more of a C++ nerd. That is, until he joined Paradox Cat GmbH, with a mission to build a custom Android Automotive OS. By now he has had his hands on everything from the kernel, AOSP build system, HALs, and system services to the actual Android applications running in a car.
In his spare time, Viktor is either making music or working on other home projects, exploring all sorts of technologies not limited to Android.
AIDL HAL by Example: Using Hardware from Android Application
As Android application developers, we get a nice set of abstractions via Android SDK to communicate with the underlying hardware. Have you ever wondered how your application code can run on so many different devices without any modifications?
The Android OS defines a set of standard interfaces for hardware vendors to implement. This layer between the hardware and the high-level Android framework is called the Hardware Abstraction Layer (HAL).
We will start our journey as an application developer who wants to use a particular radar sensor by plugging it directly into the USB port of their Android device. Although this radar uses serial protocol internally, this is not the way developers should use it. The only thing we get is a rather complex SDK written in C.
We will try to use this C SDK at the application level via the Android NDK, but we will fail due to SELinux policies restricting raw socket "open" calls.
This is how we end up writing our own AIDL HAL, a corresponding set of SELinux policies, a system service, and an application that consumes the data via an SDK addon.
This talk serves as an overview of current Android System Architecture, describing all the layers one needs to implement within AOSP to expose hardware to applications.
Key Takeaways:
* Why would I, as an application developer, ever need to write a custom HAL?
* The "Android way" of talking to hardware and how it differs from typical Linux.
* There will be links to GitHub with sample code.
* There will be a demo.
#AOSP #HAL #AIDL #SELinux #SDKAddon #AAOS #C++ #Radar #Sensor
bottom of page
