关于Android11 开treble后power hal build fail的问题

最近在Android11上遇到如下build fail:
checkvintf E 01-05 22:30:48 334 334 check_vintf.cpp:554] android.hardware.power:
checkvintf E 01-05 22:30:48 334 334 check_vintf.cpp:554] required: IPower/default
checkvintf E 01-05 22:30:48 334 334 check_vintf.cpp:554] provided: @1.0::IPower/default
checkvintf E 01-05 22:30:48 334 334 check_vintf.cpp:554]

checkvintf E 01-05 22:30:48 334 334 check_vintf.cpp:554] android.hardware.power@1.0::IPower/default
checkvintf E 01-05 22:30:48 334 334 check_vintf.cpp:554] Suggested fix:
checkvintf E 01-05 22:30:48 334 334 check_vintf.cpp:554] 1. Update deprecated HALs to the latest version.
checkvintf E 01-05 22:30:48 334 334 check_vintf.cpp:554] 2. Check for any typos in device manifest or framework compatibility matrices with FCM version >= 5.
checkvintf E 01-05 22:30:48 334 334 check_vintf.cpp:554] 3. For new platform HALs, add them to any framework compatibility matrix with FCM version >= 5 where applicable.
checkvintf E 01-05 22:30:48 334 334 check_vintf.cpp:554] 4. For device-specific HALs, add to DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE or DEVICE_PRODUCT_COMPATIBILITY_MATRIX_FILE.: Success
INCOMPATIBLE

问题:
1.系统的兼容性矩阵中确实是如下定义:

android.hardware.power

IPower
default

2.manifest.xml中定义是:

android.hardware.power
hwbinder
1.0

IPower
default


这个地方又不可能不提供版本??所以这是什么问题?

  1. 原生的SDK编译是否有问题?
  2. SDK做了哪些修改?

我拉了一包AOSP的Android11的code想自己玩一下:
仅仅加了下面两个参数:
PRODUCT_SHIPPING_API_LEVEL := 30
PRODUCT_FULL_TREBLE_OVERRIDE := true
看样子是开treble后,HAL的配置问题,想请教下贵司做3568 Android11的时候,有没有遇到过类似的问题。

firefly_zhongw 发表于 2022-1-6 16:13

  1. 原生的SDK编译是否有问题?
  2. SDK做了哪些修改?

我拉了一包AOSP的Android11的code想自己玩一下:
仅仅加了下面两个参数:
PRODUCT_SHIPPING_API_LEVEL := 30
PRODUCT_FULL_TREBLE_OVERRIDE := true
看样子是开treble后,HAL的配置问题,想请教下贵司做3568 Android11的时候,有没有遇到过类似的问题

可以改一下这个文件,重新编译试试

diff --git a/hardware/interfaces/compatibility_matrices/compatibility_matrix.5.xml b/hardware/interfaces/compatibility_matrices/compatibility_matrix.5.xml
index 1c2a053..7b22ebf 100644
--- a/hardware/interfaces/compatibility_matrices/compatibility_matrix.5.xml
+++ b/hardware/interfaces/compatibility_matrices/compatibility_matrix.5.xml
@@ -358,6 +358,7 @@
     </hal>
     <hal format="aidl" optional="false">
         <name>android.hardware.power</name>
+        <version>1.0</version>
         <interface>
             <name>IPower</name>
             <instance>default</instance>

luwy 发表于 2022-1-8 10:33
可以改一下这个文件,重新编译试试

怎么能修改AOSP的东西呢?应该是要自己加一个FCM吧,但是加了好像还是会报这个错误

shen 发表于 2022-1-19 20:25
怎么能修改AOSP的东西呢?应该是要自己加一个FCM吧,但是加了好像还是会报这个错误

在上一个修改的基础上将 → , 我这边可以编译成功