Merge branch 'qa_1.1.8' into qa_1.1.8_easy_mode

This commit is contained in:
董宏宇
2020-12-01 15:24:50 +08:00
5 changed files with 40 additions and 12 deletions

View File

@@ -2,6 +2,7 @@ package com.zhidao.roadcondition.service
import com.mogo.commons.AbsMogoApplication
import com.zhidao.auto.platform.voice.VoiceClient
import java.lang.Exception
/**
* @description 声音控制类
@@ -45,7 +46,11 @@ object VoiceController {
* @param customType 命令
*/
fun unRegisterCustomWakeupCmd(customType: String) {
voiceClient.unRegisterCustomWakeupCmd(customType)
try {
voiceClient.unRegisterCustomWakeupCmd(customType)
} catch (e:Exception){
}
}
/**

View File

@@ -1,9 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/dp_16" />
<gradient
android:angle="180"
android:endColor="#E6E6E6"
android:startColor="#DDDDDD" />
</shape>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/module_callchatting_user_pop_call_bg_normal_light" android:state_pressed="false" />
<item android:drawable="@drawable/module_callchatting_user_pop_call_bg_pressed_light" android:state_pressed="true" />
</selector>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/dp_16" />
<gradient
android:angle="0"
android:endColor="#E6E6E6"
android:startColor="#DDDDDD" />
</shape>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/dp_16" />
<gradient
android:angle="0"
android:endColor="#CBCBCB"
android:startColor="#C0C0C0" />
</shape>

View File

@@ -45,7 +45,10 @@ class ZhiTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack, OnTtsListener {
Logger.d( TAG, "release" );
if ( mCmdMap != null && !mCmdMap.isEmpty() && mVoiceClient != null ) {
for ( String cmd : mCmdMap.keySet() ) {
mVoiceClient.unRegisterCustomWakeupCmd( cmd );
try {
mVoiceClient.unRegisterCustomWakeupCmd( cmd );
} catch ( Exception e ) {
}
}
}
mQAndAMap.clear();
@@ -314,7 +317,10 @@ class ZhiTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack, OnTtsListener {
*/
public synchronized void unregisterUnWakeupCommand( String cmd ) {
mCmdMap.remove( cmd );
mVoiceClient.unRegisterCustomWakeupCmd( cmd );
try {
mVoiceClient.unRegisterCustomWakeupCmd( cmd );
} catch ( Exception e ) {
}
mCacheUnWakeupCommands.remove( cmd );
}
@@ -331,7 +337,10 @@ class ZhiTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack, OnTtsListener {
}
if ( callBacks.isEmpty() ) {
mCmdMap.remove( cmd );
mVoiceClient.unRegisterCustomWakeupCmd( cmd );
try {
mVoiceClient.unRegisterCustomWakeupCmd( cmd );
} catch ( Exception e ) {
}
mCacheUnWakeupCommands.remove( cmd );
}
}