This commit is contained in:
unknown
2020-11-19 11:25:29 +08:00
649 changed files with 4371 additions and 2766 deletions

View File

@@ -2,6 +2,7 @@ package com.mogo.launcher;
import android.content.Context;
import android.content.Intent;
import android.os.Process;
import android.text.TextUtils;
import android.util.Log;
@@ -27,6 +28,7 @@ import com.mogo.service.IMogoServiceApis;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.passport.IMogoTicketCallback;
import com.mogo.test.crashreport.ITestCrashReportProvider;
import com.mogo.utils.ProcessUtils;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.logger.LogLevel;
import com.mogo.utils.logger.Logger;
@@ -70,6 +72,9 @@ public class MogoApplication extends AbsMogoApplication {
MogoModulePaths.addModule( new MogoModule( MediaConstants.TAG, MediaConstants.MODULE_TYPE ) );
} else {
}
// TODO
MogoModulePaths.addModule( new MogoModule( ServiceConst.PATH_TTS_CONFIG, ServiceConst.PATH_TTS_CONFIG ) );
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_WIDGETS, MogoServicePaths.PATH_WIDGETS ) );
if ( DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD ) {
MogoModulePaths.addModule( new MogoModule( CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME ) );
@@ -90,7 +95,7 @@ public class MogoApplication extends AbsMogoApplication {
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_MOGO_MONITOR, "MogoMonitor" ) );
MogoModulePaths.addModule( new MogoModule( PushUIConstants.PATH, PushUIConstants.NAME ) );
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_GLOBAL_UNWAKE,"GlobalUnwake"));
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_GLOBAL_UNWAKE, "GlobalUnwake" ) );
if ( !DebugConfig.isLauncher() ) {
PersistentManager.getInstance().initManager( this );
@@ -109,13 +114,11 @@ public class MogoApplication extends AbsMogoApplication {
@Override
protected boolean shouldInit() {
return !LeakCanary.isInAnalyzerProcess( this );
Logger.w( TAG, "evaluate shouldInit() with: %s", ProcessUtils.getProcessName( Process.myPid() ) );
return ProcessUtils.isMainProcess( this );
}
private void initDebugConfig() {
if ( !shouldInit() ) {
return;
}
DebugConfig.setNetMode( BuildConfig.NET_ENV );
DebugConfig.setDebug( BuildConfig.DEBUG );
DebugConfig.setLaunchLocationService( BuildConfig.LAUNCH_LOCATION_SERVICE );
@@ -186,10 +189,12 @@ public class MogoApplication extends AbsMogoApplication {
private void prepareSocketAndLocationServices( IMogoServiceApis apis ) {
apis.getSocketManagerApi( getApplicationContext() ).init( getApplicationContext(), DebugConfig.getSocketAppId() );
apis.getLocationInfoApi().start();
apis.getMapServiceApi().getSingletonLocationClient( getApplicationContext() ).addLocationListener( location -> {
apis.getLocationInfoApi().provideLocation( location );
} );
if ( DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE ) {
apis.getLocationInfoApi().start();
apis.getMapServiceApi().getSingletonLocationClient( getApplicationContext() ).addLocationListener( location -> {
apis.getLocationInfoApi().provideLocation( location );
} );
}
}
@Override