当用户在mirrorlink模式下点击carkit的语音控制时,会触发哪个api。
假设用户点击安装在方向盘上的语音控制按钮.How来捕捉mirrorlink应用程序中的该事件。
发布于 2016-04-19 17:02:05
MirrorLink CommonAPI服务调用IDeviceStatusListener的onMicrophoneStatusChanged方法。如果参数为true,则麦克风已打开,如果麦克风已关闭,则为false。
CommonAPI:适用于安卓版CommonAPI的https://causeway.carconnectivity.org/wg/DevWG/document/1989 Java Doc:https://causeway.carconnectivity.org/wg/DevWG/document/2119
示例:
IDeviceStatusListener devStatusListener = new IDeviceStatusListener.Stub() {
@Override
public void onDriveModeChange(boolean isDriving) throws RemoteException { }
@Override
public void onNightModeChanged(boolean isNight) throws RemoteException { }
@Override
public void onMicrophoneStatusChanged(boolean micActive) throws RemoteException {
if (micActive) {
//do s.th. great with the microphone input
} else {
//stop your recording or so
}
}
};在设置CommonAPI服务访问的地方,不要忘记将监听程序链接到服务:
devStatMng = commonapiService.getDeviceStatusManager(packagename, devStatusListener);https://stackoverflow.com/questions/36686990
复制相似问题