|
@@ -177,8 +177,9 @@ public class TrusteeshipFragment extends BaseFragment implements TrusteeshipAdap
|
|
AnalysisUdpUtil.isOpen = true;
|
|
AnalysisUdpUtil.isOpen = true;
|
|
// serialPortUtil.closeSerialPort();
|
|
// serialPortUtil.closeSerialPort();
|
|
tvNurseHostNoeds.setText(TrustToastTextUtil.setTrusting(getActivity(), SharedPreferencesUtil.getStringSp(getActivity(), INITTRUST, "trust")));
|
|
tvNurseHostNoeds.setText(TrustToastTextUtil.setTrusting(getActivity(), SharedPreferencesUtil.getStringSp(getActivity(), INITTRUST, "trust")));
|
|
- } else
|
|
|
|
|
|
+ } else {
|
|
showTrust("1");//正常状态
|
|
showTrust("1");//正常状态
|
|
|
|
+ }
|
|
return mView;
|
|
return mView;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -505,7 +506,7 @@ public class TrusteeshipFragment extends BaseFragment implements TrusteeshipAdap
|
|
|
|
|
|
|
|
|
|
if (mCountDownAutoTimerInterrupt == null) {
|
|
if (mCountDownAutoTimerInterrupt == null) {
|
|
- mCountDownAutoTimerInterrupt = new CountDownTimer(10000, 1000) {
|
|
|
|
|
|
+ mCountDownAutoTimerInterrupt = new CountDownTimer(3000, 1000) {
|
|
@Override
|
|
@Override
|
|
public void onTick(long l) {
|
|
public void onTick(long l) {
|
|
// tvStatus.setText("托管状态:取消中" + l / 1000);
|
|
// tvStatus.setText("托管状态:取消中" + l / 1000);
|
|
@@ -520,7 +521,7 @@ public class TrusteeshipFragment extends BaseFragment implements TrusteeshipAdap
|
|
// tvQuestTp.setText("托管状态:取消不成功,被托管设备未连接网络");
|
|
// tvQuestTp.setText("托管状态:取消不成功,被托管设备未连接网络");
|
|
mCountDownAutoTimerInterrupt = null;
|
|
mCountDownAutoTimerInterrupt = null;
|
|
EventBus.getDefault().post(new MessageEvent(TRUST_FLAG_VALUE, Constants.EVENT_FRAGMENT_TRUST));
|
|
EventBus.getDefault().post(new MessageEvent(TRUST_FLAG_VALUE, Constants.EVENT_FRAGMENT_TRUST));
|
|
- AutoRebootUtil.reboot();
|
|
|
|
|
|
+ //AutoRebootUtil.reboot();
|
|
}
|
|
}
|
|
};
|
|
};
|
|
}
|
|
}
|
|
@@ -571,7 +572,7 @@ public class TrusteeshipFragment extends BaseFragment implements TrusteeshipAdap
|
|
*/
|
|
*/
|
|
private void autoRestart(final String content) {
|
|
private void autoRestart(final String content) {
|
|
if (mAutoRestartTimer == null) {//
|
|
if (mAutoRestartTimer == null) {//
|
|
- mAutoRestartTimer = new CountDownTimer(10000, 1000) {
|
|
|
|
|
|
+ mAutoRestartTimer = new CountDownTimer(3000, 1000) {
|
|
@Override
|
|
@Override
|
|
public void onTick(long l) {
|
|
public void onTick(long l) {
|
|
tvStatus.setText(content + l / 1000 + "秒");
|
|
tvStatus.setText(content + l / 1000 + "秒");
|
|
@@ -702,11 +703,11 @@ public class TrusteeshipFragment extends BaseFragment implements TrusteeshipAdap
|
|
mToastH.postDelayed(auto, 50);
|
|
mToastH.postDelayed(auto, 50);
|
|
|
|
|
|
// LogUtil.d("SSS", "本机收到原主机设备撤销托管要求" + "开启取消托管任务:自动重启倒计时:11111111111111");
|
|
// LogUtil.d("SSS", "本机收到原主机设备撤销托管要求" + "开启取消托管任务:自动重启倒计时:11111111111111");
|
|
- break;
|
|
|
|
}
|
|
}
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
- //if (!initdataentity.getId().equals((mUdpEntityInfo).getDoorwayMachineID()))//
|
|
|
|
- // break;
|
|
|
|
|
|
+ if (!initdataentity.getId().equals((mUdpEntityInfo).getDoorwayMachineID()))//
|
|
|
|
+ break;
|
|
LogUtil.d("托管", "主机二:接收主机一的取消托管请求");
|
|
LogUtil.d("托管", "主机二:接收主机一的取消托管请求");
|
|
showTrust("1");
|
|
showTrust("1");
|
|
LogUtil.d("托管", "跳过");
|
|
LogUtil.d("托管", "跳过");
|
|
@@ -769,7 +770,7 @@ public class TrusteeshipFragment extends BaseFragment implements TrusteeshipAdap
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (mCountDownCancleTimer == null) {//开启恢复取消功能倒计时
|
|
if (mCountDownCancleTimer == null) {//开启恢复取消功能倒计时
|
|
- mCountDownCancleTimer = new CountDownTimer(10000, 1000) {
|
|
|
|
|
|
+ mCountDownCancleTimer = new CountDownTimer(3000, 1000) {
|
|
@Override
|
|
@Override
|
|
public void onTick(long l) {
|
|
public void onTick(long l) {
|
|
tvStatus.setText("托管状态:" + "本机已完成:托管请求" + "取消功能恢复倒计时:" + l / 1000 + "秒");
|
|
tvStatus.setText("托管状态:" + "本机已完成:托管请求" + "取消功能恢复倒计时:" + l / 1000 + "秒");
|
|
@@ -903,18 +904,6 @@ public class TrusteeshipFragment extends BaseFragment implements TrusteeshipAdap
|
|
mCountDownCancleTimer = null;
|
|
mCountDownCancleTimer = null;
|
|
}
|
|
}
|
|
|
|
|
|
- //reboot device
|
|
|
|
- Runnable auto = new Runnable() {
|
|
|
|
- @Override
|
|
|
|
- public void run() {
|
|
|
|
- autoRestart("本机收到原主机设备撤销托管要求" + "开启取消托管任务:自动重启倒计时:");
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
- if (mToastH == null) {
|
|
|
|
- mToastH = new Handler();
|
|
|
|
- }
|
|
|
|
- mToastH.postDelayed(auto, 50);
|
|
|
|
-
|
|
|
|
} else {
|
|
} else {
|
|
if (jsonObj.getString("Code").equals("OK!")) {
|
|
if (jsonObj.getString("Code").equals("OK!")) {
|
|
// String data = jsonObj.getString("hostList");//
|
|
// String data = jsonObj.getString("hostList");//
|
|
@@ -938,6 +927,17 @@ public class TrusteeshipFragment extends BaseFragment implements TrusteeshipAdap
|
|
Log.w("Code", "网络错误");
|
|
Log.w("Code", "网络错误");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /*Runnable auto = new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ autoRestart("自动重启倒计时:");
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ if (mToastH == null) {
|
|
|
|
+ mToastH = new Handler();
|
|
|
|
+ }
|
|
|
|
+ mToastH.postDelayed(auto, 50);*/
|
|
} catch (JSONException e) {
|
|
} catch (JSONException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|