我正在尝试扩展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.我不明白为什么会有语法错误。有人能告诉我我错过了什么吗?
https://stackoverflow.com/questions/47576364
复制相似问题