Merge branch 'dev_MogoAP_eagle-1030_211020_8.0.14' into dev_MogoAP_eagle-1030_211020_8.0.14_for_newtts
This commit is contained in:
@@ -18,6 +18,7 @@ import com.mogo.service.statusmanager.IMogoStatusChangedListener
|
||||
import com.mogo.service.statusmanager.StatusDescriptor
|
||||
import com.mogo.utils.BitmapHelper
|
||||
import com.mogo.utils.glide.GlideApp
|
||||
import com.mogo.utils.glide.GlideRoundedCornersTransform
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
|
||||
import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack
|
||||
@@ -120,7 +121,11 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
||||
if (!TextUtils.isEmpty(noticeNormal.imageUrl) && noticeNormal.fileType == 1) {
|
||||
pushVideo?.visibility = View.GONE
|
||||
pushImageView?.visibility = View.VISIBLE
|
||||
pushImageView?.let { GlideApp.with(context!!).load(noticeNormal.imageUrl).into(it) }
|
||||
pushImageView?.let {
|
||||
GlideApp.with(context).load(noticeNormal.imageUrl).optionalTransform(GlideRoundedCornersTransform(
|
||||
20f, GlideRoundedCornersTransform.CornerType.ALL)).into(it)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!TextUtils.isEmpty(noticeNormal.videoUrl) && noticeNormal.fileType == 2) {
|
||||
@@ -183,7 +188,9 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
||||
playImageView!!.visibility = View.VISIBLE
|
||||
playImageView!!.setImageResource(R.drawable.notice_video_play)
|
||||
thumbnailImageView!!.visibility = View.VISIBLE
|
||||
thumbnailImageView!!.setImageBitmap(firstbitmap)
|
||||
GlideApp.with(context).load(firstbitmap).optionalTransform(GlideRoundedCornersTransform(
|
||||
20f, GlideRoundedCornersTransform.CornerType.ALL)).into(thumbnailImageView!!)
|
||||
|
||||
}
|
||||
|
||||
private fun startVideoCallBack(path: String) {
|
||||
|
||||
@@ -120,8 +120,8 @@ public class NoticeTrafficDialog extends BaseFloatDialog implements LifecycleObs
|
||||
if (mPushData.getType() == 1) {
|
||||
startLive();
|
||||
} else {
|
||||
MogoApisHandler.getInstance().getApis().getImageLoaderApi().displayImage(mPushData.getPoiImgUrl(),
|
||||
thumbnailImage);
|
||||
GlideApp.with(mContext).load(mPushData.getPoiImgUrl()).optionalTransform(new GlideRoundedCornersTransform
|
||||
(20f, GlideRoundedCornersTransform.CornerType.ALL)).into(thumbnailImage);
|
||||
mVideoPlayer.setVisibility(View.INVISIBLE);
|
||||
playImageView.setVisibility(View.INVISIBLE);
|
||||
thumbnailImage.setVisibility(View.VISIBLE);
|
||||
|
||||
@@ -87,6 +87,7 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.moduleservice
|
||||
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_obu_mogo
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_smp
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_hmi
|
||||
@@ -123,6 +124,7 @@ dependencies {
|
||||
implementation project(':modules:mogo-module-service')
|
||||
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation project(':core:function-impl:mogo-core-function-obu-mogo')
|
||||
implementation project(':core:function-impl:mogo-core-function-smp')
|
||||
implementation project(':core:function-impl:mogo-core-function-hmi')
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.mogo.commons.network.Utils;
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils;
|
||||
import com.mogo.map.MapApiPath;
|
||||
import com.mogo.module.carchatting.card.CallChatConstant;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
@@ -344,6 +345,10 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
@Override
|
||||
protected void attachBaseContext(Context base) {
|
||||
super.attachBaseContext(base);
|
||||
/**如果是主进程**/
|
||||
if (ProcessUtils.isMainProcess(this)) {
|
||||
AppLaunchTimeUtils.beginTimeCalculate(AppLaunchTimeUtils.COLD_START);
|
||||
}
|
||||
BoostMultiDex.install(base);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class SmallMapDirectionView
|
||||
private Marker mStartMarker;
|
||||
private Marker mEndMarker;
|
||||
|
||||
private int zoomLevel = 13;
|
||||
private int zoomLevel = 15;
|
||||
private List<LatLng> mCoordinatesLatLng = new ArrayList<>();
|
||||
private List<MogoLatLng> mCoordinatesLatLngCurrent = new ArrayList<>();
|
||||
private Polyline mPolyline;
|
||||
@@ -217,7 +217,7 @@ public class SmallMapDirectionView
|
||||
clearPolyline();
|
||||
mCoordinatesLatLng.clear();
|
||||
}
|
||||
cameraPosition = new CameraPosition.Builder().target(mCarMarker.getPosition()).tilt(0).bearing(location.getBearing()).build();
|
||||
cameraPosition = new CameraPosition.Builder().target(mCarMarker.getPosition()).tilt(0).bearing(location.getBearing()).zoom(zoomLevel).build();
|
||||
} else {
|
||||
//设置希望展示的地图缩放级别
|
||||
cameraPosition = new CameraPosition.Builder().target(mCarMarker.getPosition()).tilt(0).bearing(location.getBearing()).zoom(zoomLevel).build();
|
||||
|
||||
@@ -41,7 +41,7 @@ public class SpeedLimitDataManager implements IMogoCarLocationChangedListener2 {
|
||||
@Override
|
||||
public void run() {
|
||||
int speed = (int) (mLocation.getSpeed() * 3.6f);
|
||||
if (speed > speedLimmit){
|
||||
if (speed > 0 && speedLimmit > 0){
|
||||
CallerHmiManager.INSTANCE.showLimitingVelocity(speedLimmit);
|
||||
}else {
|
||||
CallerHmiManager.INSTANCE.disableLimitingVelocity();
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.mogo.map.navi.IMogoCarLocationChangedListener2
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import com.mogo.module.common.enums.EventTypeEnum
|
||||
import com.mogo.service.cloud.socket.IMogoOnMessageListener
|
||||
import com.mogo.utils.UiThreadHandler
|
||||
import com.mogo.utils.logger.Logger
|
||||
import kotlin.math.abs
|
||||
|
||||
@@ -41,8 +42,14 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
private var mLocation: Location? = null
|
||||
private var turnLightFirst = false
|
||||
private var turnLightEnd = true
|
||||
private var result: TrafficLightResult? = null
|
||||
private var vip: Boolean = false
|
||||
|
||||
@Volatile
|
||||
private var enter: Boolean = false
|
||||
|
||||
private var result: TrafficLightResult? = null
|
||||
private var lastResult: TrafficLightStatus? = null
|
||||
|
||||
private val vipNetWorkModel = VipNetWorkModel()
|
||||
private val handler = Handler(Looper.getMainLooper(), this)
|
||||
|
||||
@@ -96,15 +103,21 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
if (!vip) {
|
||||
return
|
||||
}
|
||||
if (enter) {
|
||||
Logger.d(TAG, "驶入路口,返回 , then resetConditions")
|
||||
resetConditions()
|
||||
return
|
||||
}
|
||||
if (trafficLightResult.currentRoadTrafficLight() == null) {
|
||||
Logger.d(TAG, "vip 获取到灯态,但没找到对应车道数据 result : $trafficLightResult")
|
||||
Logger.d(TAG, "vip 获取到灯态,但没找到对应车道数据 result : $trafficLightResult , then resetConditions")
|
||||
resetConditions()
|
||||
return
|
||||
}
|
||||
val currentResult = trafficLightResult.currentRoadTrafficLight()
|
||||
val lastResult = result?.currentRoadTrafficLight()
|
||||
lastResult = result?.currentRoadTrafficLight()
|
||||
Logger.d(
|
||||
TAG,
|
||||
"检查是否变灯 last.remain : ${lastResult?.remain} , current.remain : ${currentResult?.remain}"
|
||||
"检查是否变灯 last.remain : ${lastResult?.remain} , color : ${lastResult?.color} , current.remain : ${currentResult?.remain} , color : ${currentResult?.color}, turnLightFirst : $turnLightFirst"
|
||||
)
|
||||
|
||||
this.result = trafficLightResult
|
||||
@@ -118,7 +131,8 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
}
|
||||
lastResult?.let {
|
||||
//如果上次结果和本次灯态结果变化比较大,则已变灯,控制HMI展示弹窗
|
||||
if (abs(lastResult.remain - currentResult!!.remain) > 3) {
|
||||
if (abs(currentResult!!.remain - it.remain) > 5) {
|
||||
Logger.d(TAG,"调用showWarningV2X to show")
|
||||
CallerHmiManager.showWarningV2X(EventTypeEnum.TYPE_VIP_IDENTIFICATION.poiType.toInt(),
|
||||
EventTypeEnum.TYPE_VIP_IDENTIFICATION.content,
|
||||
EventTypeEnum.TYPE_VIP_IDENTIFICATION.tts,
|
||||
@@ -128,10 +142,9 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
override fun onDismiss() {
|
||||
Logger.d(
|
||||
TAG,
|
||||
"showWarningV2X vip dismiss , reset turnLightFirst to false "
|
||||
"showWarningV2X vip dismiss , resetConditions"
|
||||
)
|
||||
turnLightFirst = false
|
||||
turnLightEnd = true
|
||||
resetConditions()
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -145,6 +158,13 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
// }
|
||||
}
|
||||
|
||||
private fun resetConditions() {
|
||||
turnLightFirst = false
|
||||
turnLightEnd = true
|
||||
result = null
|
||||
lastResult = null
|
||||
}
|
||||
|
||||
private fun setVip(cancelDelayTime: Long) {
|
||||
vip = true
|
||||
handler.sendEmptyMessageDelayed(
|
||||
@@ -154,6 +174,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
CallerHmiManager.vipIdentification(true)
|
||||
CallVipSetListenerManager.invokeVipSetStatus(true)
|
||||
CallTrafficLightListenerManager.registerTrafficLightListener(TAG, this)
|
||||
CallTrafficLightListenerManager.registerEnterCrossRoadListener(TAG, this)
|
||||
}
|
||||
|
||||
private fun cancelVip() {
|
||||
@@ -164,6 +185,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
CallerHmiManager.vipIdentification(false)
|
||||
CallVipSetListenerManager.invokeVipSetStatus(false)
|
||||
CallTrafficLightListenerManager.unRegisterTrafficLightListener(TAG)
|
||||
CallTrafficLightListenerManager.unRegisterEnterCrossRoadListener(TAG)
|
||||
}
|
||||
|
||||
private fun canGetThroughCross(
|
||||
@@ -202,6 +224,13 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
})
|
||||
}
|
||||
|
||||
override fun onEnterCrossRoad(enter: Boolean) {
|
||||
super.onEnterCrossRoad(enter)
|
||||
UiThreadHandler.post {
|
||||
this.enter = enter
|
||||
}
|
||||
}
|
||||
|
||||
private fun turnLight(controlTime: Int) {
|
||||
result?.let {
|
||||
MogoTrafficLightManager.INSTANCE.turnLightToGreen(
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.mogo.eagle.core.utilcode.mogo;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* 应用启动计时工具
|
||||
*/
|
||||
public class AppLaunchTimeUtils {
|
||||
private static HashMap<String, Long> sCalTimeMap = new HashMap<>();
|
||||
public static final String COLD_START = "cold_start";
|
||||
public static final String HOT_START = "hot_start";
|
||||
public static long sColdStartTime = 0;
|
||||
|
||||
/**
|
||||
* 记录某个事件的开始时间
|
||||
*
|
||||
* @param key 事件名称
|
||||
*/
|
||||
public static void beginTimeCalculate(String key) {
|
||||
long currentTime = System.currentTimeMillis();
|
||||
sCalTimeMap.put(key, currentTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取某个事件的运行时间
|
||||
*
|
||||
* @param key 事件名称
|
||||
* @return 返回某个事件的运行时间,调用这个方法之前没有调用 {@link #beginTimeCalculate(String)} 则返回-1
|
||||
*/
|
||||
public static long getTimeCalculate(String key) {
|
||||
long currentTime = System.currentTimeMillis();
|
||||
Long beginTime = sCalTimeMap.get(key);
|
||||
if (beginTime == null) {
|
||||
return -1;
|
||||
} else {
|
||||
sCalTimeMap.remove(key);
|
||||
return currentTime - beginTime;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除某个时间运行时间计时
|
||||
*
|
||||
* @param key 事件名称
|
||||
*/
|
||||
public static void clearTimeCalculate(String key) {
|
||||
sCalTimeMap.remove(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除启动时间计时
|
||||
*/
|
||||
public static void clearStartTimeCalculate() {
|
||||
clearTimeCalculate(HOT_START);
|
||||
clearTimeCalculate(COLD_START);
|
||||
sColdStartTime = 0;
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,10 @@ enum class EventTypeEnum(
|
||||
),
|
||||
|
||||
//结冰
|
||||
FOURS_ICE("10011", "路面结冰", "路面结冰", R.drawable.v2x_icon_jiebing_vr, content = "前方路面结冰", tts = "路面结冰"),
|
||||
FOURS_ICE(
|
||||
"10011", "路面结冰", "路面结冰", R.drawable.v2x_icon_jiebing_vr,
|
||||
"前方路面结冰", "路面结冰"
|
||||
),
|
||||
|
||||
//停车场
|
||||
FOURS_PARKING("10012", "停车场", "停车场", content = "停车场附近", tts = "停车场"),
|
||||
|
||||
@@ -25,11 +25,13 @@ import com.mogo.commons.mvp.MvpActivity;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.ResourcesHelper;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.api.CallChatApi;
|
||||
import com.mogo.module.common.enums.EventTypeEnum;
|
||||
import com.mogo.module.common.map.MapCenterPointStrategy;
|
||||
import com.mogo.module.common.map.Scene;
|
||||
import com.mogo.module.main.cards.MogoModulesManager;
|
||||
@@ -50,6 +52,9 @@ import com.zhidao.adasconfig.api.AdasConfigApiController;
|
||||
import com.zhidao.adasconfig.common.log.LoggerController;
|
||||
import com.zhidao.autopilot.support.api.AutopilotServiceManage;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-23
|
||||
@@ -154,6 +159,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
calculateStartTime();
|
||||
ContextHolderUtil.holdContext(this);
|
||||
mPresenter.postLoadModuleMsg();
|
||||
NetworkUtils.listenNetStrength(this);
|
||||
@@ -163,6 +169,41 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
mPresenter.checkPermission(this);
|
||||
}
|
||||
|
||||
private void calculateStartTime() {
|
||||
long coldStartTime = AppLaunchTimeUtils.getTimeCalculate(AppLaunchTimeUtils.COLD_START);
|
||||
// 这里记录的TimeUtils.coldStartTime是指Application启动的时间,最终的冷启动时间等于Application启动时间+热启动时间
|
||||
AppLaunchTimeUtils.sColdStartTime = coldStartTime > 0 ? coldStartTime : 0;
|
||||
AppLaunchTimeUtils.beginTimeCalculate(AppLaunchTimeUtils.HOT_START);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onWindowFocusChanged(boolean hasFocus) {
|
||||
if (hasFocus) {
|
||||
// 统计代码
|
||||
final Map<String, Object> properties = new HashMap<>();
|
||||
long hotStartTime = AppLaunchTimeUtils.getTimeCalculate(AppLaunchTimeUtils.HOT_START);
|
||||
if (AppLaunchTimeUtils.sColdStartTime > 0 && hotStartTime > 0) {
|
||||
// 真正的冷启动时间 = Application启动时间 + 热启动时间
|
||||
long coldStartTime = AppLaunchTimeUtils.sColdStartTime + hotStartTime;
|
||||
// 过滤掉异常启动时间
|
||||
if (coldStartTime < 50000) {
|
||||
// 上传冷启动时间coldStartTime
|
||||
Logger.i(TAG, "coldStartTime:" + coldStartTime);
|
||||
properties.put("app_launch_coldStartTime", coldStartTime);
|
||||
}
|
||||
} else if (hotStartTime > 0) {
|
||||
// 过滤掉异常启动时间
|
||||
if (hotStartTime < 30000) {
|
||||
// 上传热启动时间hotStartTime
|
||||
Logger.i(TAG, "hotStartTime:" + hotStartTime);
|
||||
properties.put("app_launch_hotStartTime", hotStartTime);
|
||||
}
|
||||
}
|
||||
MogoApisHandler.getInstance().getApis().getAnalyticsApi().track("app_launch_time", properties);
|
||||
}
|
||||
}
|
||||
|
||||
private void init() {
|
||||
if (mServiceApis == null) {
|
||||
mServiceApis = MogoApisHandler.getInstance().getApis();
|
||||
|
||||
@@ -130,6 +130,7 @@ public class RouteOverlayDrawer {
|
||||
mPolylinePointList.add(latLng);
|
||||
}
|
||||
mPolylineOptions.setGps(true);
|
||||
mPolylineOptions.zIndex(10000f);
|
||||
mPolylineColors.addAll(ColorUtils.getGradientAlpha("#002965ED", "#FF2965ED", "#002965ED", mPolylinePointList.size()));
|
||||
// 替换路径集合
|
||||
mPolylineOptions.points(mPolylinePointList);
|
||||
|
||||
Reference in New Issue
Block a user