Android 修改 android/hardware/interfaces 下HIDL接口编译报异常问题解决

发布时间 2023-05-25 21:05:32作者: 大石斑Grouper

最近要增加hostapd 的一个HIDL接口,
修改android/hardware/interfaces/wifi/hostapd/1.2/IHostapd.hal 文件后编译报错如下:

ERROR: android.hardware.wifi.hostapd@1.2::IHostapd has hash
acaed0a159a521bd4964e0fb8117320849109d3eeaff6a08b4d2506156ce6987
which does not match hash on record. This interface has been frozen. Do not change it!

这是因为源码已经定义了android/hardware/interfaces 下的接口哈希值,不允许随意修改。
将 acaed0a159a521bd4964e0fb8117320849109d3eeaff6a08b4d2506156ce6987 哈希值替换到
android/hardware/interfaces/current.txt 对应的接口中(区分不同的hidl版本)

另外VNDK中也确定了接口,需要更新
参考ABI稳定性

development/vndk/tools/header-checker/utils/create_reference_dumps.py -l android.hardware.wifi.hostapd@1.0 -product 项目名