diff --git a/app/build.gradle b/app/build.gradle index 7e8007defa..5d9d540ce6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -290,4 +290,28 @@ def getGitCommit() { gitCommit } +afterEvaluate { + it.getTasks().iterator().forEachRemaining { + def nameLowCase = it.name + + if (nameLowCase.startsWith("assemble") + && nameLowCase.contains("Independent") + && (nameLowCase.endsWith("Debug") || nameLowCase.endsWith("Release"))) { + it.group = "assembleIndependent" + } else if (nameLowCase.startsWith("assemble") + && nameLowCase.contains("Launcher") + && (nameLowCase.endsWith("Debug") || nameLowCase.endsWith("Release"))) { + it.group = "assembleLauncher" + } else if (nameLowCase.startsWith("install") + && nameLowCase.contains("Independent") + && (nameLowCase.endsWith("Debug") || nameLowCase.endsWith("Release"))) { + it.group = "installIndependent" + } else if (nameLowCase.startsWith("install") + && nameLowCase.contains("Launcher") + && (nameLowCase.endsWith("Debug") || nameLowCase.endsWith("Release"))) { + it.group = "installLauncher" + } + } +} + //apply plugin: 'arouterhook' \ No newline at end of file diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapNaviViewWrapper.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapNaviViewWrapper.java index 67a09c93a9..b02cbfaee4 100644 --- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapNaviViewWrapper.java +++ b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapNaviViewWrapper.java @@ -127,8 +127,8 @@ public class AMapNaviViewWrapper implements IMogoMapView, options.setTrafficLayerEnabled( false ); // 设置导航界面是否显示路线全览按钮。 options.setRouteListButtonShow( false ); - // 设置导航状态下屏幕是否一直开启。 - options.setScreenAlwaysBright( true ); + // 设置屏幕是否常亮,默认开启 + options.setScreenAlwaysBright( false ); // 设置交通播报是否打开(只适用于驾车导航,需要联网)。 options.setTrafficInfoUpdateEnabled( true ); // 设置摄像头播报是否打开(只适用于驾车导航)。 diff --git a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppsListActivity.java b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppsListActivity.java index 34a738ac9e..af515b21b9 100644 --- a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppsListActivity.java +++ b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppsListActivity.java @@ -1,6 +1,7 @@ package com.mogo.module.apps; import android.app.Activity; +import android.content.Context; import android.content.Intent; import android.graphics.Color; import android.os.Build; @@ -30,7 +31,7 @@ public class AppsListActivity extends MvpActivity< AppsListView, AppsListPresent private BottomSheetBehavior mBottomSheetBehavior; private IMogoFragmentManager mMogoFragmentManager; - public static void start( Activity context ) { + public static void start( Context context ) { Intent starter = new Intent( context, AppsListActivity.class ); context.startActivity( starter ); } diff --git a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppsPresenter.java b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppsPresenter.java index f7e95d2ddc..916b265020 100644 --- a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppsPresenter.java +++ b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppsPresenter.java @@ -1,17 +1,15 @@ package com.mogo.module.apps; -import android.text.TextUtils; - import androidx.annotation.NonNull; import androidx.lifecycle.LifecycleOwner; import com.alibaba.android.arouter.launcher.ARouter; -import com.mogo.commons.debug.DebugConfig; import com.mogo.commons.mvp.Presenter; import com.mogo.module.apps.applaunch.AppLaunchFilter; import com.mogo.module.apps.applaunch.AppLauncher; import com.mogo.module.apps.applaunch.CardAppLauncher; import com.mogo.module.apps.applaunch.GuideShowLauncher; +import com.mogo.module.apps.applaunch.InternalFunctionLauncher; import com.mogo.module.apps.model.AppInfo; import com.mogo.module.apps.model.AppsModel; import com.mogo.module.apps.model.UnScannedApps; @@ -24,7 +22,6 @@ import com.mogo.utils.ThreadPoolService; import com.mogo.utils.UiThreadHandler; import com.mogo.utils.logger.Logger; -import java.sql.ClientInfoStatus; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -54,11 +51,13 @@ public class AppsPresenter extends Presenter< AppsView > { super( view ); mApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation( getContext() ); mCardManager = mApis.getCardManagerApi(); + InternalFunctionLauncher internalFunctionLauncher = new InternalFunctionLauncher( getContext() ); CardAppLauncher cardAppLauncher = new CardAppLauncher( this, mCardManager ); GuideShowLauncher guideShowLauncher = new GuideShowLauncher( mApis.getMapServiceApi().getNavi( getContext() ) ); + internalFunctionLauncher.setNext( cardAppLauncher ); cardAppLauncher.setNext( guideShowLauncher ); guideShowLauncher.setNext( new AppLauncher() ); - mLauncher = cardAppLauncher; + mLauncher = internalFunctionLauncher; } @Override @@ -130,7 +129,7 @@ public class AppsPresenter extends Presenter< AppsView > { if ( appInfo == null ) { continue; } - if ( TextUtils.equals( appInfo.getPackageName(), app.getPackageName() ) ) { + if ( appInfo.equals( app ) ) { addFlag = false; break; } @@ -145,14 +144,6 @@ public class AppsPresenter extends Presenter< AppsView > { } } } -// growthCapacity( result ) -// // 添加介绍入口 -// result.get( result.size() - 1 ).add( new AppInfo( GuideShowLauncher.APP_INFO_NAME_GUIDE_SHOW, getContext().getPackageName(), null, 0, null, R.drawable.module_apps_ic_guide_show ) ); - if ( DebugConfig.isDebug() ) { - // 添加测试入口 - growthCapacity( result ); - result.get( result.size() - 1 ).add( new AppInfo( "包管理程序", "com.mogo.packages.manager", null, 0, null, -1 ) ); - } return result; } diff --git a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/applaunch/InternalFunctionLauncher.java b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/applaunch/InternalFunctionLauncher.java index baee9e5b69..fa39cd2a9a 100644 --- a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/applaunch/InternalFunctionLauncher.java +++ b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/applaunch/InternalFunctionLauncher.java @@ -1,27 +1,29 @@ package com.mogo.module.apps.applaunch; -import android.app.Activity; +import android.content.ComponentName; import android.content.Context; import android.content.Intent; +import android.text.TextUtils; import com.mogo.module.apps.AppServiceHandler; import com.mogo.module.apps.AppsListActivity; import com.mogo.module.apps.model.AppInfo; import com.mogo.module.common.map.CustomNaviInterrupter; import com.mogo.utils.LaunchUtils; +import com.mogo.utils.TipToast; /** * @author congtaowang * @since 2020-05-14 *
- * 描述 + * 处理一些特殊的跳转 */ public class InternalFunctionLauncher extends BaseAppLauncher { - private Activity mActivity; + private Context mContext; - public InternalFunctionLauncher( Activity activity ) { - this.mActivity = activity; + public InternalFunctionLauncher( Context activity ) { + this.mContext = activity; } @Override @@ -39,7 +41,14 @@ public class InternalFunctionLauncher extends BaseAppLauncher { } break; case "com.mogo.launcher.applist": - AppsListActivity.start( mActivity ); + AppsListActivity.start( mContext ); + break; + case "com.zhidao.bluetooth": + if ( TextUtils.equals( "蓝牙音乐", appInfo.getName() ) ) { + startActivity( context, appInfo, "com.zhidao.bluetooth.ui.MusicActivity" ); + } else if ( TextUtils.equals( "蓝牙电话", appInfo.getName() ) ) { + startActivity( context, appInfo, "com.zhidao.bluetooth.ui.MainActivity" ); + } break; default: if ( getNext() != null ) { @@ -48,6 +57,26 @@ public class InternalFunctionLauncher extends BaseAppLauncher { } } + private void startActivity( Context context, AppInfo target, String page ) { + if ( context == null || target == null ) { + return; + } + if ( TextUtils.isEmpty( page ) ) { + if ( getNext() != null ) { + getNext().launch( context, target ); + return; + } + } + try { + Intent intent = new Intent(); + intent.setComponent( new ComponentName( target.getPackageName(), page ) ); + intent.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK ); + context.startActivity( intent ); + } catch ( Exception e ) { + TipToast.shortTip( "APP未安装" ); + } + } + @Override public void destroy() { if ( getNext() != null ) { diff --git a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/model/AppEnum.java b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/model/AppEnum.java index d17eee4a88..f6d9fa7c18 100644 --- a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/model/AppEnum.java +++ b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/model/AppEnum.java @@ -86,7 +86,8 @@ public enum AppEnum { CanBus( "车辆信息", "com.nwd.can.setting", R.drawable.module_apps_ic_canbus ), // 蓝牙电话 - BT_PHONE( "蓝牙电话", "com.nwd.android.phone", R.drawable.module_apps_ic_bt_phone ), + BT_PHONE_NWD( "蓝牙电话", "com.nwd.android.phone", R.drawable.module_apps_ic_bt_phone ), + BT_PHONE( "蓝牙电话", "com.zhidao.bluetooth", R.drawable.module_apps_ic_bt_phone ), // 本地音乐 LOCAL_MUSIC( "本地音乐", "com.nwd.android.music.ui", R.drawable.module_apps_ic_local_music ), @@ -95,7 +96,8 @@ public enum AppEnum { WEATHER( "天气", "com.zhidao.weather", R.drawable.module_apps_ic_weather ), // 蓝牙音乐 - BT_MUSIC( "蓝牙音乐", "com.nwd.bt.music", R.drawable.module_apps_ic_bt_music ), + BT_MUSIC_NWD( "蓝牙音乐", "com.nwd.bt.music", R.drawable.module_apps_ic_bt_music ), + BT_MUSIC( "蓝牙音乐", "com.zhidao.bluetooth", R.drawable.module_apps_ic_bt_music ), // 高德地图 AUTO_NAVI( "高德地图", "com.autonavi.amapauto", R.drawable.module_apps_ic_auto_navi ), diff --git a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/model/AppInfo.java b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/model/AppInfo.java index dae51ba27d..62b2c34105 100644 --- a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/model/AppInfo.java +++ b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/model/AppInfo.java @@ -68,7 +68,8 @@ public class AppInfo { if ( this == o ) return true; if ( o == null || getClass() != o.getClass() ) return false; AppInfo appInfo = ( AppInfo ) o; - return TextUtils.equals( mPackageName, appInfo.mPackageName ); + return TextUtils.equals( mPackageName, appInfo.mPackageName ) + && TextUtils.equals( mName, appInfo.mName ); } @Override diff --git a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/model/UnScannedApps.java b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/model/UnScannedApps.java index 7028085838..05bf307195 100644 --- a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/model/UnScannedApps.java +++ b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/model/UnScannedApps.java @@ -1,5 +1,7 @@ package com.mogo.module.apps.model; +import com.mogo.module.common.utils.CarSeries; + import java.util.ArrayList; import java.util.List; @@ -14,11 +16,17 @@ public class UnScannedApps { private static List< AppInfo > sUnScannedApps = new ArrayList<>(); static { - sUnScannedApps.add( new AppInfo( AppEnum.BT_PHONE.getName(), AppEnum.BT_PHONE.getPkg(), null, 0, null, AppEnum.BT_PHONE.getIconResId() ) ); + if ( CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X ) { + sUnScannedApps.add( new AppInfo( AppEnum.BT_PHONE.getName(), AppEnum.BT_PHONE.getPkg(), null, 0, null, AppEnum.BT_PHONE.getIconResId() ) ); + sUnScannedApps.add( new AppInfo( AppEnum.BT_MUSIC.getName(), AppEnum.BT_MUSIC.getPkg(), null, 0, null, AppEnum.BT_PHONE.getIconResId() ) ); + } else { + sUnScannedApps.add( new AppInfo( AppEnum.BT_PHONE_NWD.getName(), AppEnum.BT_PHONE_NWD.getPkg(), null, 0, null, AppEnum.BT_PHONE_NWD.getIconResId() ) ); + } sUnScannedApps.add( new AppInfo( AppEnum.CanBus.getName(), AppEnum.CanBus.getPkg(), null, 0, null, AppEnum.CanBus.getIconResId() ) ); } public static List< AppInfo > getUnScannedApps() { return sUnScannedApps; } + } diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java index 26572251a6..b372d9817d 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java @@ -715,9 +715,11 @@ public class MogoServices implements IMogoMapListener, if ( isTrue ) { mADASController.showADAS(); refreshStrategy(); + MarkerServiceHandler.getApis().getMapServiceApi().getSingletonLocationClient( mContext ).stop(); } else { try { MarkerServiceHandler.getApis().getMapServiceApi().getMarkerManager( mContext ).removeMarkers(); + MarkerServiceHandler.getApis().getMapServiceApi().getSingletonLocationClient( mContext ).start(); } catch ( Exception e ) { Logger.e( TAG, e, "error." ); }