Merge branch 'dev' into dev_split_ext_share

# Conflicts:
#	foudations/mogo-commons/src/main/java/com/mogo/commons/debug/DebugConfig.java
This commit is contained in:
tongchenfei
2020-06-09 09:50:33 +08:00
29 changed files with 328 additions and 145 deletions

View File

@@ -122,4 +122,17 @@ public class DebugConfig {
public static int getAIType(){
return sAIType;
}
/**
* 是否作为launcher运行
*/
private static boolean sIsLauncher = false;
public static boolean isLauncher() {
return sIsLauncher;
}
public static void setLauncher( boolean isLauncher ) {
DebugConfig.sIsLauncher = isLauncher;
}
}

View File

@@ -0,0 +1,43 @@
package com.mogo.commons.device;
import android.content.ContentResolver;
import android.database.Cursor;
import android.net.Uri;
import com.mogo.commons.AbsMogoApplication;
public
/**
* @author congtaowang
* @since 2020/6/8
*
* 描述
*/
class Devices {
public static final Uri CONTENT_URI_BIND = Uri.parse( "content://com.zhidao.guide.lock.product.bindstatus/status" );
/**
* 检测车机激活状态
*
* @return
*/
public static boolean checkBindState() {
try {
ContentResolver resolver = AbsMogoApplication.getApp().getContentResolver();
if ( resolver == null ) {
return false;
}
try ( Cursor cursor = resolver.query( CONTENT_URI_BIND, null, null, null, null ) ) {
if ( cursor == null || !cursor.moveToFirst() ) {
return false;
}
int status = cursor.getInt( cursor.getColumnIndex( "lock_status" ) );
return ( status == 1 );
}
} catch ( Exception e ) {
e.printStackTrace();
}
return false;
}
}

View File

@@ -123,9 +123,9 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack, OnTtsListener {
Iterator< IMogoVoiceCmdCallBack > iterator = null;
try {
List< IMogoVoiceCmdCallBack > cmdCallBacks = mCmdMap.get( cmd );
List< IMogoVoiceCmdCallBack > cmdCallBacks = mCmdMap.get( cmd );
iterator = new ArrayList<>( cmdCallBacks ).iterator();
} catch( Exception e ){
} catch ( Exception e ) {
}
while ( iterator != null && iterator.hasNext() ) {
@@ -348,10 +348,18 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack, OnTtsListener {
}
public static void startAssistant( Context context ) {
startAssistant( context, 1 );
}
/**
* @param context
* @param status window_start_cancel 0 - 结束, 1 - 显示, 2 - 未激活调试进入
*/
public static void startAssistant( Context context, int status ) {
final Intent intent = new Intent();
intent.setFlags( Intent.FLAG_INCLUDE_STOPPED_PACKAGES );
intent.setAction( "pvetec.intent.action.txz.switch" );
intent.putExtra( "window_start_cancel", 1 );
intent.putExtra( "window_start_cancel", status );
intent.putExtra( "extra_switch_type", "window_start_cancel" );
context.sendBroadcast( intent );
}
@@ -462,12 +470,12 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack, OnTtsListener {
try {
mSpeakVoiceMap.remove( text );
mogoVoiceManager.shutUp( ttsId );
} catch( Exception e ){
} catch ( Exception e ) {
}
}
public void clearTTSCallback(String text){
public void clearTTSCallback( String text ) {
try {
mSpeakVoiceMap.remove( text );
} catch ( Exception e ) {