add context Holder and remove guide condition
@@ -30,7 +30,6 @@ import com.mogo.test.crashreport.ITestCrashReportProvider;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.logger.LogLevel;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.storage.SharedPrefsMgr;
|
||||
import com.squareup.leakcanary.LeakCanary;
|
||||
import com.zhidao.boot.persistent.lib.PersistentManager;
|
||||
import com.zhidao.mogo.module.left.panel.LeftPanelConst;
|
||||
@@ -64,11 +63,7 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
crashSystem.setDebug( BuildConfig.DEBUG );
|
||||
Logger.init( BuildConfig.DEBUG ? LogLevel.DEBUG : LogLevel.OFF );
|
||||
|
||||
if ( DebugConfig.isLoadGuideModule() ) {
|
||||
MogoModulePaths.addModule( new MogoModule( PATH_GUIDE_FRAGMENT, PATH_GUIDE_MODULE_NAME ) );
|
||||
}else{
|
||||
SharedPrefsMgr.getInstance(this).putBoolean(DebugConfig.getSpGuide(),true);
|
||||
}
|
||||
MogoModulePaths.addModule( new MogoModule( PATH_GUIDE_FRAGMENT, PATH_GUIDE_MODULE_NAME ) );
|
||||
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_AGREEMENT, AuthorizeConstant.PATH_AGREEMENT_MODULE_NAME ) );
|
||||
|
||||
if ( DebugConfig.isLauncher() ) {
|
||||
@@ -129,7 +124,6 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
DebugConfig.setProductFlavor( BuildConfig.FLAVOR_product );
|
||||
DebugConfig.setSocketAppId( BuildConfig.SOCKET_APP_ID );
|
||||
DebugConfig.setRoadEventAnimated( BuildConfig.ROAD_EVENT_ANIMATED );
|
||||
DebugConfig.setLoadGuideModule( BuildConfig.LOAD_GUIDE_MODULE );
|
||||
DebugConfig.setSkinSupported( BuildConfig.IS_SKIN_SUPPORTED );
|
||||
DebugConfig.setSupportedSearchDestinationOnlineCarList( BuildConfig.IS_SUPPORTED_SEARCH_DESTINATION_ONLINE_CAR_LIST );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.mogo.commons.context;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
public class ContextHolderUtil {
|
||||
|
||||
private static Context mContext;
|
||||
|
||||
public static void holdContext(Context context) {
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
public static void releaseContext() {
|
||||
mContext = null;
|
||||
}
|
||||
|
||||
public static Context getContext(){
|
||||
return mContext;
|
||||
}
|
||||
}
|
||||
@@ -251,17 +251,6 @@ public class DebugConfig {
|
||||
DebugConfig.sRoadEventAnimated = sRoadEventAnimated;
|
||||
}
|
||||
|
||||
|
||||
private static boolean sLoadGuideModule = false;
|
||||
|
||||
public static void setLoadGuideModule( boolean sLoadGuideModule ) {
|
||||
DebugConfig.sLoadGuideModule = sLoadGuideModule;
|
||||
}
|
||||
|
||||
public static boolean isLoadGuideModule() {
|
||||
return sLoadGuideModule;
|
||||
}
|
||||
|
||||
private static String SP_GUIDE = "SP_GUIDE_2020_09_09";
|
||||
|
||||
public static String getSpGuide() {
|
||||
|
||||
@@ -29,14 +29,14 @@ PASSWORD=xintai2018
|
||||
RELEASE=false
|
||||
# 模块版本
|
||||
## 工程内模块
|
||||
MOGO_COMMONS_VERSION=2.0.0
|
||||
MOGO_COMMONS_VERSION=2.0.1
|
||||
MOGO_UTILS_VERSION=2.0.0
|
||||
MAP_AMAP_VERSION=2.0.0
|
||||
MAP_AUTONAVI_VERSION=2.0.0
|
||||
MOGO_MAP_VERSION=2.0.0
|
||||
MOGO_MAP_API_VERSION=2.0.0
|
||||
MOGO_SERVICE_VERSION=2.0.0
|
||||
MOGO_SERVICE_API_VERSION=2.0.0
|
||||
MOGO_SERVICE_API_VERSION=2.0.2
|
||||
MOGO_CONNECTION_VERSION=2.0.0
|
||||
MOGO_MODULE_APPS_VERSION=2.0.0
|
||||
MOGO_MODULE_NAVI_VERSION=2.0.0
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.module.authorize.authprovider.launcher
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Looper
|
||||
import com.mogo.commons.context.ContextHolderUtil
|
||||
import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeManagerImpl
|
||||
import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeRegisterHandler
|
||||
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_LAUNCHER_MAIN
|
||||
@@ -82,7 +83,7 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
|
||||
return
|
||||
}
|
||||
if (authorizeDialog == null) {
|
||||
authorizeDialog = AuthorizeDialog(tag, mContext!!)
|
||||
authorizeDialog = AuthorizeDialog(tag, ContextHolderUtil.getContext() ?: mContext!!)
|
||||
authorizeDialog!!.setOnDismissListener {
|
||||
authorizeDialog = null
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.mogo.module.authorize.layout
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.text.Html
|
||||
import android.view.View
|
||||
import android.widget.Button
|
||||
@@ -207,4 +206,9 @@ class AuthorizeDialog : BaseFloatDialog, View.OnClickListener, IVoiceCommandList
|
||||
showAuthorizationError()
|
||||
})
|
||||
}
|
||||
|
||||
override fun dismiss() {
|
||||
super.dismiss()
|
||||
mContext = null
|
||||
}
|
||||
}
|
||||
@@ -5,17 +5,14 @@ import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.map.listener.IMogoMapListener
|
||||
import com.mogo.map.location.IMogoLocationListener
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener
|
||||
import com.mogo.map.navi.IMogoNaviListener
|
||||
import com.mogo.module.guide.GuideConstant.Companion.PATH_GUIDE_FRAGMENT
|
||||
import com.mogo.module.guide.GuideConstant.Companion.PATH_GUIDE_MODULE_NAME
|
||||
import com.mogo.module.guide.util.isDeviceOfD
|
||||
import com.mogo.service.module.IMogoModuleProvider
|
||||
import com.mogo.service.module.ModuleType
|
||||
import com.mogo.utils.UiThreadHandler
|
||||
import com.mogo.utils.logger.Logger
|
||||
|
||||
@Route(path = PATH_GUIDE_FRAGMENT)
|
||||
@@ -58,12 +55,7 @@ class MogoGuideProvider : IMogoModuleProvider {
|
||||
|
||||
override fun init(context: Context?) {
|
||||
Logger.d("MogoGuideProvider", "init====")
|
||||
// if (DebugConfig.isLoadGuideModule()) {
|
||||
GuideBizManager.init()
|
||||
// } else {
|
||||
// Logger.d("MogoGuideProvider", "device type is not D")
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
override fun getAppPackage(): String? {
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</LinearLayout>
|
||||
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 635 B After Width: | Height: | Size: 635 B |
|
Before Width: | Height: | Size: 713 B After Width: | Height: | Size: 713 B |
|
After Width: | Height: | Size: 334 KiB |
|
After Width: | Height: | Size: 309 KiB |
|
After Width: | Height: | Size: 323 KiB |
|
After Width: | Height: | Size: 451 KiB |
|
After Width: | Height: | Size: 419 KiB |
|
After Width: | Height: | Size: 749 B |
|
After Width: | Height: | Size: 820 B |
|
After Width: | Height: | Size: 816 KiB |
|
After Width: | Height: | Size: 757 KiB |
|
After Width: | Height: | Size: 844 KiB |
|
After Width: | Height: | Size: 1.2 MiB |
|
After Width: | Height: | Size: 1.2 MiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
@@ -10,6 +10,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.context.ContextHolderUtil;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.mvp.MvpActivity;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
@@ -131,6 +132,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
@Override
|
||||
protected void onCreate( @Nullable Bundle savedInstanceState ) {
|
||||
super.onCreate( savedInstanceState );
|
||||
ContextHolderUtil.holdContext(this);
|
||||
mPresenter.postLoadModuleMsg();
|
||||
}
|
||||
|
||||
@@ -140,6 +142,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
}
|
||||
mServiceApis.getShareManager().resetContext( this );
|
||||
mServiceApis.getAuthManagerApi().showAuth( this );
|
||||
|
||||
mMogoStatusManager = mServiceApis.getStatusManagerApi();
|
||||
mMogoStatusManager.setMainPageLaunchedStatus( TAG, true );
|
||||
AutopilotServiceManage.getInstance().init( getContext() );
|
||||
@@ -353,5 +356,6 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
mServiceApis.getRefreshStrategyControllerApi().clearAllData();
|
||||
AIAssist.getInstance( this ).release();
|
||||
mServiceApis.getOnlineCarPanelApi().clear();
|
||||
ContextHolderUtil.releaseContext();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.adas.IMogoADASController;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.auth.IMogoAuthManager;
|
||||
import com.mogo.service.callchat.IMogoCallChatManager;
|
||||
import com.mogo.service.cardmanager.IMogoCardManager;
|
||||
import com.mogo.service.connection.IMogoSocketManager;
|
||||
import com.mogo.service.datamanager.IMogoDataManager;
|
||||
@@ -212,6 +213,11 @@ public class MogoServiceApis implements IMogoServiceApis {
|
||||
return getApiInstance( IMogoAuthManager.class, MogoServicePaths.PATH_AGREEMENT );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoCallChatManager getCallChatManager() {
|
||||
return getApiInstance(IMogoCallChatManager.class,MogoServicePaths.PATH_CALLCHAT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoTanluProvider getTanluApi() {
|
||||
return getApiInstance(IMogoTanluProvider.class, MogoServicePaths.PATH_TANLU_API);
|
||||
|
||||
@@ -78,14 +78,9 @@ public class MogoADASController implements IMogoADASController {
|
||||
|
||||
@Override
|
||||
public void showADAS() {
|
||||
|
||||
// TODO: 2020/9/4 和引导模块交互
|
||||
if ( DebugConfig.isLoadGuideModule() ) {
|
||||
if ( !SharedPrefsMgr.getInstance( AbsMogoApplication.getApp() ).getBoolean( getSpGuide(), false ) ) {
|
||||
if ( !SharedPrefsMgr.getInstance( AbsMogoApplication.getApp() ).getBoolean( getSpGuide(), false ) ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
|
||||
init( AbsMogoApplication.getApp() );
|
||||
AutopilotServiceManage.getInstance().registerAutopilotServiceStatusListener( new IAutopilotServiceStatusListener() {
|
||||
|
||||