add socket status listener and remove unfitable code
This commit is contained in:
@@ -69,19 +69,6 @@ public class DebugConfig {
|
||||
|
||||
private static int sCarMachineType = CAR_MACHINE_TYPE_SELF_INNOVATE;
|
||||
|
||||
/**
|
||||
* 西迪obu
|
||||
*/
|
||||
public static final int OBU_TYPE_CIDI = 1;
|
||||
/**
|
||||
* 华砺智行obu
|
||||
*/
|
||||
public static final int OBU_TYPE_HUALI = 2;
|
||||
/**
|
||||
* 大唐高鸿obu 11.11国展
|
||||
*/
|
||||
public static final int OBU_TYPE_GOHIGH = 3;
|
||||
|
||||
/**
|
||||
* 获取网络环境类型
|
||||
*
|
||||
@@ -105,19 +92,6 @@ public class DebugConfig {
|
||||
DebugConfig.sNetMode = netMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否拉起位置服务,launcher 需要拉起位置服务,独立 app 不需要
|
||||
*/
|
||||
private static boolean sLaunchLocationService = true;
|
||||
|
||||
public static boolean isLaunchLocationService() {
|
||||
return sLaunchLocationService;
|
||||
}
|
||||
|
||||
public static void setLaunchLocationService(boolean launchLocationService) {
|
||||
DebugConfig.sLaunchLocationService = launchLocationService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置当前车机类型
|
||||
*
|
||||
@@ -149,26 +123,6 @@ public class DebugConfig {
|
||||
DebugConfig.sIsLauncher = isLauncher;
|
||||
}
|
||||
|
||||
private static boolean sRequestOnlineCarData = true;
|
||||
|
||||
public static boolean isRequestOnlineCarData() {
|
||||
return sRequestOnlineCarData;
|
||||
}
|
||||
|
||||
public static void setRequestOnlineCarData(boolean sRequestOnlineCarData) {
|
||||
DebugConfig.sRequestOnlineCarData = sRequestOnlineCarData;
|
||||
}
|
||||
|
||||
private static boolean useMockObuData;
|
||||
|
||||
public static void setUseMockObuData(boolean use) {
|
||||
useMockObuData = use;
|
||||
}
|
||||
|
||||
public static boolean isUseMockObuData() {
|
||||
return useMockObuData;
|
||||
}
|
||||
|
||||
private static String sProductFlavor;
|
||||
|
||||
public static String getProductFlavor() {
|
||||
@@ -194,56 +148,6 @@ public class DebugConfig {
|
||||
return sSocketAppId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否支持目的地导航推送策略
|
||||
*/
|
||||
private static boolean isScheduleCalculateNotHomeCompanyDistanceForPush = false;
|
||||
|
||||
public static void setScheduleCalculateNotHomeCompanyDistanceForPush(boolean isScheduleCalculateNotHomeCompanyDistanceForPush) {
|
||||
DebugConfig.isScheduleCalculateNotHomeCompanyDistanceForPush = isScheduleCalculateNotHomeCompanyDistanceForPush;
|
||||
}
|
||||
|
||||
public static boolean isIsScheduleCalculateNotHomeCompanyDistanceForPush() {
|
||||
return isScheduleCalculateNotHomeCompanyDistanceForPush;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否支持刷新桌面卡片
|
||||
*/
|
||||
private static boolean isSupportLauncherCardRefreshStrategy = false;
|
||||
|
||||
public static void setSupportLauncherCardRefreshStrategy(boolean isSupportLauncherCardRefreshStrategy) {
|
||||
DebugConfig.isSupportLauncherCardRefreshStrategy = isSupportLauncherCardRefreshStrategy;
|
||||
}
|
||||
|
||||
public static boolean isIsSupportLauncherCardRefreshStrategy() {
|
||||
return isSupportLauncherCardRefreshStrategy;
|
||||
}
|
||||
|
||||
private static int obuType = OBU_TYPE_HUALI;
|
||||
|
||||
public static int getObuType() {
|
||||
return obuType;
|
||||
}
|
||||
|
||||
public static void setObuType(int type) {
|
||||
obuType = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否需要刷新个人信息
|
||||
*/
|
||||
private static boolean needRequestUserInfo = false;
|
||||
|
||||
public static void setNeedRequestUserInfo(boolean needRequestUserInfo) {
|
||||
DebugConfig.needRequestUserInfo = needRequestUserInfo;
|
||||
}
|
||||
|
||||
public static boolean isNeedRequestUserInfo() {
|
||||
return needRequestUserInfo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 是否需要实时上报坐标位置
|
||||
*/
|
||||
@@ -257,37 +161,4 @@ public class DebugConfig {
|
||||
DebugConfig.sIsNeedUploadCoordinatesInTime = sIsNeedUploadCoordinatesInTime;
|
||||
}
|
||||
|
||||
public static boolean isOCHModule() {
|
||||
return sProductFlavor != null && sProductFlavor.startsWith("foch");
|
||||
}
|
||||
|
||||
public static int sSelfCarSpeedYOffset = 20;
|
||||
|
||||
public static void setSelfCarSpeedYOffset(int sSelfCarSpeedYOffset) {
|
||||
DebugConfig.sSelfCarSpeedYOffset = sSelfCarSpeedYOffset;
|
||||
}
|
||||
|
||||
public static int getSelfCarSpeedYOffset() {
|
||||
return sSelfCarSpeedYOffset;
|
||||
}
|
||||
|
||||
private static boolean downloadSnapshot = false;
|
||||
|
||||
public static boolean isDownloadSnapshot() {
|
||||
return downloadSnapshot;
|
||||
}
|
||||
|
||||
public static void setDownloadSnapshot(boolean downloadSnapshot) {
|
||||
DebugConfig.downloadSnapshot = downloadSnapshot;
|
||||
}
|
||||
|
||||
private static boolean isUseAdasRecognize = true;
|
||||
|
||||
public static void setUseAdasRecognize(boolean status) {
|
||||
isUseAdasRecognize = status;
|
||||
}
|
||||
|
||||
public static boolean isUseAdasRecognize() {
|
||||
return isUseAdasRecognize;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,19 @@ public interface IMogoStatusManager extends IProvider {
|
||||
*/
|
||||
boolean isMainPageLaunched();
|
||||
|
||||
/**
|
||||
* 长链是否在线
|
||||
* @return
|
||||
*/
|
||||
boolean isSocketOnLine();
|
||||
|
||||
/**
|
||||
* 设置云端 socket 状态
|
||||
* @param tag 业务类型
|
||||
* @param mode true - 在线 false 不在线
|
||||
*/
|
||||
void setCloudSocketMode(String tag, boolean mode);
|
||||
|
||||
/**
|
||||
* 设置vrMode状态
|
||||
* @param tag 业务类型
|
||||
|
||||
@@ -83,6 +83,16 @@ public class MogoStatusManager implements IMogoStatusManager {
|
||||
return get_bool_val(StatusDescriptor.MAIN_PAGE_CREATED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSocketOnLine() {
|
||||
return get_bool_val(StatusDescriptor.CLOUD_SOCKET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCloudSocketMode(String tag, boolean mode) {
|
||||
doSetStatus(tag, StatusDescriptor.CLOUD_SOCKET, mode);
|
||||
}
|
||||
|
||||
private boolean get_bool_val(StatusDescriptor descriptor) {
|
||||
Boolean val = mStatus.get(descriptor);
|
||||
return val != null && val;
|
||||
|
||||
@@ -53,5 +53,9 @@ public enum StatusDescriptor {
|
||||
*/
|
||||
VR_MODE,
|
||||
|
||||
/**
|
||||
* 云 Socket状态
|
||||
*/
|
||||
CLOUD_SOCKET
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user