Hi Guys!!!
Hope you are doing well !!!. Today I am going to discuss a fundamental change in the Android HIDL.
From Android 11 onward we can use AIDLs for HALs .
Official Announcement and guide is at
That means no need to use HIDLs , Just have AIDLs for every thing . Only one recommendation from google that "HALs using AIDL to communicate between framework components must use Stable AIDL"
When I had written my first blogs on AIDL 6 year ago, I had no idea that google will use it for everything in future . My blog link : AIDL and its uses in Android
Why this change ?
- AIDLs are getting used for IPC in Android from beginning But HIDL only introduced from Android 8 and going to be depricated in Android 11 onward.
- AIDLs are used in many places, such as between Android framework components or in apps.
- Now that AIDL has stability support, it’s possible to implement an entire stack with a single IPC runtime. AIDL also has a better versioning system than HIDL.
- Every type definition must be annotated with @VintfStability
- The aidl_interface declaration needs to include stability: "vintf"
- Java,
- NDK,
- CPP.
AIDL
package android.hardware.skstest;
@VintfStability
interface ISkstest {
String getChars();
void putChars(in String msg);
}
HIDL
package android.hardware.skstest@1.0;
interface ISkstest {
putChars(string msg);
getChars() generates (string msg);
};
The tool also generates a makefile for the AIDL, but it is not usable at the moment:
AIDL
aidl_interface {
name: "android.hardware.skstest",
vendor: true,
srcs: ["android/hardware/skstest*.aidl"],
stability: "vintf",
owner: "vqtrong",
backend: {
cpp: {
enabled: false,
},
java: {
sdk_version: "module_current",
},
},
}
HIDL
// This file is autogenerated by hidl-gen -Landroidbp.
hidl_interface {
name: "android.hardware.skstest@1.0",
root: "android.hardware",
vndk: {
enabled: true,
},
srcs: [
"ISkstest.hal",
],
interfaces: [
"android.hidl.base@1.0",
],
gen_java: false,
}
No comments:
Post a Comment