This commit is contained in:
wangcongtao
2020-12-08 14:08:53 +08:00
840 changed files with 31903 additions and 11168 deletions

View File

@@ -8,6 +8,7 @@ import com.mogo.service.analytics.IMogoAnalytics;
import com.mogo.service.auth.IMogoAuthManager;
import com.mogo.service.cardmanager.IMogoCardManager;
import com.mogo.service.connection.IMogoSocketManager;
import com.mogo.service.connection.IMogoWebSocketManager;
import com.mogo.service.datamanager.IMogoDataManager;
import com.mogo.service.entrance.IMogoEntranceButtonController;
import com.mogo.service.eventpanel.IEventPanelProvider;
@@ -16,6 +17,7 @@ import com.mogo.service.imageloader.IMogoImageloader;
import com.mogo.service.intent.IMogoIntentManager;
import com.mogo.service.launcher.IMogoLauncher;
import com.mogo.service.locationinfo.IMogoLocationInfoService;
import com.mogo.service.map.IMogoMapFrameController;
import com.mogo.service.map.IMogoMapService;
import com.mogo.service.module.IMogoActionManager;
import com.mogo.service.module.IMogoAddressManager;
@@ -25,7 +27,7 @@ import com.mogo.service.module.IMogoSearchManager;
import com.mogo.service.module.IMogoSettingManager;
import com.mogo.service.monitor.IMogoMonitorProvider;
import com.mogo.service.network.IMogoNetwork;
import com.mogo.service.obu.IMogoObuManager;
import com.mogo.service.obu.IMogoCrashWarnProvider;
import com.mogo.service.passport.IMogoPassportManager;
import com.mogo.service.share.IMogoShareManager;
import com.mogo.service.share.IMogoTrafficUploadProvider;
@@ -70,6 +72,11 @@ public interface IMogoServiceApis extends IProvider {
*/
IMogoSocketManager getSocketManagerApi( Context context );
/**
* 获取WebSocket操作api
*/
IMogoWebSocketManager getWebSocketManagerApi( Context context );
/**
* 大而全的数据管理接口
*
@@ -217,13 +224,6 @@ public interface IMogoServiceApis extends IProvider {
*/
IMogoShareManager getShareManager();
/**
* 获取obuManager
*
* @return obuManager
*/
IMogoObuManager getObuManager();
/**
* 获取事件面板manager
*
@@ -247,35 +247,49 @@ public interface IMogoServiceApis extends IProvider {
/**
* 获取授权服务
*
* @return
*/
IMogoAuthManager getAuthManagerApi();
/**
* 获取探路服务
*
* @return
*/
IMogoTanluProvider getTanluApi();
/**
* 获取Monitor相关api
*
* @return
*/
IMogoMonitorProvider getMogoMonitorApi();
/**
* 获取探路ui服务
*
* @return
*/
IMogoTanluUiProvider getTanluUiApi();
/**
* 皮肤管理接口
*
* @return
*/
IMogoSkinSupportInstaller getSkinSupportInstallerApi();
/**
* 获取crashWarnProvider
*
* @return
*/
IMogoCrashWarnProvider getCrashWarnProvider();
/**
* 在线车辆面板
*
* @return
*/
IMogoOnlineCarListPanelProvider getOnlineCarPanelApi();
@@ -285,4 +299,11 @@ public interface IMogoServiceApis extends IProvider {
* @return
*/
IMogoTrafficUploadProvider getTrafficUploadApi();
/**
* 地图图层控制接口
*
* @return
*/
IMogoMapFrameController getMapFrameControllerApi();
}

View File

@@ -51,6 +51,12 @@ public class MogoServicePaths {
@Deprecated
public static final String PATH_SOCKET_MANAGER = "/socket/manager";
/**
* WebSocket 长链
*/
@Deprecated
public static final String PATH_WEB_SOCKET_MANAGER = "/websocket/manager";
/**
* 状态管理接口
*/
@@ -155,8 +161,6 @@ public class MogoServicePaths {
@Deprecated
public static final String PATH_REFRESH_STRATEGY_API = "/refreshstrategy/api";
/**
* 刷新策略控制
*/
@@ -227,7 +231,7 @@ public class MogoServicePaths {
* 授权服务
*/
@Deprecated
public static final String PATH_AGREEMENT = "/agreement/showFragment";
public static final String PATH_AGREEMENT = "/agreement/showFragment";
/**
* 日志上传
@@ -265,6 +269,12 @@ public class MogoServicePaths {
@Deprecated
public static final String PATH_TANLU_UI_API = "/tanlu/ui";
/**
* 碰撞报警模块
*/
@Deprecated
public static final String PATH_CRASH_WARNING = "/crash/warning";
/**
* 悬浮小控件
*/
@@ -284,4 +294,9 @@ public class MogoServicePaths {
* 返回悬浮按钮
*/
public static final String PATH_BACK = "/back2launcher/ui";
/**
* 自研地图和高德地图切换
*/
public static final String PATH_MAP_FRAME_CONTROLLER = "/mapframe/controller";
}

View File

@@ -2,6 +2,9 @@ package com.mogo.service.adas;
import com.alibaba.android.arouter.facade.template.IProvider;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.service.adas.entity.ADASRecognizedResult;
import java.util.List;
/**
* @author congtaowang
@@ -72,19 +75,57 @@ public interface IMogoADASController extends IProvider {
/**
* 给adas传递数据
*
* @param json
* @param result
*/
void notifyAdas( String json );
void aiCloudToAdasData( RemoteControlAutoPilotParameters result );
/**
* 添加adas数据回调接口
*
* @param callback 回调接口
*/
void addAdasDataCallback(IMogoAdasDataCallback callback);
void addAdasDataCallback( IMogoAdasDataCallback callback );
/**
* 移除adas数据回调接口
*
* @param callback 待移除的callback
*/
void removeAdasDataCallback(IMogoAdasDataCallback callback);
void removeAdasDataCallback( IMogoAdasDataCallback callback );
/**
* 添加adas报警数据回调接口
*
* @param callback 回调接口
*/
void addAdasWarnMessageCallback( IMogoAdasWarnMessageCallback callback );
/**
* 移除adas报警数据回调接口
*
* @param callback 待移除的callback
*/
void removeAdasWarnMessageCallback( IMogoAdasWarnMessageCallback callback );
/**
* 获取 adas 识别列表
*
* @return
*/
List< ADASRecognizedResult > getLastADASRecognizedResult();
/**
* 添加adas识别物体回调
*
* @param callback
*/
void addAdasRecognizedDataCallback( IMogoAdasRecognizedDataCallback callback );
/**
* 移除adas识别物体回调
*
* @param callback
*/
void removeAdasRecognizedDataCallback( IMogoAdasRecognizedDataCallback callback );
}

View File

@@ -0,0 +1,20 @@
package com.mogo.service.adas;
import com.mogo.service.adas.entity.ADASRecognizedListResult;
import com.mogo.service.adas.entity.ADASRecognizedResult;
import java.util.List;
/**
* adas 物体识别数据回调接口
*
* @author tongchenfei
*/
public interface IMogoAdasRecognizedDataCallback {
/**
* adas 数据回调
*
* @param resultList 具体识别的物体数据
*/
void onAdasDataCallback( List< ADASRecognizedListResult > resultList );
}

View File

@@ -0,0 +1,16 @@
package com.mogo.service.adas;
import com.mogo.service.adas.entity.ADASWarnMessage;
/**
* adas 数据回调接口
*
* @author tongchenfei
*/
public interface IMogoAdasWarnMessageCallback {
/**
* adas 数据回调
* @param msg 具体数据
*/
void onReceiveData( ADASWarnMessage msg );
}

View File

@@ -0,0 +1,64 @@
package com.mogo.service.adas;
public
/**
* @author congtaowang
* @since 2020/10/25
*
* 描述
*/
interface MogoADASWarnType {
/**
* 行人报警
*/
int ADAS_WARNING_PERSON = 16;
/**
* 前车起步
*/
int ADAS_WARNING_FRONT_CAR_GO = 17;
/**
* ldw 类型 左侧车道线
*/
int ADAS_WARNING_SENCE_LANE_LEFT_LOST = 18;
/**
* 右侧车道线
*/
int ADAS_WARNING_SENCE_LANE_RIGHT_LOST = 19;
/**
* fcw 类型
*/
int ADAS_WARNING_FRONT_CAR = 20;
/**
* 摩托车碰撞
*/
int ADAS_WARNING_MOTORCYCLE = 23;
/**
* 急刹车
*/
int ADAS_WARNING_QUICK_BRAKE = 30;
/**
* 禁止掉头
*/
int ADAS_WARNING_NOT_U_TURN = 40;
/**
* 禁止左转
*/
int ADAS_WARNING_NOT_LEFT_TURN = 41;
/**
* 禁止右转
*/
int ADAS_WARNING_NOT_RIGHT_TURN = 42;
/**
* 禁止鸣喇叭
*/
int ADAS_WARNING_NOT_VOICE = 43;
/**
* 禁止通行
*/
int ADAS_WARNING_DO_NOT_ENTER = 44;
/**
* 限速
*/
int ADAS_WARNING_LIMIT_SPEED = 45;
}

View File

@@ -0,0 +1,23 @@
package com.mogo.service.adas;
import java.util.List;
public
/**
* @author congtaowang
* @since 2020/10/16
*
* 自动驾驶参数
*/
class RemoteControlAutoPilotParameters {
public AutoPilotLonLat startLatLon;
public List< AutoPilotLonLat > wayLatLons;
public AutoPilotLonLat endLatLon;
public float speedLimit;
public static class AutoPilotLonLat {
public double lat;
public double lon;
}
}

View File

@@ -0,0 +1,56 @@
package com.mogo.service.adas.entity;
import java.util.List;
public
/**
* @author congtaowang
* @since 2020/10/25
*
* adas 识别物体参数
*/
class ADASRecognizedListResult {
/**
* 识别物体类型
*/
public int type;
/**
* 识别物体唯一标识
*/
public String uuid;
/**
* 方向
*/
public double heading;
/**
* 速度
*/
public double speed;
/**
* x 轴距离
*/
public double distanceX;
/**
* y 轴距离
*/
public double distanceY;
/**
* 同一个uuid 1s内所对应的连续坐标
*/
public List< LatLon > latLonList;
public static class LatLon {
public LatLon( double lat, double lon ) {
this.lat = lat;
this.lon = lon;
}
public double lat;
public double lon;
}
}

View File

@@ -0,0 +1,72 @@
package com.mogo.service.adas.entity;
public
/**
* @author congtaowang
* @since 2020/10/25
*
* adas 识别物体参数
*/
class ADASRecognizedResult {
/**
* 识别物体类型
*/
public int type;
/**
* 识别物体唯一标识
*/
public String uuid;
/**
* 红绿灯颜色
*/
public String color;
/**
*
*/
public String carId;
/**
* 识别物体的纬度
*/
public double lat;
/**
* 识别物体的经度
*/
public double lon;
/**
* 朝向
*/
public double heading;
/**
* 系统时间
*/
public long systemTime;
/**
* 定位卫星时间
*/
public long satelliteTime;
/**
* 海拔
*/
public double alt;
/**
* 速度
*/
public double speed;
/**
* 莫顿码
*/
public long mortonCode;
}

View File

@@ -0,0 +1,32 @@
package com.mogo.service.adas.entity;
public
/**
* @author congtaowang
* @since 2020/10/25
*
* 描述
*/
class ADASWarnMessage {
public String content;
public String level;
/**
* 警告消息类型
* <p>
* {@link com.mogo.service.adas.MogoADASWarnType}
*/
public int type;
public String value;
@Override
public String toString() {
return "ADASWarnMessage{" +
"content='" + content + '\'' +
", level='" + level + '\'' +
", type=" + type +
", value='" + value + '\'' +
'}';
}
}

View File

@@ -0,0 +1,27 @@
package com.mogo.service.connection;
/**
* 消息回调
*/
public interface IMogoOnWebSocketMessageListener<T> {
default WebSocketMsgType getDownLinkType() {
return null;
}
default WebSocketMsgType getUpLinkType() {
return null;
}
default Class<T> target() {
return null;
}
default void onMsgReceived(T obj) {
}
default void onError(String errorMsg) {
}
}

View File

@@ -0,0 +1,38 @@
package com.mogo.service.connection;
import android.content.Context;
import com.alibaba.android.arouter.facade.template.IProvider;
public interface IMogoWebSocketManager<T> extends IProvider {
/**
* 初始化,各模块不用关心
*
* @param context 上下文
* @param appId 一般为包名,不参与通道的建立,一般用于发消息
*/
void init( Context context, String appId );
/**
* 注册消息监听
*
* @param listener 回调
*/
void registerOnWebSocketMessageListener(IMogoOnWebSocketMessageListener listener );
/**
* 注销消息监听
*
*/
void unregisterOnWebSocketMessageListener(IMogoOnWebSocketMessageListener listener );
/**
* 发送消息
*
* @param body 消息体
* @param listener 回执监听
*/
void sendMsg( T body, IMogoOnWebSocketMessageListener listener );
}

View File

@@ -0,0 +1,24 @@
package com.mogo.service.connection;
public enum WebSocketMsgType {
MSG_TYPE_UPLINK_CAR_DATA(0,"自车与ADAS数据"),
MSG_TYPE_DOWNLINK_CAR_DATA(1,"服务端下发车辆信息"),
MSG_TYPE_ACK(3, "ACK");
private int msgType;
private String msg;
WebSocketMsgType(int msgType, String msg) {
this.msgType = msgType;
this.msg = msg;
}
public int getMsgType() {
return msgType;
}
public void setMsgType(int msgType) {
this.msgType = msgType;
}
}

View File

@@ -4,6 +4,7 @@ import android.view.View;
import android.widget.TextView;
import com.alibaba.android.arouter.facade.template.IProvider;
import com.mogo.service.windowview.IMogoEntranceViewListener;
/**
* @author congtaowang
@@ -13,6 +14,54 @@ import com.alibaba.android.arouter.facade.template.IProvider;
*/
public interface IMogoEntranceButtonController extends IProvider {
/**
* 前车急刹
*/
int NOTICE_TYPE_SUDDENLY_BREAK = 1001;
/**
* vip变灯通行
*/
int NOTICE_TYPE_VIP = 1002;
/**
* 行人碰撞预警
*/
int NOTICE_TYPE_PEOPLE_WARN = 1003;
/**
* 逆向超车
*/
int NOTICE_TYPE_ILLEGAL_OVERTAKE = 1004;
/**
* 后方危险车辆提醒
*/
int NOTICE_TYPE_DANGEROUS_CAR_WARN = 1005;
/**
* 特殊车辆快速通过
*/
int NOTICE_TYPE_SPECIAL_CAR_WARN = 1006;
/**
* 自车求助
*/
int NOTICE_TYPE_SEEK_HELP = 1007;
/**
* 交通事故识别
*/
int NOTICE_TYPE_ACCIDENT_WARN = 1008;
/**
* 障碍物体绕行
*/
int NOTICE_TYPE_OBSTACLE_WARN = 1009;
/**
* 障碍车辆绕行
*/
int NOTICE_TYPE_OBSTACLE_CAR_WARN = 1010;
/**
* 拥堵路线推荐
*/
int NOTICE_TYPE_CONGESTION_RECOMMENDED = 1011;
/**
* 获取入口按钮实例
*
@@ -53,4 +102,42 @@ public interface IMogoEntranceButtonController extends IProvider {
* @param view 待移除view
*/
void removeLeftFeatureView(View view);
/**
* 设置vr模式下左下角提示view
* @param view 目前是adas提示和求助
*/
void showLeftNoticeView(View view);
/**
* 隐藏vr模式下左下角提示view需要与{@link #showLeftNoticeView(View)}成对使用
* @param view 待隐藏view
*/
void hideLeftNoticeView(View view);
/**
* 根据noticeType添加左侧提示
* @param noticeType {@link #NOTICE_TYPE_SUDDENLY_BREAK}...
* @param iconRes 本地 icon res
* @param content 提示内容
*/
void showLeftNoticeByType(int noticeType, int iconRes, String content);
/**
* 移除noticeType需要与{@link #showLeftNoticeByType(int, int, String)}成对使用
* @param noticeType {@link #NOTICE_TYPE_SUDDENLY_BREAK}...
*/
void hideLeftNoticeByType(int noticeType);
/**
* 添加view状态回调监听
* @param listener 回调监听
*/
void addEntranceViewListener(IMogoEntranceViewListener listener);
/**
* 移除view状态回调监听
* @param listener 回调监听
*/
void removeEntranceViewListener(IMogoEntranceViewListener listener);
}

View File

@@ -0,0 +1,28 @@
package com.mogo.service.map;
import com.alibaba.android.arouter.facade.template.IProvider;
import com.mogo.map.IDestroyable;
public
/**
* @author congtaowang
* @since 2020/10/23
*
* 地图图层切换:高德地图 <-> 自研地图,过渡期使用
*/
interface IMogoMapFrameController extends IProvider, IDestroyable {
void initDelegate( IMogoMapFrameController controller );
/**
* 切换到高德2D
*/
void changeTo2dMode();
/**
* 切换到自研vr
*/
void changeToVRMode();
boolean isVrMode();
}

View File

@@ -8,7 +8,6 @@ import com.mogo.map.navi.IMogoAimlessModeListener;
import com.mogo.map.navi.IMogoCarLocationChangedListener;
import com.mogo.map.navi.IMogoNaviListener;
import com.mogo.service.adas.IMogoADASControlStatusChangedListener;
import com.mogo.service.obu.IMogoObuDataChangedListener;
import java.util.Iterator;
@@ -138,19 +137,6 @@ public interface IMogoRegisterCenter extends IProvider {
*/
void unregisterCarLocationChangedListener( String tag, IMogoCarLocationChangedListener listener );
/**
* 注册obu数据变化监听
* @param tag 模块tag目前没有实际作用只用于解注册时的tag选择
* @param listener 回调监听
*/
void registerObuDataListener(String tag, IMogoObuDataChangedListener listener);
/**
* 注销obu数据变化监听
* @param tag 传入与注册时相同的tag
*/
void unregisterObuDataListener(String tag);
/**
* adas 控制状态变更监听
* @param tag

View File

@@ -0,0 +1,22 @@
package com.mogo.service.obu;
import com.alibaba.android.arouter.facade.template.IProvider;
import com.zhidao.manager.ts.TsThreshold;
/**
* 碰撞报警相关接口
* @author tongchenfei
*/
public interface IMogoCrashWarnProvider extends IProvider {
/**
* 设置碰撞碰撞报警阈值
* @param threshold
*/
void setCrashThreshold(TsThreshold threshold);
/**
* 获取当前碰撞报警阈值
* @return
*/
TsThreshold getCurrentCrashThreshold();
}

View File

@@ -1,39 +0,0 @@
package com.mogo.service.obu;
import com.zhidao.smartv2x.model.obu.CarEventInfo;
import com.zhidao.smartv2x.model.obu.CarLocationInfo;
import com.zhidao.smartv2x.model.obu.TrafficLightInfo;
/**
* obu数据改变的回调
*
* @author tongchenfei
*/
public interface IMogoObuDataChangedListener {
/**
* 车辆位置信息回调接口
* @param info 位置信息
*/
void showCarLocationInfo(CarLocationInfo info);
/**
* UDP 收发消息回调接口
*
* @param info 消息回调
*/
void showOtherInfo(String info);
/**
* 交通信号灯信息回调接口
*
* @param info 信号灯信息
*/
void showTrafficLightInfo(TrafficLightInfo info);
/**
* 场景触发事件信息回调接口
*
* @param info 场景触发事件信息
*/
void showCarEventInfo(CarEventInfo info);
}

View File

@@ -1,12 +0,0 @@
package com.mogo.service.obu;
import com.mogo.service.module.IMogoModuleProvider;
import com.zhidao.smartv2x.listener.OnMessageReceiveListener;
/**
* obu事件管理器
* @author tongchenfei
*/
public interface IMogoObuManager extends IMogoModuleProvider, OnMessageReceiveListener{
void registerObuDataChangedListener(IMogoObuDataChangedListener listener);
}

View File

@@ -16,6 +16,12 @@ public interface IMogoStatusManager extends IProvider {
*/
boolean isTopViewShow();
/**
* 是否在vr模式
* @return true - 在vr模式 false - 不在vr模式
*/
boolean isVrMode();
/**
* 小智语音 UI 是否在展示
*
@@ -123,6 +129,13 @@ public interface IMogoStatusManager extends IProvider {
*/
boolean isMainPageLaunched();
/**
* 设置vrMode状态
* @param tag 业务类型
* @param vrMode true - 在vr模式 false 不在vr模式
*/
void setVrMode(String tag, boolean vrMode);
/**
* 媒体是否正在播放
* @return true - 正在播放 false - 没有播放

View File

@@ -91,5 +91,9 @@ public enum StatusDescriptor {
/**
* 媒体播放状态
*/
MEDIA_PLAYER_STATUS
MEDIA_PLAYER_STATUS,
/**
* 是否已经进入vr模式
*/
VR_MODE
}

View File

@@ -21,4 +21,10 @@ public interface IMogoRefreshStrategyController extends IProvider {
* 清除所有数据
*/
void clearAllData();
/**
* 重新设置定位点上报时间间隔
* @param delay 新的时间间隔
*/
void resetLocationUpDelay(long delay);
}

View File

@@ -0,0 +1,40 @@
package com.mogo.service.windowview;
import android.view.View;
/**
* EntranceView状态监听
*
* @author tongchenfei
*/
public interface IMogoEntranceViewListener {
/**
* 新view展示
* 只针对左侧提示LeftNotice
* @param type 展示的类型
*/
void onViewAdded(int type);
/**
* view移除
* 只针对左侧提示LeftNotice
* @param type 移除的type
*/
void onViewRemoved(int type);
/**
* view添加动画开始之前
* @param view 添加的view
* @deprecated 暂时没用
*/
@Deprecated
void beforeViewAddAnim(View view);
/**
* view 移除动画开始之前
* @param view 移除的view
* @deprecated 暂时没用
*/
@Deprecated
void beforeViewRemoveAnim(View view);
}