新增 AIDL 接口后,高通 QIIFA 导致编译失败的解决方法

新增 AIDL 接口后,高通 QIIFA 导致编译失败的解决方法

注意:本文基于 Android 14 撰写
Qidi 2025.06.04


0. 问题描述

项目基于高通 Android 14 基线代码开发。我在 vendor 下新增自定义 AIDL 接口后,编译 Android整包 失败,报错如下:

2025-06-04 15:17:54,758 WARNING AIDL Skipped INTF from Skipped List android.hardware.security.keymint
2025-06-04 15:17:54,759 WARNING AIDL Skipped INTF from Skipped List android.hardware.light
2025-06-04 15:17:54,759 WARNING AIDL Skipped INTF from Skipped List vendor.qti.hardware.display.config
2025-06-04 15:17:54,759 ERROR   ==================================================================================================
2025-06-04 15:17:54,759 ERROR   FileName      : aidl_plugin
2025-06-04 15:17:54,759 ERROR   SubModuleName : vendor.xxxx.audioservice
2025-06-04 15:17:54,759 ERROR   FunctionName   : blk_by_blk_dict_chk
2025-06-04 15:17:54,759 ERROR   Reason        : Please check the AIDL Interface, QIIFA CMD does not have this information. Please run --create option before running IIC.
2025-06-04 15:17:54,759 ERROR   How to fix    : on go/qiifa, look at the How to fix QIIFA violators
2025-06-04 15:17:54,759 ERROR   ==================================================================================================

2025-06-04 15:17:54,761 ERROR   Failure: There is/are interface integrity QIIFA violaters

2025-06-04 15:17:54,761 ERROR   please look at qiifa_violaters.txt file in out folder

2025-06-04 15:17:54,761 ERROR   for QSSI only, out/target/product/qssi/QIIFA_QSSI/qiifa_violaters.txt

2025-06-04 15:17:54,761 ERROR   for target,out/target/product/gen5_gvm_gy/QIIFA_TARGET/qiifa_violators.txt

2025-06-04 15:17:54,761 ERROR   QIIFA is in enforcing mode, returning failure to caller

1. 解决办法

注意到在日志中有如下打印:

025-06-04 15:17:54,759 WARNING AIDL Skipped INTF from Skipped List vendor.qti.hardware.display.config

说明高通对某些接口是停用了 QIIFA 检查的。

由于我在 vendor 下新增的自定义 AIDL 接口与 AOSP 和 Qualcomm 完全无关,且当前开发阶段我们也没有对接口版本进行冻结的计划,所以我们也可以停用 QIIFA 对该自定义接口的检查,从而解决编译问题。

具体操作为,在 vendor/qcom/proprietary/commonsys-intf/QIIFA-cmd/aidl/qiifa_aidl_skipped_interfaces.jsonALL 字段中添加我们的自定义服务名:

{
    "ALL":["vendor.qti.hardware.display.config",
           "vendor.qti.hardware.agm",
           "vendor.qti.hardware.pal",
           "android.hardware.light",
           "android.hardware.security.keymint",
           "vendor.qti.hardware.ListenSoundModelAidl",
           "vendor.qti.qvirtvendor",
           "vendor.qti.sec.featuremanager",
           "vendor.xxxx.audioservice"],

	......
}

同理,如果新增的是 HIDL 接口,那么就修改 vendor/qcom/proprietary/commonsys-intf/QIIFA-cmd/hidl/qiifa_hidl_skipped_interfaces.txt

经试验,做如上修改后,Android 整包编译可以成功。


2. 补充资料

高通文档 (DCN: 80-13043-2) 中有以下描述:

Qualcomm Interface Integrity Framework for Android (QIIFA), by definition, is to maintain backward compatibility between the QSSI and vendor image. QIIFA framework is a generic framework, so it can be extended to any other place in the Android system to monitor backward compatibility.

- Ensure backward compatibility between system and vendor.
- Determine interface compatibility between QSSI and vendor partition across chipsets.

The interfaces between QSSI and vendor that QIIFA monitors for backward compatibility include:

- HIDL interface
- VNDK interface
- SP-HAL interface

简单理解就是 QIIFA 是为了满足 Qualcomm Single System Image (QSSI) 的开发需要而引入的,但也可以单独用作上述接口兼容性检查的工具。在 Android 14 上,QIIFA 也会对 AIDL 接口进行兼容性检查。 前一点也能从脚本 vendor/qcom/opensource/core-utils/build/build_image_standalone.pybuild_superimage 函数实现中看出来:

  # Run QIIFA checks to ensure these builds are compatible, before merging them.
  if not skip_qiifa:
    if QSSI_TARGET == "qssi" or QSSI_TARGET == "qssi_64" or QSSI_TARGET == "qssi_au" :
      run_qiifa_checks(temp_dir, qssi_build_path, target_build_path, merged_build_path, target_lunch)
    else:
      logging.info("Skipping QIIFA checks for 32-bit and Go targets")

根据上述文档及 vendor/qcom/proprietary/commonsys-intf/QIIFA-fwk/qiifa_main.py 脚本提供的帮助信息,我们也可以通过为新增的 AIDL 接口生成 CMD 信息来消除编译错误。命令类似于:

python qiifa_main.py --create aidl_new vendor.xxxx.audioservice

如果是扩展已有的 AIDL 接口,通过类似以下命令来更新 CMD 信息:

python qiifa_main.py --create aidl_one vendor.xxxx.audioservice

不过在我的开发环境下,这两个命令无效。感兴趣的朋友可以自己进一步研究。

posted @ 2025-06-04 17:26  Qidi_Huang  阅读(361)  评论(0)    收藏  举报