Fix android 11 Stable AIDL 添加后的编译问题

android 11 Stable AIDL 接口添加

BG

Android 10 添加了对稳定的 Android 接口定义语言 (AIDL) 的支持,这是一种跟踪由 AIDL 接口提供的应用编程接口 (API)/应用二进制接口 (ABI) 的新方法。稳定的 AIDL 与 AIDL 的主要区别如下:

在构建系统中使用 aidl_interfaces 定义接口。
接口只能包含结构化数据。对于代表所需类型的 Parcelable,系统会根据其 AIDL 定义自动创建,并自动对其进行编组和解组。
可以将接口声明为“稳定”接口(向后兼容)。声明之后,会在 AIDL 接口旁的一个文件中对这些接口的 API 进行跟踪和版本编号。

问题点

我们在netd aidl 中添加了新的接口
编译时候无法通过

Solution

you need to manage ToT version's API definition.
Whenever an API is updated, run foo-update-api to update aidl_api/name/current which contains ToT version's API definition.

补充:

To maintain the stability of an interface, owners can add new:

    Methods to the end of an interface (or methods with explicitly defined new serials)
    Elements to the end of a parcelable (requires a default to be added for each element)
    Constant values
    In Android 11, enumerators
    In Android 12, fields to the end of a union

No other actions are permitted, and no one else can modify an interface (otherwise they risk collision with changes that an owner makes).

对应此模块
你需要的事运行如下命令进行编译

make netd_aidl_interface-update-api
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 13
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 13
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值