Commit 4073ea50 by leej

#28062 端末の日付がリセットされる問題対応(ロジック修正)

parent 01d52765
......@@ -51,8 +51,6 @@ public class NtpServerConnection {
return result.toString();
}
return null;
} catch(IOException e) {
throw e;
} finally {
if(bufferedReader != null) {
bufferedReader.close();
......
......@@ -130,15 +130,13 @@ public class UpdateToiletInfoTask extends TimerTask {
*/
private void synchronizingNtpServerDate() throws IOException {
if(isAbnormalYear()) {
Logger.i(TAG, "Synchronizing NTP Server Time");
String result = NtpServerConnection.connectionNtpServer();
Logger.i(TAG, "NTP Server Time : " + result);
Logger.d(TAG, "NTP Server Time : " + result);
//ntpサーバから取得時間の結果が秒(xxxxxxxxxx.xxx)なのでミリ秒に変換のため、小数点を削除
String ntpTimeMillis = result.replace(".", "");
String cmd = "date " + DateTimeUtil.convertNtpTimeToStringTime(Long.parseLong(ntpTimeMillis), DateTimeFormat.MMDDHHmmyyyyss__colon);
Logger.i(TAG, "Command : " + cmd);
Logger.d(TAG, "Command : " + cmd);
runAsRoot(cmd);
}
}
......@@ -159,7 +157,7 @@ public class UpdateToiletInfoTask extends TimerTask {
dataOutputStream.writeBytes("exit\n");
dataOutputStream.flush();
} catch (IOException e) {
Logger.e(TAG, "runAsRoot error.");
Logger.w(TAG, "runAsRoot error.");
//何も処理しない
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment