change the callerlogger
This commit is contained in:
@@ -20,7 +20,7 @@ import com.mogo.commons.crash.FinalizeCrashFixer;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.device.Devices;
|
||||
import com.mogo.commons.network.NetConfigUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipDrawable;
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
|
||||
import com.mogo.eagle.core.utilcode.util.AppStateManager;
|
||||
@@ -29,7 +29,6 @@ import com.mogo.eagle.core.utilcode.util.CleanUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadPoolService;
|
||||
import com.mogo.eagle.core.utilcode.util.Utils;
|
||||
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.plugins.RxJavaPlugins;
|
||||
|
||||
/**
|
||||
@@ -66,7 +65,7 @@ public abstract class AbsMogoApplication extends Application {
|
||||
|
||||
private void initRxJavaErrorHandler() {
|
||||
RxJavaPlugins.setErrorHandler(throwable -> {
|
||||
Logger.e("RxJava", throwable, null);
|
||||
CallerLogger.INSTANCE.e("RxJava", "" + throwable);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -184,7 +183,7 @@ public abstract class AbsMogoApplication extends Application {
|
||||
return;
|
||||
}
|
||||
if (!dnsCacheIp.equals(cacheIp)) {
|
||||
Logger.d("TEST-SOCKET", "获取缓存Dns IP : " + dnsCacheIp + " , 原缓存 IP : " + cacheIp);
|
||||
CallerLogger.INSTANCE.d("TEST-SOCKET", "获取缓存Dns IP : " + dnsCacheIp + " , 原缓存 IP : " + cacheIp);
|
||||
socketTTL();
|
||||
this.cacheIp = dnsCacheIp;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
package com.mogo.commons.crash;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.AppStateManager;
|
||||
import com.mogo.eagle.core.utilcode.util.IAppStateListener;
|
||||
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.LifecycleEventObserver;
|
||||
import androidx.lifecycle.ProcessLifecycleOwner;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
@@ -40,10 +36,10 @@ public class FinalizeCrashFixer {
|
||||
AppStateManager.INSTANCE.registerAppStateListener(isForeground -> {
|
||||
if (isForeground) {
|
||||
//前后台则重新反射关闭一遍,避免线程被再次开启
|
||||
Logger.d("FinalizeCrashFixer", "--- 切换到前台 ---");
|
||||
} else {
|
||||
CallerLogger.INSTANCE.d("FinalizeCrashFixer", "--- 切换到前台 ---");
|
||||
} else {
|
||||
//前后台则重新反射关闭一遍,避免线程被再次开启
|
||||
Logger.d("FinalizeCrashFixer", "--- 切换到后台 ---");
|
||||
CallerLogger.INSTANCE.d("FinalizeCrashFixer", "--- 切换到后台 ---");
|
||||
}
|
||||
realFix();
|
||||
});
|
||||
|
||||
@@ -7,7 +7,6 @@ import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadPoolService;
|
||||
|
||||
public
|
||||
@@ -35,7 +34,6 @@ class Devices {
|
||||
super.onChange( selfChange );
|
||||
ThreadPoolService.execute( () -> {
|
||||
checkBindState();
|
||||
Logger.d( TAG, "lock status changed. the last val = " + sIsBind );
|
||||
} );
|
||||
}
|
||||
} );
|
||||
|
||||
@@ -3,6 +3,9 @@ package com.mogo.commons.network;
|
||||
import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.collection.ArrayMap;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
@@ -11,7 +14,7 @@ import com.mogo.eagle.core.network.Constants;
|
||||
import com.mogo.eagle.core.network.LocationHelper;
|
||||
import com.mogo.eagle.core.network.ServerParam;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.CommonUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.DeviceIdUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.WindowUtils;
|
||||
@@ -21,70 +24,67 @@ import java.net.URLEncoder;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.collection.ArrayMap;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
public class ParamsUtil {
|
||||
|
||||
private static final String TAG = "ParamsUtil";
|
||||
|
||||
public static Map< String, Object > getDynamicParams() {
|
||||
Map< String, Object > params = new ArrayMap();
|
||||
public static Map<String, Object> getDynamicParams() {
|
||||
Map<String, Object> params = new ArrayMap();
|
||||
|
||||
final Map< String, Object > location = LocationHelper.getInstance().getLocationProperties();
|
||||
if ( location != null ) {
|
||||
params.putAll( location );
|
||||
final Map<String, Object> location = LocationHelper.getInstance().getLocationProperties();
|
||||
if (location != null) {
|
||||
params.putAll(location);
|
||||
}
|
||||
params.put( ServerParam.NET_TYPE, CommonUtils.getNetworkType( AbsMogoApplication.getApp() ) );
|
||||
params.put( ServerParam.CELL_ID, Utils.getCellId( AbsMogoApplication.getApp() ) );
|
||||
params.put(ServerParam.NET_TYPE, CommonUtils.getNetworkType(AbsMogoApplication.getApp()));
|
||||
params.put(ServerParam.CELL_ID, Utils.getCellId(AbsMogoApplication.getApp()));
|
||||
|
||||
// params.put( ServerParam.DISPLAY_ID, DeviceUtil.getSystemVersion() );
|
||||
params.put( ServerParam.SN, MoGoAiCloudClientConfig.getInstance().getSn());
|
||||
params.put( ServerParam.TICKET, SpStorage.getTicket() );
|
||||
params.put(ServerParam.SN, MoGoAiCloudClientConfig.getInstance().getSn());
|
||||
params.put(ServerParam.TICKET, SpStorage.getTicket());
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
private static final Map< String, Object > STATIC_PARAMS = new ArrayMap<>();
|
||||
private static final Map<String, Object> STATIC_PARAMS = new ArrayMap<>();
|
||||
|
||||
static {
|
||||
STATIC_PARAMS.put( ServerParam.BRAND, Build.BRAND );
|
||||
STATIC_PARAMS.put( ServerParam.MANUFACTURER, Build.MANUFACTURER );
|
||||
STATIC_PARAMS.put( ServerParam.MODEL, Build.MODEL );
|
||||
STATIC_PARAMS.put( ServerParam.PRODUCT, Build.PRODUCT );
|
||||
STATIC_PARAMS.put( ServerParam.OS, Constants.OS );
|
||||
STATIC_PARAMS.put( ServerParam.OS_VERSION, Build.VERSION.RELEASE );
|
||||
STATIC_PARAMS.put( ServerParam.MOBILE_MODEL, CommonUtils.getModel() );
|
||||
STATIC_PARAMS.put( ServerParam.VERSION_CODE, CommonUtils.getVersionCode( AbsMogoApplication.getApp() ) );
|
||||
STATIC_PARAMS.put( ServerParam.VERSION_NAME, CommonUtils.getVersionName( AbsMogoApplication.getApp() ) );
|
||||
STATIC_PARAMS.put( ServerParam.SCREEN_PIXELS, WindowUtils.getScreenPixels( AbsMogoApplication.getApp() ) );
|
||||
STATIC_PARAMS.put( ServerParam.ANDROID_ID, CommonUtils.getAndroidID( AbsMogoApplication.getApp() ) );
|
||||
STATIC_PARAMS.put( ServerParam.DEVICE_ID, DeviceIdUtils.getDeviceId( AbsMogoApplication.getApp() ) );
|
||||
STATIC_PARAMS.put( ServerParam.IMEI, CommonUtils.getIMEI( AbsMogoApplication.getApp() ) );
|
||||
STATIC_PARAMS.put( ServerParam.IMSI, CommonUtils.getIMSI( AbsMogoApplication.getApp() ) );
|
||||
STATIC_PARAMS.put( ServerParam.FOTA_VERSION, Utils.getFotaVersion() );
|
||||
STATIC_PARAMS.put( ServerParam.END_POINT, ServerParam.END_POINT_CAR );
|
||||
STATIC_PARAMS.put(ServerParam.BRAND, Build.BRAND);
|
||||
STATIC_PARAMS.put(ServerParam.MANUFACTURER, Build.MANUFACTURER);
|
||||
STATIC_PARAMS.put(ServerParam.MODEL, Build.MODEL);
|
||||
STATIC_PARAMS.put(ServerParam.PRODUCT, Build.PRODUCT);
|
||||
STATIC_PARAMS.put(ServerParam.OS, Constants.OS);
|
||||
STATIC_PARAMS.put(ServerParam.OS_VERSION, Build.VERSION.RELEASE);
|
||||
STATIC_PARAMS.put(ServerParam.MOBILE_MODEL, CommonUtils.getModel());
|
||||
STATIC_PARAMS.put(ServerParam.VERSION_CODE, CommonUtils.getVersionCode(AbsMogoApplication.getApp()));
|
||||
STATIC_PARAMS.put(ServerParam.VERSION_NAME, CommonUtils.getVersionName(AbsMogoApplication.getApp()));
|
||||
STATIC_PARAMS.put(ServerParam.SCREEN_PIXELS, WindowUtils.getScreenPixels(AbsMogoApplication.getApp()));
|
||||
STATIC_PARAMS.put(ServerParam.ANDROID_ID, CommonUtils.getAndroidID(AbsMogoApplication.getApp()));
|
||||
STATIC_PARAMS.put(ServerParam.DEVICE_ID, DeviceIdUtils.getDeviceId(AbsMogoApplication.getApp()));
|
||||
STATIC_PARAMS.put(ServerParam.IMEI, CommonUtils.getIMEI(AbsMogoApplication.getApp()));
|
||||
STATIC_PARAMS.put(ServerParam.IMSI, CommonUtils.getIMSI(AbsMogoApplication.getApp()));
|
||||
STATIC_PARAMS.put(ServerParam.FOTA_VERSION, Utils.getFotaVersion());
|
||||
STATIC_PARAMS.put(ServerParam.END_POINT, ServerParam.END_POINT_CAR);
|
||||
}
|
||||
|
||||
public static Map< String, Object > getStaticParams() {
|
||||
public static Map<String, Object> getStaticParams() {
|
||||
return STATIC_PARAMS;
|
||||
}
|
||||
|
||||
public static Map< String, Object > getAnalyticsCustomParams() {
|
||||
Map< String, Object > map = new ArrayMap<>();
|
||||
map.put( "debug", DebugConfig.isDebug() ? 1 : 0 );
|
||||
public static Map<String, Object> getAnalyticsCustomParams() {
|
||||
Map<String, Object> map = new ArrayMap<>();
|
||||
map.put("debug", DebugConfig.isDebug() ? 1 : 0);
|
||||
String fota = Utils.getFotaVersion();
|
||||
map.put( "systemversion", TextUtils.isEmpty( fota ) ? DebugConfig.getProductFlavor() : fota );
|
||||
map.put( "sn", MoGoAiCloudClientConfig.getInstance().getSn() );
|
||||
map.put("systemversion", TextUtils.isEmpty(fota) ? DebugConfig.getProductFlavor() : fota);
|
||||
map.put("sn", MoGoAiCloudClientConfig.getInstance().getSn());
|
||||
return map;
|
||||
}
|
||||
|
||||
public static RequestBody convert( Map< String, Object > map ) {
|
||||
String json = GsonUtil.getGson().toJson( map );
|
||||
Logger.d( TAG, "request params: %s", json );
|
||||
RequestBody requestBody = RequestBody.create( okhttp3.MediaType.parse( "application/json; charset=utf-8" ), json );
|
||||
return requestBody;
|
||||
public static RequestBody convert(Map<String, Object> map) {
|
||||
String json = GsonUtil.getGson().toJson(map);
|
||||
CallerLogger.INSTANCE.d(TAG, "request params : " + json);
|
||||
return RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), json);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -95,43 +95,43 @@ public class ParamsUtil {
|
||||
* @param businessParams query 串中不需要保留的参数,一般为业务参数
|
||||
* @return
|
||||
*/
|
||||
public static String toQueryUrl( @NonNull String url, Map< String, Object > params, Map< String, Object > businessParams ) {
|
||||
public static String toQueryUrl(@NonNull String url, Map<String, Object> params, Map<String, Object> businessParams) {
|
||||
|
||||
if ( TextUtils.isEmpty( url ) ) {
|
||||
if (TextUtils.isEmpty(url)) {
|
||||
return url;
|
||||
}
|
||||
|
||||
params = diff( params, businessParams );
|
||||
if ( params == null || params.isEmpty() ) {
|
||||
params = diff(params, businessParams);
|
||||
if (params == null || params.isEmpty()) {
|
||||
return url;
|
||||
}
|
||||
final Set< String > keys = params.keySet();
|
||||
final Set<String> keys = params.keySet();
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for ( String key : keys ) {
|
||||
if ( TextUtils.isEmpty( key ) ) {
|
||||
Logger.w( TAG, "key is illegal" );
|
||||
for (String key : keys) {
|
||||
if (TextUtils.isEmpty(key)) {
|
||||
CallerLogger.INSTANCE.w(TAG, "key is illegal");
|
||||
continue;
|
||||
}
|
||||
|
||||
final Object value = params.get( key );
|
||||
if ( value == null ) {
|
||||
Logger.w( TAG, "%s - value is illegal", key );
|
||||
final Object value = params.get(key);
|
||||
if (value == null) {
|
||||
CallerLogger.INSTANCE.w(TAG, key + " value is illegal");
|
||||
continue;
|
||||
}
|
||||
String targetValue = value.toString();
|
||||
try {
|
||||
targetValue = URLEncoder.encode( targetValue, "utf-8" );
|
||||
} catch ( UnsupportedEncodingException e ) {
|
||||
targetValue = URLEncoder.encode(targetValue, "utf-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
targetValue = value.toString();
|
||||
}
|
||||
builder.append( key ).append( "=" ).append( targetValue ).append( "&" );
|
||||
builder.append(key).append("=").append(targetValue).append("&");
|
||||
}
|
||||
String queryString = builder.toString();
|
||||
if ( queryString.endsWith( "&" ) ) {
|
||||
queryString = queryString.substring( 0, queryString.length() - 1 );
|
||||
if (queryString.endsWith("&")) {
|
||||
queryString = queryString.substring(0, queryString.length() - 1);
|
||||
}
|
||||
|
||||
if ( !url.endsWith( "?" ) ) {
|
||||
if (!url.endsWith("?")) {
|
||||
url += "?";
|
||||
}
|
||||
return url + queryString;
|
||||
@@ -142,15 +142,15 @@ public class ParamsUtil {
|
||||
* @param child 业务参数
|
||||
* @return
|
||||
*/
|
||||
public static Map< String, Object > diff( Map< String, Object > parent, Map< String, Object > child ) {
|
||||
if ( parent == null || parent.isEmpty() || child == null || child.isEmpty() ) {
|
||||
public static Map<String, Object> diff(Map<String, Object> parent, Map<String, Object> child) {
|
||||
if (parent == null || parent.isEmpty() || child == null || child.isEmpty()) {
|
||||
return parent;
|
||||
}
|
||||
for ( String key : child.keySet() ) {
|
||||
if ( TextUtils.isEmpty( key ) || TextUtils.equals( "extra_id", key ) ) {
|
||||
for (String key : child.keySet()) {
|
||||
if (TextUtils.isEmpty(key) || TextUtils.equals("extra_id", key)) {
|
||||
continue;
|
||||
}
|
||||
parent.remove( key );
|
||||
parent.remove(key);
|
||||
}
|
||||
return parent;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.mogo.commons.voice;
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.tts.base.IMogoTTS;
|
||||
import com.mogo.tts.base.MogoTTSConstants;
|
||||
@@ -23,11 +23,11 @@ public class AIAssist {
|
||||
|
||||
private IMogoTTS mTTS;
|
||||
|
||||
public static AIAssist getInstance( Context context ) {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( AIAssist.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new AIAssist( context );
|
||||
public static AIAssist getInstance(Context context) {
|
||||
if (sInstance == null) {
|
||||
synchronized (AIAssist.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new AIAssist(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,20 +35,20 @@ public class AIAssist {
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
if ( mTTS != null ) {
|
||||
if (mTTS != null) {
|
||||
try {
|
||||
mTTS.release();
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "release" );
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(TAG, "release has exception : " + e);
|
||||
}
|
||||
}
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
|
||||
private AIAssist( Context context ) {
|
||||
private AIAssist(Context context) {
|
||||
try {
|
||||
mTTS = ( IMogoTTS ) ARouter.getInstance().build( MogoTTSConstants.API_PATH ).navigation( context.getApplicationContext() );
|
||||
mTTS = (IMogoTTS) ARouter.getInstance().build(MogoTTSConstants.API_PATH).navigation(context.getApplicationContext());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
ToastUtils.showShort("TTS 模块初始化异常");
|
||||
@@ -61,7 +61,7 @@ public class AIAssist {
|
||||
* @return
|
||||
*/
|
||||
public boolean hasFlush() {
|
||||
if ( mTTS != null ) {
|
||||
if (mTTS != null) {
|
||||
return mTTS.hasFlush();
|
||||
}
|
||||
return false;
|
||||
@@ -72,9 +72,9 @@ public class AIAssist {
|
||||
*
|
||||
* @param text
|
||||
*/
|
||||
public void speakTTSVoice( String text, IMogoVoiceCmdCallBack callBack ) {
|
||||
if ( mTTS != null ) {
|
||||
mTTS.speakTTSVoice( text, callBack );
|
||||
public void speakTTSVoice(String text, IMogoVoiceCmdCallBack callBack) {
|
||||
if (mTTS != null) {
|
||||
mTTS.speakTTSVoice(text, callBack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,9 +83,9 @@ public class AIAssist {
|
||||
*
|
||||
* @param text
|
||||
*/
|
||||
public void speakTTSVoice( String text ) {
|
||||
if ( mTTS != null ) {
|
||||
mTTS.speakTTSVoice( text );
|
||||
public void speakTTSVoice(String text) {
|
||||
if (mTTS != null) {
|
||||
mTTS.speakTTSVoice(text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,11 +95,11 @@ public class AIAssist {
|
||||
* @param text 播报内容
|
||||
* @param type 播报策略
|
||||
*/
|
||||
public void speakTTSVoice( String text, VoicePreemptType type, IMogoVoiceCmdCallBack callBack ) {
|
||||
if ( mTTS != null ) {
|
||||
public void speakTTSVoice(String text, VoicePreemptType type, IMogoVoiceCmdCallBack callBack) {
|
||||
if (mTTS != null) {
|
||||
PreemptType preemptType = PreemptType.PREEMPT_TYPE_NONE;
|
||||
if ( type != null ) {
|
||||
switch ( type ) {
|
||||
if (type != null) {
|
||||
switch (type) {
|
||||
case PREEMPT_TYPE_FLUSH:
|
||||
preemptType = PreemptType.PREEMPT_TYPE_FLUSH;
|
||||
break;
|
||||
@@ -114,18 +114,18 @@ public class AIAssist {
|
||||
break;
|
||||
}
|
||||
}
|
||||
mTTS.speakTTSVoice( text, preemptType, callBack );
|
||||
mTTS.speakTTSVoice(text, preemptType, callBack);
|
||||
}
|
||||
}
|
||||
|
||||
public void stopSpeakTts(String tts) {
|
||||
if ( mTTS != null ) {
|
||||
if (mTTS != null) {
|
||||
mTTS.stopSpeakTts(tts);
|
||||
}
|
||||
}
|
||||
|
||||
public void stopTts() {
|
||||
if ( mTTS != null ) {
|
||||
if (mTTS != null) {
|
||||
mTTS.stopTts();
|
||||
}
|
||||
}
|
||||
@@ -135,9 +135,9 @@ public class AIAssist {
|
||||
*
|
||||
* @param tts 播报内容
|
||||
*/
|
||||
public void speakQAndACmd( String tts, IMogoVoiceCmdCallBack callBack ) {
|
||||
if ( mTTS != null ) {
|
||||
mTTS.speakQAndACmd( tts, callBack );
|
||||
public void speakQAndACmd(String tts, IMogoVoiceCmdCallBack callBack) {
|
||||
if (mTTS != null) {
|
||||
mTTS.speakQAndACmd(tts, callBack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,9 +148,9 @@ public class AIAssist {
|
||||
* @param okCmds 确认命令唤醒词
|
||||
* @param cancelCmds 取消命令唤醒词
|
||||
*/
|
||||
public void speakQAndACmd( String tts, String[] okCmds, String[] cancelCmds, IMogoVoiceCmdCallBack callBack ) {
|
||||
if ( mTTS != null ) {
|
||||
mTTS.speakQAndACmd( tts, okCmds, cancelCmds, callBack );
|
||||
public void speakQAndACmd(String tts, String[] okCmds, String[] cancelCmds, IMogoVoiceCmdCallBack callBack) {
|
||||
if (mTTS != null) {
|
||||
mTTS.speakQAndACmd(tts, okCmds, cancelCmds, callBack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,9 +161,9 @@ public class AIAssist {
|
||||
* @param cmdWords
|
||||
* @param callBack
|
||||
*/
|
||||
public void registerUnWakeupCommand( String cmd, String[] cmdWords, IMogoVoiceCmdCallBack callBack ) {
|
||||
if ( mTTS != null ) {
|
||||
mTTS.registerUnWakeupCommand( cmd, cmdWords, callBack );
|
||||
public void registerUnWakeupCommand(String cmd, String[] cmdWords, IMogoVoiceCmdCallBack callBack) {
|
||||
if (mTTS != null) {
|
||||
mTTS.registerUnWakeupCommand(cmd, cmdWords, callBack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,9 +172,9 @@ public class AIAssist {
|
||||
*
|
||||
* @param cmd
|
||||
*/
|
||||
public synchronized void unregisterUnWakeupCommand( String cmd ) {
|
||||
if ( mTTS != null ) {
|
||||
mTTS.unregisterUnWakeupCommand( cmd );
|
||||
public synchronized void unregisterUnWakeupCommand(String cmd) {
|
||||
if (mTTS != null) {
|
||||
mTTS.unregisterUnWakeupCommand(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,47 +183,47 @@ public class AIAssist {
|
||||
*
|
||||
* @param cmd
|
||||
*/
|
||||
public synchronized void unregisterUnWakeupCommand( String cmd, IMogoVoiceCmdCallBack callBack ) {
|
||||
if ( mTTS != null ) {
|
||||
mTTS.unregisterUnWakeupCommand( cmd, callBack );
|
||||
public synchronized void unregisterUnWakeupCommand(String cmd, IMogoVoiceCmdCallBack callBack) {
|
||||
if (mTTS != null) {
|
||||
mTTS.unregisterUnWakeupCommand(cmd, callBack);
|
||||
}
|
||||
}
|
||||
|
||||
public void startAssistant( Context context ) {
|
||||
startAssistant( context, 1 );
|
||||
public void startAssistant(Context context) {
|
||||
startAssistant(context, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param status window_start_cancel 0 - 结束, 1 - 显示, 2 - 未激活调试进入
|
||||
*/
|
||||
public void startAssistant( Context context, int status ) {
|
||||
if ( mTTS != null ) {
|
||||
mTTS.startAIAssist( context, status );
|
||||
public void startAssistant(Context context, int status) {
|
||||
if (mTTS != null) {
|
||||
mTTS.startAIAssist(context, status);
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void flush() {
|
||||
if ( mTTS != null ) {
|
||||
if (mTTS != null) {
|
||||
mTTS.flush();
|
||||
}
|
||||
}
|
||||
|
||||
public void speakTTSAndDuck( String text ) {
|
||||
if ( mTTS != null ) {
|
||||
mTTS.speakTTSAndDuck( text );
|
||||
public void speakTTSAndDuck(String text) {
|
||||
if (mTTS != null) {
|
||||
mTTS.speakTTSAndDuck(text);
|
||||
}
|
||||
}
|
||||
|
||||
public void speakTTSAndDuck( String text, IMogoVoiceCmdCallBack callBack ) {
|
||||
if ( mTTS != null ) {
|
||||
mTTS.speakTTSAndDuck( text, callBack );
|
||||
public void speakTTSAndDuck(String text, IMogoVoiceCmdCallBack callBack) {
|
||||
if (mTTS != null) {
|
||||
mTTS.speakTTSAndDuck(text, callBack);
|
||||
}
|
||||
}
|
||||
|
||||
public void shutUp( String ttsId, String text ) {
|
||||
if ( mTTS != null ) {
|
||||
mTTS.shutUp( ttsId, text );
|
||||
public void shutUp(String ttsId, String text) {
|
||||
if (mTTS != null) {
|
||||
mTTS.shutUp(ttsId, text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,14 +232,14 @@ public class AIAssist {
|
||||
* 语音SDK生效版本从1.0.8.4版本起
|
||||
*/
|
||||
public void breakOffSpeak() {
|
||||
if ( mTTS != null ) {
|
||||
if (mTTS != null) {
|
||||
mTTS.breakOffSpeak();
|
||||
}
|
||||
}
|
||||
|
||||
public void clearTTSCallback( String text ) {
|
||||
if ( mTTS != null ) {
|
||||
mTTS.clearTTSCallback( text );
|
||||
public void clearTTSCallback(String text) {
|
||||
if (mTTS != null) {
|
||||
mTTS.clearTTSCallback(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user