非自动驾驶模式打开检测任务,测试数据,后续根据产品需求做修改
This commit is contained in:
@@ -36,7 +36,7 @@ public class NetworkStatusUtil {
|
||||
NetworkInfo info = connectivityManager.getActiveNetworkInfo();
|
||||
if (info != null && info.isAvailable()) {
|
||||
String netWorkStatus = CommonUtils.getNetworkType(context);
|
||||
|
||||
netWorkStatus1.status = netWorkStatus;
|
||||
switch (info.getType()) {
|
||||
case ConnectivityManager.TYPE_WIFI:
|
||||
//wifi
|
||||
@@ -48,7 +48,6 @@ public class NetworkStatusUtil {
|
||||
} else {
|
||||
Log.e("CheckActivity", "getNetWorkInfo: 信号强度弱");
|
||||
}
|
||||
netWorkStatus1.status = "WiFi";
|
||||
netWorkStatus1.mSignalStrength = mSignalStrength;
|
||||
return netWorkStatus1;
|
||||
case ConnectivityManager.TYPE_MOBILE:
|
||||
@@ -88,15 +87,12 @@ public class NetworkStatusUtil {
|
||||
}
|
||||
mSignalStrength = signal.getGsmSignalStrength();
|
||||
}
|
||||
netWorkStatus1.status = "移动网络";
|
||||
netWorkStatus1.mSignalStrength = mSignalStrength;
|
||||
return netWorkStatus1;
|
||||
}
|
||||
} else {
|
||||
netWorkStatus1.status = "UNKNOWN";
|
||||
return netWorkStatus1;
|
||||
}
|
||||
netWorkStatus1.status = "UNKNOWN";
|
||||
return netWorkStatus1;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ public class CheckProvider implements ICheckProvider {
|
||||
|
||||
@Override
|
||||
public void checkMonitor(Context context) {
|
||||
if (context != null){
|
||||
if (context != null) {
|
||||
CheckActivity.checkMonitor();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ import com.mogo.module.check.R;
|
||||
import com.mogo.module.check.model.CheckItemInfo;
|
||||
import com.mogo.module.common.view.ImageViewClipBounds;
|
||||
import com.mogo.module.common.view.SpacesItemDecoration;
|
||||
import com.mogo.utils.AssetsUtils;
|
||||
import com.mogo.utils.CommonUtils;
|
||||
import com.mogo.utils.network.utils.NetworkStatusUtil;
|
||||
import com.tencent.bugly.beta.Beta;
|
||||
@@ -44,11 +43,11 @@ public class CheckActivity extends AppCompatActivity {
|
||||
|
||||
private static final String TAG = "CheckActivity";
|
||||
private RecyclerView mRecyclerView;
|
||||
private ArrayList dataArrayList = new ArrayList();
|
||||
private Context context;
|
||||
private static ArrayList dataArrayList = new ArrayList();
|
||||
private static Context context;
|
||||
private static NetworkStatusUtil.NetWorkStatus sNetWorkStatus;
|
||||
private ImageView mImageView;
|
||||
private String packageName = "com.mogo.launcher.f";
|
||||
private static String packageName = "com.mogo.launcher.f";
|
||||
//车模
|
||||
private ImageView scanBottomCarImage;
|
||||
//扫描束
|
||||
@@ -115,13 +114,23 @@ public class CheckActivity extends AppCompatActivity {
|
||||
* 自动驾驶状态下指标监测
|
||||
*/
|
||||
public static void checkMonitor() {
|
||||
|
||||
Log.d(TAG,"checkMonitor");
|
||||
//版本检测
|
||||
versionCheckResult();
|
||||
//系统检测
|
||||
systemCheckResult();
|
||||
//软件检测
|
||||
software();
|
||||
//硬件检测
|
||||
hardware();
|
||||
//根据以上4个结果插入第一个元素(自动驾驶车辆是否存在风险)
|
||||
topListTitle();
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶是否存在风险
|
||||
*/
|
||||
private void topListTitle() {
|
||||
private static void topListTitle() {
|
||||
ArrayList list = new ArrayList(1);
|
||||
CheckItemInfo info = new CheckItemInfo();
|
||||
info.setUsual(false);
|
||||
@@ -237,7 +246,7 @@ public class CheckActivity extends AppCompatActivity {
|
||||
/**
|
||||
* **************************************************************************************版本检测
|
||||
*/
|
||||
public void versionCheckResult() {
|
||||
public static void versionCheckResult() {
|
||||
ArrayList arrayVer = new ArrayList();
|
||||
//adas 检测指标
|
||||
|
||||
@@ -276,7 +285,7 @@ public class CheckActivity extends AppCompatActivity {
|
||||
/**
|
||||
* **************************************************************************************系统检测
|
||||
*/
|
||||
public void systemCheckResult() {
|
||||
public static void systemCheckResult() {
|
||||
ArrayList arrSys = new ArrayList();
|
||||
//网络
|
||||
netStatus();
|
||||
@@ -335,12 +344,12 @@ public class CheckActivity extends AppCompatActivity {
|
||||
/**
|
||||
* 网络
|
||||
*/
|
||||
public NetworkStatusUtil.NetWorkStatus netStatus() {
|
||||
public static NetworkStatusUtil.NetWorkStatus netStatus() {
|
||||
//网络类型
|
||||
String networkType = CommonUtils.getNetworkType(context);
|
||||
sNetWorkStatus = NetworkStatusUtil.networkState(context);
|
||||
//网络强度
|
||||
if (sNetWorkStatus.getStatus() != "UNKNOWN") {
|
||||
Log.d(TAG, "网络类型:" + networkType + "网络强度:" + sNetWorkStatus.getSignalStrength());
|
||||
if (sNetWorkStatus.getStatus() != null && sNetWorkStatus.getStatus() != "UNKNOWN") {
|
||||
Log.d(TAG, "网络类型:" + sNetWorkStatus.getStatus() + "网络强度:" + sNetWorkStatus.getSignalStrength());
|
||||
if (sNetWorkStatus.getSignalStrength() <= -90) {
|
||||
AIAssist.getInstance(context).speakTTSVoice("网络信号差");
|
||||
}
|
||||
@@ -395,7 +404,7 @@ public class CheckActivity extends AppCompatActivity {
|
||||
* <p>
|
||||
* 时延 工控机->云 工控机->鹰眼 什么数据的时延
|
||||
*/
|
||||
public void software() {
|
||||
public static void software() {
|
||||
ArrayList arrSoftware = new ArrayList();
|
||||
CheckItemInfo itemInfo = new CheckItemInfo();
|
||||
itemInfo.setViewTitle("软件检测:");
|
||||
@@ -418,7 +427,7 @@ public class CheckActivity extends AppCompatActivity {
|
||||
* 时延
|
||||
* 需要产品确认哪些指标? 定位+周边识别?
|
||||
*/
|
||||
public long time() {
|
||||
public static long time() {
|
||||
|
||||
final long start = System.nanoTime();
|
||||
long adasDataTime = TimeUnit.NANOSECONDS.toMillis((System.nanoTime() - start));
|
||||
@@ -446,7 +455,7 @@ public class CheckActivity extends AppCompatActivity {
|
||||
* <p>
|
||||
* 9、路由器
|
||||
*/
|
||||
public void hardware() {
|
||||
public static void hardware() {
|
||||
ArrayList arrHardware = new ArrayList();
|
||||
CheckItemInfo itemInfo = new CheckItemInfo();
|
||||
itemInfo.setViewTitle("硬件检测:");
|
||||
@@ -556,4 +565,9 @@ public class CheckActivity extends AppCompatActivity {
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@ public class VehicleMonitoring implements Handler.Callback {
|
||||
private final Handler mHandler = new Handler(this);
|
||||
//自动驾驶状态下10分钟间隔弹框提示一次
|
||||
private static final long AUTO_CHECK_STATUS_DELAY = 10 * 60 * 1000;//自动驾驶状态下10分钟弹框提示一次
|
||||
//非自动驾驶测试数据 后期根据需求做修改 1分钟间隔
|
||||
private static final long MANUAL_CHECK_STATUS_DELAY = 1 * 60 * 1000;
|
||||
//非自动驾驶测试数据 后期根据需求做修改 2min
|
||||
private static final long MANUAL_CHECK_STATUS_DELAY = 2 * 60 * 1000;
|
||||
//自动驾驶状态
|
||||
private static int AutopilotStatus = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getAutopilotStatus();
|
||||
|
||||
@@ -31,7 +31,6 @@ public class VehicleMonitoring implements Handler.Callback {
|
||||
}
|
||||
|
||||
public void vehicleCheck() {
|
||||
Log.d(TAG, "vehicleCheck");
|
||||
if (AutopilotStatus == IMogoAdasOCHCallback.STATUS_AUTOPILOT_RUNNING) {
|
||||
Log.d(TAG, "自动驾驶中...");
|
||||
mHandler.sendEmptyMessageDelayed(AutopilotStatus, AUTO_CHECK_STATUS_DELAY);
|
||||
@@ -40,7 +39,6 @@ public class VehicleMonitoring implements Handler.Callback {
|
||||
//非自动驾驶状态只展示一次
|
||||
mHandler.sendEmptyMessageDelayed(AutopilotStatus, MANUAL_CHECK_STATUS_DELAY);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -54,6 +52,7 @@ public class VehicleMonitoring implements Handler.Callback {
|
||||
case IMogoAdasOCHCallback.STATUS_AUTOPILOT_DISABLE:
|
||||
case IMogoAdasOCHCallback.STATUS_AUTOPILOT_ENABLE:
|
||||
vehicleMonitor();
|
||||
mHandler.sendEmptyMessageDelayed(AutopilotStatus, MANUAL_CHECK_STATUS_DELAY);
|
||||
return true;
|
||||
default:
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user