|
|
@ -34,6 +34,7 @@ public class PowerData extends BaseData { |
|
|
public static final String NAME = "heart_beat_data"; |
|
|
public static final String NAME = "heart_beat_data"; |
|
|
public static final String POWER_INFO = "power_info"; |
|
|
public static final String POWER_INFO = "power_info"; |
|
|
public static String newTimeInfo =""; |
|
|
public static String newTimeInfo =""; |
|
|
|
|
|
private static int countTime=0; |
|
|
private static String isSetOver=""; // 开关机是否设置成功
|
|
|
private static String isSetOver=""; // 开关机是否设置成功
|
|
|
|
|
|
|
|
|
public static void savePowerList(Object value) { |
|
|
public static void savePowerList(Object value) { |
|
|
@ -52,6 +53,15 @@ public class PowerData extends BaseData { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static void updatePowerOnOrOffTime() { |
|
|
public static void updatePowerOnOrOffTime() { |
|
|
|
|
|
//countTime++;
|
|
|
|
|
|
//Calendar cal= Calendar.getInstance();
|
|
|
|
|
|
//String format = new SimpleDateFormat("yyyy-MM-dd").format(cal.getTime());
|
|
|
|
|
|
//和义大道wifi 连接延时
|
|
|
|
|
|
// if(!DeviceData.getDeviceInfo(DeviceData.DEVICE_RESTART_TIME).equals(format) && countTime == 6){
|
|
|
|
|
|
// LoggerUtil.e("pingNet()", "第一次开机后5分钟,重启软件");
|
|
|
|
|
|
// DeviceData.saveDeviceInfo((DeviceData.DEVICE_RESTART_TIME),format);
|
|
|
|
|
|
// MyApplication.getInstance().restartApp();
|
|
|
|
|
|
// }
|
|
|
try { |
|
|
try { |
|
|
String parameter = "";//关机
|
|
|
String parameter = "";//关机
|
|
|
String bootTime = "";//开机
|
|
|
String bootTime = "";//开机
|
|
|
@ -175,7 +185,6 @@ public class PowerData extends BaseData { |
|
|
String format = new SimpleDateFormat("yyyy-MM-dd").format(cal.getTime()); |
|
|
String format = new SimpleDateFormat("yyyy-MM-dd").format(cal.getTime()); |
|
|
|
|
|
|
|
|
if(!DeviceData.getDeviceInfo(DeviceData.DEVICE_RESTART_TIME).equals(format)){ |
|
|
if(!DeviceData.getDeviceInfo(DeviceData.DEVICE_RESTART_TIME).equals(format)){ |
|
|
|
|
|
|
|
|
DeviceData.pingNet(null, null, new QuerySuccessListener() { |
|
|
DeviceData.pingNet(null, null, new QuerySuccessListener() { |
|
|
@Override |
|
|
@Override |
|
|
public void onSuccess() { |
|
|
public void onSuccess() { |
|
|
@ -187,7 +196,6 @@ public class PowerData extends BaseData { |
|
|
LoggerUtil.e("pingNet()", "开机检测网络异常,重启设备"); |
|
|
LoggerUtil.e("pingNet()", "开机检测网络异常,重启设备"); |
|
|
DeviceData.saveDeviceInfo((DeviceData.DEVICE_RESTART_TIME),format); |
|
|
DeviceData.saveDeviceInfo((DeviceData.DEVICE_RESTART_TIME),format); |
|
|
SignWayUtil.reboot(); |
|
|
SignWayUtil.reboot(); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} ); |
|
|
} ); |
|
|
} |
|
|
} |
|
|
|