|
@@ -57,7 +57,6 @@ import org.greenrobot.eventbus.EventBus
|
|
|
import org.greenrobot.eventbus.Subscribe
|
|
|
import org.greenrobot.eventbus.ThreadMode
|
|
|
import serialporttest.utils.SerialPortUtil
|
|
|
-import xcrash.TombstoneManager
|
|
|
import java.util.*
|
|
|
import java.util.UUID
|
|
|
import kotlin.collections.ArrayList
|
|
@@ -129,11 +128,8 @@ class MainActivity :BaseActivity<MainActivityPresenter, MainActivityLayoutBindin
|
|
|
// 添加登录回调
|
|
|
SocketManager.getInstance().addUserStateCallback(this)
|
|
|
|
|
|
- if (Build.MODEL.equals("rk3128")) {
|
|
|
- //串口监听
|
|
|
- setSerialListner()
|
|
|
- }
|
|
|
-
|
|
|
+ //串口监听
|
|
|
+ setSerialListner()
|
|
|
SerialPortHelper.sipRegState("2")
|
|
|
|
|
|
//更新状态图标
|
|
@@ -149,10 +145,6 @@ class MainActivity :BaseActivity<MainActivityPresenter, MainActivityLayoutBindin
|
|
|
tv_mac_addr.setText("MAC: " + Constant.LOCAL_MAC + "\nIP: " + NetHelper.getInstance().localIP + ", server: " + serverIp)
|
|
|
tv_version.setText("V" + BuildConfig.VERSION_NAME + "_" + BuildConfig.VERSION_CODE)
|
|
|
|
|
|
- if (TombstoneManager.getAllTombstones() != null) {
|
|
|
- tv_crash.setText("crash日志: " + TombstoneManager.getAllTombstones().size)
|
|
|
- }
|
|
|
-
|
|
|
//initCallTimer()
|
|
|
}
|
|
|
|
|
@@ -994,6 +986,13 @@ class MainActivity :BaseActivity<MainActivityPresenter, MainActivityLayoutBindin
|
|
|
}
|
|
|
} else if (tcpModel.action == TcpAction.DeviceAction.DEVICE_REFRESH) {
|
|
|
initDevice()
|
|
|
+ } else if (tcpModel.action == TcpAction.DeviceAction.RESTART) {
|
|
|
+ //收到重启app指令,若当前处于正常待机状态则直接重启app,否则等待通话结束再重启
|
|
|
+ if (Constant.CALL_STATE == Constant.CALL_STANDBY) {
|
|
|
+ AppUpdateHelper.restartApp(activity)
|
|
|
+ } else {
|
|
|
+ Constant.LATER_RESTART = true
|
|
|
+ }
|
|
|
}
|
|
|
} else if (tcpModel.action == TcpAction.DataAction.REFRESH) {
|
|
|
//重新加载数据,比如出院,入院等
|
|
@@ -1260,7 +1259,11 @@ class MainActivity :BaseActivity<MainActivityPresenter, MainActivityLayoutBindin
|
|
|
} else {
|
|
|
view_title_layout_tv_point.setBackgroundResource(R.color.red_color)
|
|
|
}
|
|
|
- } else {
|
|
|
+
|
|
|
+ if (Constant.LATER_RESTART && Constant.CALL_STATE == Constant.CALL_STANDBY) {
|
|
|
+ AppUpdateHelper.restartApp(activity)
|
|
|
+ }
|
|
|
+ } else if (TextUtils.isEmpty(Constant.TCP_SERVER_URL)) {
|
|
|
presenter.loadTcpServerHost()
|
|
|
}
|
|
|
} else if (intent.action == ConnectivityManager.CONNECTIVITY_ACTION) {
|