diff --git a/app/build.gradle b/app/build.gradle index bda52bb550..46c7c43370 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -88,7 +88,7 @@ android { // 是否使用自定义导航 buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'true' // 是否作为 launcher 运行 - buildConfigField 'boolean', 'IS_LAUNCHER', 'false' + buildConfigField 'boolean', 'IS_LAUNCHER', 'true' } // f系列-分体机全系列,未细分 f8xx{ diff --git a/app/libs/persistentlib.jar b/app/libs/persistentlib.jar new file mode 100644 index 0000000000..7a6ce17de1 Binary files /dev/null and b/app/libs/persistentlib.jar differ diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 88bec3f449..ccf3dd8248 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -13,6 +13,19 @@ android:supportsRtl="true" android:theme="@style/AppTheme.App" tools:replace="android:label"> + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/mogo/launcher/MogoApplication.java b/app/src/main/java/com/mogo/launcher/MogoApplication.java index b88728dc57..d50f474f69 100644 --- a/app/src/main/java/com/mogo/launcher/MogoApplication.java +++ b/app/src/main/java/com/mogo/launcher/MogoApplication.java @@ -1,6 +1,7 @@ package com.mogo.launcher; import android.content.Context; +import android.content.Intent; import android.util.Log; import androidx.multidex.MultiDex; @@ -14,6 +15,7 @@ import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant; import com.mogo.module.carchatting.card.CallChatConstant; import com.mogo.module.common.MogoModule; import com.mogo.module.common.MogoModulePaths; +import com.mogo.module.main.service.MogoMainService; import com.mogo.module.media.MediaConstants; import com.mogo.module.service.ServiceConst; import com.mogo.module.tanlu.constant.TanluConstants; @@ -22,6 +24,7 @@ import com.mogo.service.MogoServicePaths; import com.mogo.service.connection.IMogoSocketManager; import com.mogo.utils.logger.LogLevel; import com.mogo.utils.logger.Logger; +import com.zhidao.boot.persistent.lib.PersistentManager; /** * @author congtaowang @@ -67,6 +70,12 @@ public class MogoApplication extends AbsMogoApplication { MogoModulePaths.addBaseModule( new MogoModule( V2XConst.PATH_V2X_UI, V2XConst.PATH_V2X_UI ) ); // 暂时去掉推送 // MogoModulePaths.addModule(new MogoModule(PushUIConstants.TAG, PushUIConstants.TAG)); + + if (!DebugConfig.isLauncher()) { + PersistentManager.getInstance().initManager(this); + Intent intent = new Intent( this, MogoMainService.class ); + startService( intent ); + } Log.i( "timer", "cost " + ( System.currentTimeMillis() - start ) + "ms" ); } diff --git a/main-extensions/mogo-module-main-independent/build.gradle b/main-extensions/mogo-module-main-independent/build.gradle index e2cf94d684..7d208f4876 100644 --- a/main-extensions/mogo-module-main-independent/build.gradle +++ b/main-extensions/mogo-module-main-independent/build.gradle @@ -41,9 +41,9 @@ dependencies { implementation rootProject.ext.dependencies.arouter annotationProcessor rootProject.ext.dependencies.aroutercompiler if (Boolean.valueOf(RELEASE)) { - implementation rootProject.ext.dependencies.modulemain + api rootProject.ext.dependencies.modulemain } else { - implementation project(":modules:mogo-module-main") + api project(":modules:mogo-module-main") } } diff --git a/main-extensions/mogo-module-main-launcher/build.gradle b/main-extensions/mogo-module-main-launcher/build.gradle index ac9a48e993..4b878becc8 100644 --- a/main-extensions/mogo-module-main-launcher/build.gradle +++ b/main-extensions/mogo-module-main-launcher/build.gradle @@ -41,10 +41,10 @@ dependencies { implementation rootProject.ext.dependencies.arouter annotationProcessor rootProject.ext.dependencies.aroutercompiler if (Boolean.valueOf(RELEASE)) { - implementation rootProject.ext.dependencies.modulemain + api rootProject.ext.dependencies.modulemain api rootProject.ext.dependencies.moduleapps } else { - implementation project(":modules:mogo-module-main") + api project(":modules:mogo-module-main") api project(':modules:mogo-module-apps') } } diff --git a/modules/mogo-module-main/src/main/java/com/mogo/module/main/service/MogoMainService.java b/modules/mogo-module-main/src/main/java/com/mogo/module/main/service/MogoMainService.java index 1dfcd19655..ce556acb4c 100644 --- a/modules/mogo-module-main/src/main/java/com/mogo/module/main/service/MogoMainService.java +++ b/modules/mogo-module-main/src/main/java/com/mogo/module/main/service/MogoMainService.java @@ -38,15 +38,8 @@ class MogoMainService extends Service implements IMogoLocationListener { */ private IMogoLocationClient mLocationClient; - - @Nullable @Override - public IBinder onBind( Intent intent ) { - return null; - } - - @Override - public int onStartCommand( Intent intent, int flags, int startId ) { + public void onCreate() { Logger.d( TAG, "基本服务启动" ); mServiceApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation(); initAndStartLocation(); @@ -57,6 +50,16 @@ class MogoMainService extends Service implements IMogoLocationListener { initADAS(); }, 2_000L ); + } + + @Nullable + @Override + public IBinder onBind( Intent intent ) { + return null; + } + + @Override + public int onStartCommand( Intent intent, int flags, int startId ) { return START_STICKY; }