Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
odakyuToiletSignage
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kddi
odakyuToiletSignage
Commits
4073ea50
Commit
4073ea50
authored
Jan 25, 2018
by
leej
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#28062 端末の日付がリセットされる問題対応(ロジック修正)
parent
01d52765
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
7 deletions
+3
-7
app/src/main/java/jp/odakyu/toiletsignage/connection/NtpServerConnection.java
+0
-2
app/src/main/java/jp/odakyu/toiletsignage/task/UpdateToiletInfoTask.java
+3
-5
No files found.
app/src/main/java/jp/odakyu/toiletsignage/connection/NtpServerConnection.java
View file @
4073ea50
...
@@ -51,8 +51,6 @@ public class NtpServerConnection {
...
@@ -51,8 +51,6 @@ public class NtpServerConnection {
return
result
.
toString
();
return
result
.
toString
();
}
}
return
null
;
return
null
;
}
catch
(
IOException
e
)
{
throw
e
;
}
finally
{
}
finally
{
if
(
bufferedReader
!=
null
)
{
if
(
bufferedReader
!=
null
)
{
bufferedReader
.
close
();
bufferedReader
.
close
();
...
...
app/src/main/java/jp/odakyu/toiletsignage/task/UpdateToiletInfoTask.java
View file @
4073ea50
...
@@ -130,15 +130,13 @@ public class UpdateToiletInfoTask extends TimerTask {
...
@@ -130,15 +130,13 @@ public class UpdateToiletInfoTask extends TimerTask {
*/
*/
private
void
synchronizingNtpServerDate
()
throws
IOException
{
private
void
synchronizingNtpServerDate
()
throws
IOException
{
if
(
isAbnormalYear
())
{
if
(
isAbnormalYear
())
{
Logger
.
i
(
TAG
,
"Synchronizing NTP Server Time"
);
String
result
=
NtpServerConnection
.
connectionNtpServer
();
String
result
=
NtpServerConnection
.
connectionNtpServer
();
Logger
.
i
(
TAG
,
"NTP Server Time : "
+
result
);
Logger
.
d
(
TAG
,
"NTP Server Time : "
+
result
);
//ntpサーバから取得時間の結果が秒(xxxxxxxxxx.xxx)なのでミリ秒に変換のため、小数点を削除
//ntpサーバから取得時間の結果が秒(xxxxxxxxxx.xxx)なのでミリ秒に変換のため、小数点を削除
String
ntpTimeMillis
=
result
.
replace
(
"."
,
""
);
String
ntpTimeMillis
=
result
.
replace
(
"."
,
""
);
String
cmd
=
"date "
+
DateTimeUtil
.
convertNtpTimeToStringTime
(
Long
.
parseLong
(
ntpTimeMillis
),
DateTimeFormat
.
MMDDHHmmyyyyss__colon
);
String
cmd
=
"date "
+
DateTimeUtil
.
convertNtpTimeToStringTime
(
Long
.
parseLong
(
ntpTimeMillis
),
DateTimeFormat
.
MMDDHHmmyyyyss__colon
);
Logger
.
i
(
TAG
,
"Command : "
+
cmd
);
Logger
.
d
(
TAG
,
"Command : "
+
cmd
);
runAsRoot
(
cmd
);
runAsRoot
(
cmd
);
}
}
}
}
...
@@ -159,7 +157,7 @@ public class UpdateToiletInfoTask extends TimerTask {
...
@@ -159,7 +157,7 @@ public class UpdateToiletInfoTask extends TimerTask {
dataOutputStream
.
writeBytes
(
"exit\n"
);
dataOutputStream
.
writeBytes
(
"exit\n"
);
dataOutputStream
.
flush
();
dataOutputStream
.
flush
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
Logger
.
e
(
TAG
,
"runAsRoot error."
);
Logger
.
w
(
TAG
,
"runAsRoot error."
);
//何も処理しない
//何も処理しない
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment