Open In App

How to Add Support For Wi-Fi Hardware Abstraction Layer in Android 13?

Last Updated : 07 Feb, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

HAL in Android stands for Hardware Abstraction Layer, and it consists of various protocols and hardware equipment that ships with an Android phone, the HAL service for Wi-Fi was newly introduced in the Android 13 beta, and is currently being tested in various methods. This article will tell us about how we can work to add Wi-Fi HAL support to our Android Application, and moreover how we can bake apps that take full advantage of this newly introduced feature on newer Android versions and devices. We will also be looking at the architecture of this service, and discussing it in detail.

What is Wi-Fi HAL in Android 13?

Managers are used by Android applications to access system functions. The managers will access Hardware Abstraction Layer through a variety of system services (HAL). A similar methodology is used by the Wi-Fi architecture to allow apps to access Wi-Fi hardware.

Understanding the Architecture

Three Wi-Fi HAL surfaces are represented by three separate interfaces in the Wi-Fi framework. Two of the three interfaces are available as stable AIDL packages, and all three have HIDL definitions. We will now discuss each of them in detail, and understand what each of them specifically means.

Understanding the Wi-Fi HAL Architecture

Image #1: Understanding the Wi-Fi HAL Architecture.

  1. Vendor HAL: A HAL surface for instructions unique to Android. Hardware/interfaces/wifi/1.x contains the HIDL files.
  2. Hostapd HAL: A hostapd HAL surface. Both the HIDL and AIDL files are located under hardware/interfaces/hostapd/1.x and hardware/interfaces/hostapd/aidl, respectively.
  3. Supplicant HAL: The WPA supplicant HAL surface. Both the HIDL and AIDL files are located at hardware/interfaces/supplicant/1.x and hardware/interfaces/supplicant/aidl, respectively.

We will now be discussing each of them in order of importance.

1. Vendor HAL

The first Hardware component which comes in the priority queue is the Vendor HAL. Commands tailored to Android are provided through the Vendor HAL. Infrastructure Station (STA) and Soft AP (SAP) modes can operate without it (they are not necessary to). For Wi-Fi Aware and Wi-Fi RTT services, it is necessary. Pre-HIDL (i.e. pre-Android 8.0) (i.e. pre-Android 8.0) Android made use of a HAL component now known as legacy HAL. A shim running on top of the traditional HAL is currently used as the default implementation of HIDL in the Android source code.

2. Hostpad HAL

The second component of the Hardware Abstraction is called the Hostpad HAL, which works as its name suggests. The hostapd daemon has an interface provided by the Hostapd HAL. The interface uses AIDL for the HAL definition as of Android 13 forward. Interfaces and vendor partitions require HIDL for Android versions prior to 13.

GeekTip: The AIDL subdirectory contains an AIDL interface that is provided by the reference implementation.

2. Supplicant HAL

The third component which arrives in the range is fairly the last one too, it’s the Supplicant HAL. The WPA supplicant daemon has an interface provided by the Supplicant HAL. The interface uses AIDL for the HAL definition as of Android 13 forward. Interfaces and vendor partitions require HIDL for Android versions prior to 13. The aidl subdirectory contains an AIDL interface that is provided by the reference implementation.

How Wi-Fi and Wi-Fi HAL Concurrency Resolved?

Different Wi-Fi interface combinations can be supported simultaneously by various Android devices. This can be an issue when dealing with large networks or working at places where there are many polar wifi routers available. The HAL defines and makes available to the framework the supported combinations.

Supported Combinations Possible:

  1. For Wi-Fi HAL 1.5 and lower, the specification format is defined in android/hardware/interfaces/wifi/1.0/IWifiChip.HAL. 
  2. For Wi-Fi HAL 1.6 and higher, it is defined in android/hardware/interfaces/wifi/1.6/IWifiChip.HAL. 

GeekTip: A bridging AP interface (dual band simultaneous) can now be explicitly specified in Wi-Fi HAL version 1.6, starting with Android 13.

Conclusion

Through Binder, a Wi-Fi service-using application interfaces directly with the various Wi-Fi services. Hope this article helped you learn something new, and that you use this knowledge to develop support for the new feature in newer Android Versions. The given HIDL and AIDL interfaces are used by the Wi-Fi services to communicate with the HAL while they are running in the System Service.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads