我正在尝试扩展android.hardware.audio@2.0 :: IDevicesFactory以添加新的Audio HAL。
所以我将整个2.0文件夹复制到2.1文件夹中,并试图扩展界面。这是我的新IDevicesFactory.hal文件:
package android.hardware.audio@2.1;
import android.hardware.audio@2.0::types;
import android.hardware.audio@2.0::IDevicesFactory;
import android.hardware.audio.common@2.0;
import IDevice;
interface IDevicesFactory EXTENDS android.hardware.audio@2.0::IDevicesFactory {
typedef android.hardware.audio@2.0::Result Result;
enum Device : int32_t {
PRIMARY,
A2DP,
USB,
R_SUBMIX,
STUB,
MY_HAL
};
};
[为了便于阅读而删除了代码注释]
我只想将MY_HAL
添加到该枚举中。
我不知道是否需要扩展所有接口,但我会这样做。我还将修改2.1文件夹中的所有源以使用@ 2.1 HIDL(名称空间和类型等)。
我尝试运行hardware/interfaces/update-makefiles.sh
并抛出以下错误:
gps@gps-HP-280-G3-MT:~/andsrc/android-8.0.0_r12$ hardware/interfaces/update-makefiles.sh
Updating makefiles for android.hardware in hardware/interfaces.
Updating android.hardware.audio@2.0
Updating android.hardware.audio@2.1
ERROR: syntax error at hardware/interfaces/audio/2.1/IDevicesFactory.hal:8.27-33
ERROR: syntax error at hardware/interfaces/audio/2.1/IDevicesFactory.hal:19.2
ERROR: Could not parse android.hardware.audio@2.1::IDevicesFactory. Aborting.
我不明白为什么会出现语法错误。有人可以指导我错过的吗?
答案 0 :(得分:0)
我发现了我的问题。
我误解了HIDL的语法,并使用大写EXTENDS
而不是小写extends