[dev_minibus-d_230425_3.2.0] 优化可能出现bug的代码

This commit is contained in:
lixiaopeng
2023-05-29 14:15:16 +08:00
parent 5a9da1f641
commit 8f7758aca2
7 changed files with 59 additions and 36 deletions

View File

@@ -623,15 +623,16 @@ public class PadTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack, OnTtsList
List<IMogoTTSCallback> callBacks = mCmdMap.get(cmd);
if (callBacks != null) {
callBacks.remove(callBack);
}
if (callBacks.isEmpty()) {
mCmdMap.remove(cmd);
try {
mVoiceClient.unRegisterCustomWakeupCmd(cmd);
} catch (Exception e) {
e.printStackTrace();
if (callBacks.isEmpty()) {
mCmdMap.remove(cmd);
try {
mVoiceClient.unRegisterCustomWakeupCmd(cmd);
} catch (Exception e) {
e.printStackTrace();
}
mCacheUnWakeupCommands.remove(cmd);
}
mCacheUnWakeupCommands.remove(cmd);
}
}
}