This commit is contained in:
zhongchao
2021-02-23 16:44:13 +08:00
23 changed files with 157 additions and 162 deletions

1
.idea/gradle.xml generated
View File

@@ -91,7 +91,6 @@
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
<option name="useQualifiedModuleNames" value="true" />
</GradleProjectSettings>
</option>
</component>

View File

@@ -300,7 +300,12 @@ class MogoOCHTaxiModel {
@Override
public void onCarLocationChanged2( Location location ) {
Logger.d( TAG, "定位已判断是否达到上车站点" );
Logger.d( TAG, "定位已判断是否达到上车站点: 起点(%s, %s), 当前位置(%s, %s)",
mCurrentOCHOrder.drivingRoutes.get( 0 ).lon,
mCurrentOCHOrder.drivingRoutes.get( 0 ).lat,
location.getLongitude(),
location.getLatitude()
);
onLocationChanged( location );
}
@@ -323,11 +328,9 @@ class MogoOCHTaxiModel {
return;
}
if ( mIsArriveAtStartStation ) {
unregisterCarLocationListener();
return;
}
if ( mIsUserArriveAtStartStation ) {
unregisterCarLocationListener();
return;
}
judgeStartStation( location );
@@ -349,7 +352,6 @@ class MogoOCHTaxiModel {
}
if ( distance <= ARRIVE_AT_START_STATION_DISTANCE ) {
mIsArriveAtStartStation = true;
unregisterCarLocationListener();
OCHTaxiUiController.getInstance().onArriveAtStartStation();
updateOCHOrderStatus( OCHOrderStatus.ArriveAtStartStation, new OCHOrderStatusCallback() {
@Override
@@ -685,6 +687,7 @@ class MogoOCHTaxiModel {
.getAdasControllerApi()
.cancelAutopilot();
Logger.d( TAG, "结束自动驾驶" );
unregisterCarLocationListener();
} catch ( Exception e ) {
e.printStackTrace();
}

View File

@@ -123,7 +123,7 @@ android {
// 是否基于地图
buildConfigField 'boolean', 'IS_MAP_BASED', 'true'
// 是否加载引导模块
buildConfigField 'boolean', 'IS_NEED_LOAD_GUIDE_MODULE', 'true'
buildConfigField 'boolean', 'IS_NEED_LOAD_GUIDE_MODULE', 'false'
// 分享时是否隐藏 adas
buildConfigField 'boolean', 'IS_NEED_HIDE_ADAS_WHEN_SHARE', 'false'
// 是否需要实时上报坐标
@@ -151,7 +151,7 @@ android {
// 是否基于地图
buildConfigField 'boolean', 'IS_MAP_BASED', 'true'
// 是否加载引导模块
buildConfigField 'boolean', 'IS_NEED_LOAD_GUIDE_MODULE', 'true'
buildConfigField 'boolean', 'IS_NEED_LOAD_GUIDE_MODULE', 'false'
// 分享时是否隐藏 adas
buildConfigField 'boolean', 'IS_NEED_HIDE_ADAS_WHEN_SHARE', 'false'
// 是否需要实时上报坐标

View File

@@ -1,5 +1,7 @@
package com.mogo.commons.debug;
import android.text.TextUtils;
/**
* @author congtaowang
* @since 2019-12-23
@@ -267,7 +269,7 @@ public class DebugConfig {
return sLoadGuideModule;
}
private static String SP_GUIDE = "SP_GUIDE_2020_09_09";
public static String SP_GUIDE = "SP_GUIDE_2020_09_09";
public static String getSpGuide() {
return SP_GUIDE;
@@ -413,4 +415,8 @@ public class DebugConfig {
public static void setNotSmooth( boolean sIsNotSmooth ) {
DebugConfig.sIsNotSmooth = sIsNotSmooth;
}
public static boolean isOCHModule(){
return sProductFlavor != null && sProductFlavor.startsWith( "foch" );
}
}

View File

@@ -1,6 +1,7 @@
package com.mogo.map.impl.custom;
import com.mogo.commons.debug.DebugConfig;
import com.zhidaoauto.map.sdk.open.location.MogoLocation;
import java.util.ArrayList;
@@ -52,6 +53,11 @@ class MapStyleController {
return;
}
// 网约车不自动切换vr、2d模式
if ( DebugConfig.isOCHModule() ) {
return;
}
boolean isInVrMode = false;
for ( VrAreaFilter vrAreaFilter : mVrAreaFilters ) {
if ( vrAreaFilter == null ) {

View File

@@ -77,6 +77,7 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
zdCarCoderController.init()
}
fun takePhoto(
photoType: Int,
cameraId: Int,
@@ -87,7 +88,11 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
fromType: String,
longitude: Double,
latitude: Double,
speed: Float
speed: Float,
address: String,
direction: Float,
areaCode: String,
cityCode: String
) {
Log.d(TAG, "takePhoto ---------- type = $type --- mType = $mType ---fromType = $fromType")
this.mType = type
@@ -96,6 +101,11 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
this.mLongitude = longitude
this.mLatitude = latitude
this.mSpeed = speed
this.mAddress = address
this.mDirection = direction
this.mAreaCode = areaCode
this.mCityCode = cityCode
CustomStatusHandler.offerPhotoStatus(isCustom)
zdCarCoderController.takePhoto(photoType, cameraId, haveVoice)
trackGetPhoto(1)
@@ -115,7 +125,11 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
fromType: String,
longitude: Double,
latitude: Double,
speed: Float
speed: Float,
address: String,
direction: Float,
areaCode: String,
cityCode: String
) {
Log.d(TAG, "takeVideo -------- isCustom = $isCustom ---mFromType = $mFromType ---type = $type ---speed = $speed")
this.mType = type
@@ -124,6 +138,11 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
this.mLongitude = longitude
this.mLatitude = latitude
this.mSpeed = speed
this.mAddress = address
this.mDirection = direction
this.mAreaCode = areaCode
this.mCityCode = cityCode
if (DebugConfig.getCarMachineType() == 0) { //自研车机
outputVideoPath = getCompressVideoPath()
CustomStatusHandler.offerVideoStatus(TakeEntity(isCustom, id, fromType))

View File

@@ -76,6 +76,12 @@ class MainService : Service() {
private var mLatitude: Double = 0.0
private lateinit var serviceApis: IMogoServiceApis
private var mAddress: String = ""
private var mDirection: Float = 0f
private var mAreaCode: String = ""
private var mCityCode: String = ""
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
//清理多媒体资源和sp策略数据
clearStrategyType(this)
@@ -95,6 +101,11 @@ class MainService : Service() {
mainInfoId = it.parentId
mLongitude = it.lon
mLatitude = it.lat
mAddress = it.addr
mDirection = it.direction
mAreaCode = it.areaCode
mCityCode = it.cityCode
Log.d(TAG, "onStartCommand shareType = $shareType --fromType = $fromType --mainInfoId = $mainInfoId -- mLongitude = $mLongitude --mLatitude = $mLatitude --it.duration = ${it.duration} ")
if (fromType == UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO || fromType == UPLOAD_FROM_STRATEGY_BLOCK_AUTO) {
// 如果是策略上报isCustom = false
@@ -274,7 +285,7 @@ class MainService : Service() {
Observable.intervalRange(0, 1, 0, 2_000, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
.subscribe {
CarCorderController.takePhoto(1, 1, false, isCustom, TANLU_ROAD_CURRENT, mainInfoId, fromType, mLongitude, mLatitude, speed)
CarCorderController.takePhoto(1, 1, false, isCustom, TANLU_ROAD_CURRENT, mainInfoId, fromType, mLongitude, mLatitude, speed, mAddress, mDirection, mAreaCode, mCityCode)
}
// }
@@ -292,7 +303,7 @@ class MainService : Service() {
) {
Log.d("MainService", "takeVideo --------1----> fromType = $fromType --isCustom = $isCustom")
// if (isAuthorization(BaseApplication.getAppContext())) {
CarCorderController.takeVideo(1, duration, isCustom, id, shareType, mainInfoId, fromType, mLongitude, mLatitude, speed)
CarCorderController.takeVideo(1, duration, isCustom, id, shareType, mainInfoId, fromType, mLongitude, mLatitude, speed, mAddress, mDirection, mAreaCode, mCityCode)
// }
postVideoAlarmTask(isInterval)

View File

@@ -16,9 +16,11 @@ import androidx.annotation.Nullable;
import com.bumptech.glide.request.RequestOptions;
import com.bumptech.glide.request.target.SimpleTarget;
import com.bumptech.glide.request.transition.Transition;
import com.mogo.commons.context.ContextHolderUtil;
import com.mogo.map.uicontroller.CarCursorOption;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.R;
import com.mogo.service.datamanager.IMogoDataChangedListener;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.ViewUtils;
import com.mogo.utils.glide.GlideApp;
@@ -34,6 +36,17 @@ public class MyLocationUtil {
private static boolean isLoadingIcon = false;
private static boolean needEmphasizeMyLocation = false;
static {
MogoApisHandler.getInstance().getApis().getDataManagerApi()
.registerDataListener( "ADAS", data ->{
if ( data == null ) {
emphasizeMyLocation();
} else if( data instanceof String ){
setMyLocationIconUrl( ContextHolderUtil.getContext(), ( ( String ) data ));
}
} );
}
public static void emphasizeMyLocation(){
if (!isLoadingIcon) {
MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().emphasizeMyLocation();

View File

@@ -1,11 +1,13 @@
package com.mogo.module.common.utils;
import com.mogo.commons.debug.DebugConfig;
/**
* 多模块之间SP状态公共类
*/
public class SPConst {
private static String SP_GUIDE = "SP_GUIDE_2020_09_09";
private static String SP_GUIDE = DebugConfig.SP_GUIDE;
//用于多模块之间引导状态判断
public static String getSpGuide() {

View File

@@ -1,6 +1,5 @@
package com.mogo.module.extensions.net;
import com.mogo.module.extensions.userinfo.CarModelListResponse;
import com.mogo.module.extensions.userinfo.UserInfoResponse;
import java.util.Map;

View File

@@ -1,47 +0,0 @@
package com.mogo.module.extensions.userinfo;
import com.mogo.module.common.entity.OwnCarModelEntity;
import java.util.List;
public class CarModelListInfo {
private String sn;
/**
* 热心指数 eg: 1 1.5 2 2.5
*/
private float enthusiasmIndex;
private List<OwnCarModelEntity> imageData;
public String getSn() {
return sn;
}
public void setSn(String sn) {
this.sn = sn;
}
public float getEnthusiasmIndex() {
return enthusiasmIndex;
}
public void setEnthusiasmIndex(float enthusiasmIndex) {
this.enthusiasmIndex = enthusiasmIndex;
}
public List<OwnCarModelEntity> getImageData() {
return imageData;
}
public void setImageData(List<OwnCarModelEntity> imageData) {
this.imageData = imageData;
}
@Override
public String toString() {
return "CarModelListInfo{" +
"sn='" + sn + '\'' +
", enthusiasmIndex=" + enthusiasmIndex +
", imageData=" + imageData +
'}';
}
}

View File

@@ -1,32 +0,0 @@
package com.mogo.module.extensions.userinfo;
import com.mogo.commons.data.BaseData;
import com.mogo.module.common.entity.OwnCarModelEntity;
import java.util.List;
/**
* 请求根据热心指数获取自车图标列表的响应类
*
* @author tongchenfei
*/
public class CarModelListResponse extends BaseData {
private CarModelListInfo result;
public CarModelListInfo getResult() {
return result;
}
public void setResult(CarModelListInfo result) {
this.result = result;
}
@Override
public String toString() {
return "CarModelListResponse{" +
"result=" + result +
", code=" + code +
", msg='" + msg + '\'' +
'}';
}
}

View File

@@ -12,6 +12,8 @@ import android.view.animation.AccelerateInterpolator;
import android.view.animation.Interpolator;
import android.view.animation.LinearInterpolator;
import com.mogo.cloud.tanlu.bean.MarkerExploreWay;
import com.mogo.cloud.tanlu.bean.location.MarkerLocation;
import com.mogo.commons.voice.AIAssist;
import com.mogo.map.MogoLatLng;
import com.mogo.map.location.MogoLocation;
@@ -31,8 +33,7 @@ import com.mogo.map.search.poisearch.IMogoPoiSearchListener;
import com.mogo.map.search.poisearch.MogoPoiResult;
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerLocation;
//import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.share.bean.VoiceCmdData;
import com.mogo.module.share.bean.event.MarkerInfo;
@@ -287,45 +288,45 @@ public class TanluManager implements IMogoMarkerClickListener,
}
if (voiceData != null) {
// mTanluModelData.queryRodeInfo(mContext, mKeywords, voiceData, new RoadInfoCallback() {
// @Override
// public void onQueryRoadInfoSuccess(@NotNull List<? extends MarkerExploreWay> roadInfoList) {
// if (roadInfoList == null || (roadInfoList != null && roadInfoList.size() <= 0)) {
// if ( TextUtils.equals(mKeywords,"附近")) {
// speakFailVoice("未发现附近的特殊路况");
// } else {
// speakFailVoice("未发现" + mKeywords + "附近的特殊路况");
// }
// moveToMarcker(currentLat, currentLon);
// return;
// }
// Logger.d(TAG, "onQueryRoadInfoSuccess roadInfoList.size() = " + roadInfoList.size()
// + " >>currentLat = " + currentLat + " -->currentLon = " + currentLon);
// MogoLocation location = TanluServiceManager.getLocationClient().getLastKnowLocation();
// if (location != null) {
// mCity = location.getCityName();
// }
// addMarkersAction((List<MarkerExploreWay>) roadInfoList, currentLat, currentLon);
// }
//
// @Override
// public void onQueryRoadInfoFail(@NotNull String msg, int code) {
// Logger.e(TAG, "onQueryRoadInfoFail ----- msg = " + msg);
//// speakFailVoice(searchfaileVoiceStrings[1]);
// if (TextUtils.equals(mKeywords,"附近")) {
// speakFailVoice("未发现附近的特殊路况");
// } else {
// speakFailVoice("未发现" + mKeywords + "附近的特殊路况");
// }
// moveToMarcker(currentLat, currentLon);
// }
//
// @Override
// public void onLocatSuccess(double lat, double lon) {
// currentLat = lat;
// currentLon = lon;
// }
// });
mTanluModelData.queryRodeInfo(mContext, mKeywords, voiceData, new RoadInfoCallback() {
@Override
public void onQueryRoadInfoSuccess(@NotNull List<? extends MarkerExploreWay> roadInfoList) {
if (roadInfoList == null || (roadInfoList != null && roadInfoList.size() <= 0)) {
if (TextUtils.equals(mKeywords, "附近")) {
speakFailVoice("未发现附近的特殊路况");
} else {
speakFailVoice("未发现" + mKeywords + "附近的特殊路况");
}
moveToMarcker(currentLat, currentLon);
return;
}
Logger.d(TAG, "onQueryRoadInfoSuccess roadInfoList.size() = " + roadInfoList.size()
+ " >>currentLat = " + currentLat + " -->currentLon = " + currentLon);
MogoLocation location = TanluServiceManager.getLocationClient().getLastKnowLocation();
if (location != null) {
mCity = location.getCityName();
}
addMarkersAction((List<MarkerExploreWay>) roadInfoList, currentLat, currentLon);
}
@Override
public void onQueryRoadInfoFail(@NotNull String msg, int code) {
Logger.e(TAG, "onQueryRoadInfoFail ----- msg = " + msg);
// speakFailVoice(searchfaileVoiceStrings[1]);
if (TextUtils.equals(mKeywords, "附近")) {
speakFailVoice("未发现附近的特殊路况");
} else {
speakFailVoice("未发现" + mKeywords + "附近的特殊路况");
}
moveToMarcker(currentLat, currentLon);
}
@Override
public void onLocatSuccess(double lat, double lon) {
currentLat = lat;
currentLon = lon;
}
});
}
}
@@ -362,7 +363,8 @@ public class TanluManager implements IMogoMarkerClickListener,
MarkerShowEntity markerShowEntity = new MarkerShowEntity();
markerShowEntity.setBindObj(markerExploreWayList.get(i));
markerShowEntity.setTextContent(list.get(i).getAddr());
markerShowEntity.setMarkerLocation(markerExploreWayList.get(i).getLocation());
markerShowEntity.setMarkerLocation(getLocation(markerExploreWayList.get(i).getLocation()));
markerShowEntity.setMarkerType(ShareConstants.MODEL_NAME);
TanluServiceManager.getServiceApis().getMarkerService().drawMarker(markerShowEntity);
@@ -381,6 +383,16 @@ public class TanluManager implements IMogoMarkerClickListener,
//直接使用当前数据list作为切换的数据源切换左侧列表到最新的数据
}
private com.mogo.module.common.entity.MarkerLocation getLocation(MarkerLocation location) {
com.mogo.module.common.entity.MarkerLocation markerLocation = new com.mogo.module.common.entity.MarkerLocation();
markerLocation.setLat(location.getLat());
markerLocation.setLon(location.getLon());
markerLocation.setAddress(location.getAddress());
markerLocation.setAngle(location.getAngle());
return markerLocation;
}
/**
* marker动画
@@ -458,7 +470,7 @@ public class TanluManager implements IMogoMarkerClickListener,
MogoLatLng latLon = poi.getPoint();
Double longit; //经度
Double lat; //维度
if (TextUtils.equals(mKeywords,"附近")) {
if (TextUtils.equals(mKeywords, "附近")) {
Logger.d(TAG, "附近 -onPoiSearched---1---");
longit = TanluServiceManager.getLocationClient().getLastKnowLocation().getLongitude();
lat = TanluServiceManager.getLocationClient().getLastKnowLocation().getLatitude();
@@ -473,7 +485,7 @@ public class TanluManager implements IMogoMarkerClickListener,
Logger.e(TAG, "poi == null");
Double longit; //经度
Double lat; //维度
if (TextUtils.equals(mKeywords,"附近")) {
if (TextUtils.equals(mKeywords, "附近")) {
Logger.d(TAG, "附近 -onPoiSearched---2---");
longit = TanluServiceManager.getLocationClient().getLastKnowLocation().getLongitude();
lat = TanluServiceManager.getLocationClient().getLastKnowLocation().getLatitude();
@@ -533,7 +545,7 @@ public class TanluManager implements IMogoMarkerClickListener,
markerExploreWay.setCityName(cityName);
markerExploreWay.setPoiType(poiType);
MarkerLocation markerLocation = new MarkerLocation();
com.mogo.module.common.entity.MarkerLocation markerLocation = new com.mogo.module.common.entity.MarkerLocation();
markerLocation.setLat(lat);
markerLocation.setLon(lon);
markerLocation.setAddress(address);
@@ -542,6 +554,7 @@ public class TanluManager implements IMogoMarkerClickListener,
markerShowEntity.setBindObj(markerExploreWay);
markerShowEntity.setTextContent(address);
markerShowEntity.setMarkerType(ShareConstants.MODEL_NAME);
markerShowEntity.setMarkerLocation(markerLocation);
IMogoMarker mogoMarker = TanluServiceManager.getServiceApis().getMarkerService().drawMarker(markerShowEntity);
@@ -572,11 +585,11 @@ public class TanluManager implements IMogoMarkerClickListener,
@Override
public void onAnimEnd() {
UiThreadHandler.postDelayed( () -> {
UiThreadHandler.postDelayed(() -> {
if (mogoAnimationMarker != null) {
mogoAnimationMarker.destroy();
}
}, 1_200L );
}, 1_200L);
}
});
}

View File

@@ -1,5 +1,7 @@
package com.mogo.module.share.callback
//import com.mogo.module.common.entity.MarkerExploreWay
import com.mogo.cloud.tanlu.bean.MarkerExploreWay

View File

@@ -45,9 +45,11 @@ dependencies {
if (Boolean.valueOf(RELEASE)) {
api rootProject.ext.dependencies.mogomapapi
api rootProject.ext.dependencies.skinsupport
api rootProject.ext.dependencies.mogocommons
} else {
api project(":libraries:mogo-map-api")
api project(":skin:mogo-skin-support")
api project(":foudations:mogo-commons")
}
}

View File

@@ -118,6 +118,7 @@ public interface IMogoADASController extends IProvider {
/**
* 添加adas识别物体回调
*
*
* @param callback
*/
void addAdasRecognizedDataCallback( IMogoAdasRecognizedDataCallback callback );

View File

@@ -1,6 +1,4 @@
package com.mogo.service.impl.adas;
import com.mogo.module.common.entity.OwnCarModelEntity;
package com.mogo.service.adas.entity;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package com.mogo.service.impl.adas;
package com.mogo.service.adas.entity;
import com.mogo.commons.data.BaseData;

View File

@@ -1,4 +1,4 @@
package com.mogo.module.common.entity;
package com.mogo.service.adas.entity;
/**
* 自车模型实体用于从服务端获取不同等级的自车模型信息以及将此信息传递给adas

View File

@@ -49,14 +49,12 @@ dependencies {
implementation rootProject.ext.dependencies.mogoutils
implementation rootProject.ext.dependencies.mogocommons
implementation rootProject.ext.dependencies.mogoserviceapi
implementation rootProject.ext.dependencies.modulecommon
} else {
api project(":libraries:mogo-map")
implementation project(":libraries:mogo-map-api")
implementation project(":foudations:mogo-utils")
implementation project(":foudations:mogo-commons")
implementation project(":services:mogo-service-api")
implementation project(":modules:mogo-module-common")
}
}

View File

@@ -1,6 +1,7 @@
package com.mogo.service.impl.adas;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.service.adas.entity.CarModelListResponse;
import java.util.Map;
@@ -28,7 +29,7 @@ interface CarModelInfoNetApiServices {
}
@GET("yycp-userDataService/app/enthusiasm/getEnthusiasmInfo/v1")
Observable<CarModelListResponse> requestCarModelList(@QueryMap Map<String, String> params);
Observable< CarModelListResponse > requestCarModelList( @QueryMap Map<String, String> params);
}

View File

@@ -13,9 +13,6 @@ import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.network.SubscribeImpl;
import com.mogo.commons.network.Utils;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.map.MyLocationUtil;
import com.mogo.module.common.utils.CarSeries;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.adas.IMogoADASController;
import com.mogo.service.adas.IMogoAdasCarDataCallback;
@@ -28,7 +25,10 @@ import com.mogo.service.adas.entity.ADASCarStateInfo;
import com.mogo.service.adas.entity.ADASRecognizedResult;
import com.mogo.service.adas.entity.ADASWarnMessage;
import com.mogo.service.adas.entity.AdasOCHData;
import com.mogo.service.adas.entity.CarModelListResponse;
import com.mogo.service.datamanager.IMogoDataManager;
import com.mogo.service.impl.singleton.SingletonsHolder;
import com.mogo.service.network.IMogoNetwork;
import com.mogo.service.statusmanager.IMogoStatusManager;
import com.mogo.utils.TipToast;
import com.mogo.utils.UiThreadHandler;
@@ -64,8 +64,6 @@ import java.util.concurrent.CopyOnWriteArrayList;
import io.reactivex.schedulers.Schedulers;
import static com.mogo.module.common.utils.SPConst.getSpGuide;
/**
* @author congtaowang
* @since 2020-03-10
@@ -196,11 +194,11 @@ public class MogoADASController implements IMogoADASController {
public void showADAS() {
if ( DebugConfig.isNeedLoadGuideModule() ) {
if ( !SharedPrefsMgr.getInstance( AbsMogoApplication.getApp() ).getBoolean( getSpGuide(), false ) ) {
if ( !SharedPrefsMgr.getInstance( AbsMogoApplication.getApp() ).getBoolean( DebugConfig.getSpGuide(), false ) ) {
return;
}
}
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
if ( SingletonsHolder.get( IMogoStatusManager.class ).isVrMode() ) {
return;
}
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
@@ -252,7 +250,7 @@ public class MogoADASController implements IMogoADASController {
needEmphasizeMyLocation = true;
// 修改自车图标展示
SharedPrefsMgr.getInstance( context ).putString( "MY_LOCATION_CONFIG", carStyleUrl );
MyLocationUtil.setMyLocationIconUrl( context, carStyleUrl );
SingletonsHolder.get( IMogoDataManager.class ).syncData( "ADAS", carStyleUrl );
}
@Override
@@ -273,7 +271,7 @@ public class MogoADASController implements IMogoADASController {
@Override
public void clickSettingBack() {
if ( needEmphasizeMyLocation ) {
MyLocationUtil.emphasizeMyLocation();
SingletonsHolder.get( IMogoDataManager.class ).syncData( "ADAS", null );
}
needEmphasizeMyLocation = false;
@@ -348,10 +346,10 @@ public class MogoADASController implements IMogoADASController {
}
// 仅在 vr 模式下显示 adas 识别车辆
if ( !MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
if ( !SingletonsHolder.get( IMogoStatusManager.class ).isVrMode() ) {
return;
}
if ( !MogoApisHandler.getInstance().getApis().getStatusManagerApi().isMainPageLaunched() ) {
if ( !SingletonsHolder.get( IMogoStatusManager.class ).isMainPageLaunched() ) {
return;
}
handleAdasRecognizedData( ownerCarStateRectList );
@@ -375,7 +373,7 @@ public class MogoADASController implements IMogoADASController {
private boolean useTestSn = false;
private void invokeShowADASOperation() {
int delay = CarSeries.isF8xxSeries() ? 0 : 100;
int delay = 0;
UiThreadHandler.postDelayed( () -> {
@@ -386,7 +384,7 @@ public class MogoADASController implements IMogoADASController {
return;
}
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
if ( SingletonsHolder.get( IMogoStatusManager.class ).isVrMode() ) {
return;
}
@@ -541,7 +539,8 @@ public class MogoADASController implements IMogoADASController {
params.put( "sn", Utils.getSn() );
// currentSn = useTestSn ? TEST_SN : Utils.getSn();
// params.put("sn", currentSn);
MogoApisHandler.getInstance().getApis().getNetworkApi().create( CarModelInfoNetApiServices.class, CarModelInfoNetApiServices.getBaseUrl() ).
SingletonsHolder.get( IMogoNetwork.class ).create( CarModelInfoNetApiServices.class, CarModelInfoNetApiServices.getBaseUrl() ).
requestCarModelList( params ).
subscribeOn( Schedulers.io() ).
observeOn( Schedulers.io() ).

View File

@@ -2,6 +2,7 @@ package com.mogo.service.impl.singleton;
import com.alibaba.android.arouter.facade.template.IProvider;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.service.datamanager.IMogoDataManager;
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
import com.mogo.service.impl.fragmentmanager.MogoFragmentManager;
import com.mogo.service.impl.map.MogoMapService;
@@ -35,6 +36,7 @@ public class SingletonsHolder {
sSingletons.put( IMogoNetwork.class, new MogoNetWorkService() );
sSingletons.put( IMogoMsgCenter.class, new MogoMsgCenter() );
sSingletons.put( IMogoStatusManager.class, new MogoStatusManager() );
sSingletons.put( IMogoDataManager.class, ARouter.getInstance().navigation( IMogoDataManager.class ) );
sSingletons.put( IMogoRefreshStrategyController.class, ARouter.getInstance().navigation( IMogoRefreshStrategyController.class ) );
}