|
|
|
@ -34,6 +34,7 @@ public class PowerData extends BaseData { |
|
|
|
public static final String NAME = "heart_beat_data"; |
|
|
|
public static final String POWER_INFO = "power_info"; |
|
|
|
public static String newTimeInfo =""; |
|
|
|
private static String isSetOver=""; // 开关机是否设置成功
|
|
|
|
|
|
|
|
public static void savePowerList(Object value) { |
|
|
|
saveDataJson(NAME, POWER_INFO, new Gson().toJson(value)); |
|
|
|
@ -137,18 +138,34 @@ public class PowerData extends BaseData { |
|
|
|
} |
|
|
|
|
|
|
|
String dataJson = getDataJson(NAME, POWER_INFO, "{}"); |
|
|
|
|
|
|
|
if(newTimeInfo.equals(dataJson)){ |
|
|
|
if(Constant.androidBoardType.equals("ys")){ |
|
|
|
if(Constant.androidBoardType.equals("ys") && "".equals(isSetOver)){ // 亿盛有时候设置开机时间不成功
|
|
|
|
MyManager manager = MyManager.getInstance(MyApplication.getInstance()); |
|
|
|
boolean isset = manager.isSetPowerOnTime(); |
|
|
|
if(!isset){ |
|
|
|
LoggerUtil.e("开机时间设置:",String.valueOf(isset)); |
|
|
|
newTimeInfo = ""; |
|
|
|
String onTime = manager.getPowerOnTime(); |
|
|
|
long currentLong = System.currentTimeMillis();//当前时间
|
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); |
|
|
|
String setTime = StringUtil.strSplice(dateFormat.format(currentLong), bootTime.replace(":","")); |
|
|
|
String setTime2 = StringUtil.strSplice(dateFormat.format(currentLong+24*60*60*1000), bootTime.replace(":","")); |
|
|
|
|
|
|
|
String s = TimeUtil.stampToDate(currentLong); |
|
|
|
long parameterLong = TimeUtil.pareTLong2(s + " " + parameter);//关机时间
|
|
|
|
long bootLong = TimeUtil.pareTLong2(s + " " + bootTime);//开机时间
|
|
|
|
if(parameterLong>bootLong && onTime.equals(setTime2)){ |
|
|
|
LoggerUtil.e("设置2开机时间:", onTime); |
|
|
|
isSetOver = "over"; |
|
|
|
}else if(parameterLong<bootLong && onTime.equals(setTime)){ |
|
|
|
LoggerUtil.e("设置1开机时间:", onTime); |
|
|
|
isSetOver = "over"; |
|
|
|
}else{ |
|
|
|
newTimeInfo=""; |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
}else{ |
|
|
|
isSetOver = ""; |
|
|
|
} |
|
|
|
LoggerUtil.e("PowerData","定时开关机不同"); |
|
|
|
LoggerUtil.e("设置开关机时间:", dataJson); |
|
|
|
newTimeInfo=dataJson; |
|
|
|
|
|
|
|
//天津K11亿晟3288重启2次设备避免黑屏
|
|
|
|
|