1. 删除无用配置项

2. 内存泄漏优化
3. 监听比亚迪语音播报状态广播
This commit is contained in:
wangcongtao
2020-10-13 19:46:07 +08:00
parent 7292bac9ba
commit da0f3911c9
11 changed files with 58 additions and 53 deletions

View File

@@ -105,8 +105,6 @@ android {
f8xx {
applicationId rootProject.ext.android.fLauncherApplicationId
dimension "product"
// 使用思必驰语音
buildConfigField 'int', 'AIType', '2'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
@@ -125,8 +123,6 @@ android {
f80x {
applicationId rootProject.ext.android.fLauncherApplicationId
dimension "product"
// 使用思必驰语音
buildConfigField 'int', 'AIType', '2'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
@@ -145,8 +141,6 @@ android {
e8xx {
applicationId rootProject.ext.android.launcherApplicationId
dimension "product"
// 使用思必驰语音
buildConfigField 'int', 'AIType', '2'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
@@ -165,8 +159,6 @@ android {
em4 {
applicationId rootProject.ext.android.launcherApplicationId
dimension "product"
// 使用思必驰语音
buildConfigField 'int', 'AIType', '2'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
@@ -185,8 +177,6 @@ android {
em3 {
applicationId rootProject.ext.android.independentApplicationId
dimension "product"
// 使用思必驰语音
buildConfigField 'int', 'AIType', '2'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
@@ -205,8 +195,6 @@ android {
em1 {
applicationId rootProject.ext.android.independentApplicationId
dimension "product"
// 使用思必驰语音
buildConfigField 'int', 'AIType', '2'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
@@ -225,8 +213,6 @@ android {
d8xx {
applicationId rootProject.ext.android.independentApplicationId
dimension "product"
// 使用同行者语音
buildConfigField 'int', 'AIType', '1'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
@@ -245,8 +231,6 @@ android {
d80x {
applicationId rootProject.ext.android.independentApplicationId
dimension "product"
// 使用同行者语音
buildConfigField 'int', 'AIType', '1'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
@@ -265,8 +249,6 @@ android {
d82x {
applicationId rootProject.ext.android.independentApplicationId
dimension "product"
// 使用同行者语音
buildConfigField 'int', 'AIType', '1'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
// 车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '0'
@@ -285,8 +267,6 @@ android {
bydauto {
applicationId rootProject.ext.android.bydautoIndependentApplicationId
dimension "product"
// 不使用语音
buildConfigField 'int', 'AIType', '0'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
// 车机类型主要用于区分自研车机还是别人家的车机其他车机比亚迪定为1
buildConfigField 'int', 'CAR_MACHINE_TYPE', '1'

View File

@@ -114,7 +114,6 @@ public class MogoApplication extends AbsMogoApplication {
}
DebugConfig.setNetMode( BuildConfig.NET_ENV );
DebugConfig.setDebug( BuildConfig.DEBUG );
DebugConfig.setAIType( BuildConfig.AIType );
DebugConfig.setLaunchLocationService( BuildConfig.LAUNCH_LOCATION_SERVICE );
DebugConfig.setUseCustomNavi( BuildConfig.USE_CUSTOM_NAVI );
DebugConfig.setLauncher( BuildConfig.IS_LAUNCHER );

View File

@@ -132,23 +132,6 @@ public class DebugConfig {
DebugConfig.sUseCustomNavi = sUseCustomNavi;
}
/**
* 设置使用哪个语音助手
*
* @param aiType {@link #AI_TYPE_NOOP} {@link #AI_TYPE_TXZ} {@link #AI_TYPE_SPEECH}
*/
public static void setAIType( int aiType ) {
Logger.d( "DebugConfig", "setAiType: " + aiType );
sAIType = aiType;
}
/**
* 使用哪个语音助手 {@link #AI_TYPE_NOOP} {@link #AI_TYPE_TXZ} {@link #AI_TYPE_SPEECH}
*/
public static int getAIType() {
return sAIType;
}
/**
* 设置当前车机类型
*

View File

@@ -41,6 +41,7 @@ import com.mogo.map.impl.amap.marker.AMapMarkerWrapper;
import com.mogo.map.impl.amap.message.AMapMessageListener;
import com.mogo.map.impl.amap.message.AMapMessageManager;
import com.mogo.map.impl.amap.navi.NaviClient;
import com.mogo.map.impl.amap.uicontroller.AMapUIController;
import com.mogo.map.impl.amap.utils.MogoMapUtils;
import com.mogo.map.impl.amap.utils.ObjectUtils;
import com.mogo.map.listener.MogoMapListenerHandler;
@@ -234,6 +235,8 @@ public class AMapNaviViewWrapper implements IMogoMapView,
public void onDestroy() {
if ( mMapView != null ) {
mMapView.onDestroy();
AMapUIController.getInstance().release();
AMapWrapper.release();
Logger.d( TAG, "map onDestroy" );
}
}

View File

@@ -39,6 +39,7 @@ import com.mogo.map.impl.amap.marker.AMapMarkerWrapper;
import com.mogo.map.impl.amap.message.AMapMessageListener;
import com.mogo.map.impl.amap.message.AMapMessageManager;
import com.mogo.map.impl.amap.navi.NaviClient;
import com.mogo.map.impl.amap.uicontroller.AMapUIController;
import com.mogo.map.impl.amap.utils.MogoMapUtils;
import com.mogo.map.impl.amap.utils.ObjectUtils;
import com.mogo.map.listener.MogoMapListenerHandler;
@@ -236,6 +237,8 @@ public class AMapViewWrapper implements IMogoMapView,
public void onDestroy() {
if ( mMapView != null ) {
mMapView.onDestroy();
AMapUIController.getInstance().release();
AMapWrapper.release();
Logger.d( TAG, "map onDestroy" );
}
}

View File

@@ -56,6 +56,10 @@ public class AMapWrapper implements IMogoMap {
return sAMap;
}
public static void release(){
sAMap = null;
}
@Override
public IMogoUiSettings getUiSettings() {
if ( !checkAMap() ) {

View File

@@ -51,6 +51,7 @@ public class AMapUIController implements IMogoMapUIController {
}
public synchronized void release() {
mClient = null;
sInstance = null;
}

View File

@@ -1,11 +1,8 @@
package com.mogo.module.service.marker;
import android.content.Context;
import android.graphics.BitmapFactory;
import android.graphics.Rect;
import android.text.TextUtils;
import android.util.Log;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.LinearInterpolator;
import com.mogo.commons.AbsMogoApplication;
@@ -17,9 +14,7 @@ import com.mogo.map.marker.IMogoMarkerManager;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.map.marker.anim.OnMarkerAnimationListener;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.module.carchattingprovider.ICallProviderResponse;
import com.mogo.module.common.ModuleNames;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.api.CallChatApi;
import com.mogo.module.common.entity.MarkerCarPois;
import com.mogo.module.common.entity.MarkerCardResult;
@@ -30,7 +25,6 @@ import com.mogo.module.common.entity.MarkerOnlineCar;
import com.mogo.module.common.entity.MarkerResponse;
import com.mogo.module.common.entity.MarkerShareMusic;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.common.utils.CarSeries;
import com.mogo.module.service.MarkerServiceHandler;
import com.mogo.module.service.R;
import com.mogo.module.service.ServiceConst;
@@ -48,8 +42,6 @@ import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.WorkThreadHandler;
import com.mogo.utils.logger.Logger;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
@@ -225,7 +217,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
}
}
MarkerServiceHandler.getMogoStatusManager().setUserInteractionStatus( TAG, true, false );
MarkerServiceHandler.getMapUIController().moveToCenter( mogoMarker.getPosition(), CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X );
MarkerServiceHandler.getMapUIController().moveToCenter( mogoMarker.getPosition(), DebugConfig.isRoadEventAnimated() );
}
private void updateCarUserInfoWindow( IMogoMarker marker ) {

View File

@@ -42,8 +42,12 @@ dependencies {
if (Boolean.valueOf(RELEASE)) {
implementation rootProject.ext.dependencies.ttsbase
implementation rootProject.ext.dependencies.mogoutils
implementation rootProject.ext.dependencies.mogocommons
} else {
implementation project(":tts:tts-base")
implementation project(":foudations:mogo-utils")
implementation project(":foudations:mogo-commons")
}
}

View File

@@ -19,7 +19,7 @@ public
@Route( path = MogoTTSConstants.API_PATH )
class DiTTS implements IMogoTTS {
private static final String TAG = "DiTTS";
public static final String TAG = "DiTTS";
private Context mContext;
@@ -36,7 +36,7 @@ class DiTTS implements IMogoTTS {
@Override
public void speakTTSVoice( String tts ) {
TTSManager.getInstance().speakTTS( mContext, tts );
TTSManager.getInstance( mContext ).speakTTS( mContext, tts );
}
@Override
@@ -86,7 +86,7 @@ class DiTTS implements IMogoTTS {
@Override
public void breakOffSpeak() {
TTSManager.getInstance().breakOffSpeak( mContext );
TTSManager.getInstance( mContext ).breakOffSpeak( mContext );
}
@Override

View File

@@ -1,7 +1,13 @@
package com.mogo.tts.noop;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.util.Log;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.utils.logger.Logger;
public
/**
@@ -40,14 +46,44 @@ class TTSManager {
private static volatile TTSManager sInstance;
private TTSManager() {
private TTSManager( Context context ) {
if ( DebugConfig.isDebug() && context != null ) {
TTSStatusReceiver receiver = new TTSStatusReceiver();
IntentFilter filter = new IntentFilter();
filter.addAction( "com.byd.NotifyService.thirdTtsFeedback" );
context.registerReceiver( receiver, filter );
}
}
public static TTSManager getInstance() {
private static class TTSStatusReceiver extends BroadcastReceiver {
@Override
public void onReceive( Context context, Intent intent ) {
Logger.d( DiTTS.TAG, "receive tts callback status" );
int state = intent.getExtras().getInt( "thirdTtsFeedback" );
switch ( state ) {
case 0:
Logger.d( DiTTS.TAG, "反馈:" + "state=0 无法播报" );
break;
case 1:
Log.d( DiTTS.TAG, "反馈:" + "state=1 开始播报" );
break;
case 2:
Log.d( DiTTS.TAG, "反馈:" + "state=2 播报完毕" );
break;
case 3:
Log.d( DiTTS.TAG, "反馈:" + "state=3" );
break;
default:
Log.d( DiTTS.TAG, "未收到反馈值" );
}
}
}
public static TTSManager getInstance( Context context ) {
if ( sInstance == null ) {
synchronized ( TTSManager.class ) {
if ( sInstance == null ) {
sInstance = new TTSManager();
sInstance = new TTSManager( context );
}
}
}