Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
huangzhicong
/
SmartCanteen
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
53ec2317
authored
Jun 03, 2020
by
pye52
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加定时重启设备的功能
parent
3d0ce647
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
14 deletions
+2
-14
app/src/main/java/com/bgycc/smartcanteen/utils/MonitorUtils.java
+2
-14
No files found.
app/src/main/java/com/bgycc/smartcanteen/utils/MonitorUtils.java
View file @
53ec2317
...
...
@@ -32,17 +32,15 @@ public class MonitorUtils {
public
static
void
startMonitors
(
Context
context
)
{
startLogFilesMonitor
(
context
);
startDatabaseMonitor
(
context
);
startRebootMonitor
(
context
);
}
public
static
void
stopMonitors
(
Context
context
)
{
stopLogFilesMonitor
(
context
);
stopDatabaseMonitor
(
context
);
stopRebootMonitor
(
context
);
}
// 指定时间重启设备
p
rivate
static
void
startRebootMonitor
(
Context
context
)
{
p
ublic
static
void
startRebootMonitor
(
Context
context
)
{
stopRebootMonitor
(
context
);
Calendar
now
=
Calendar
.
getInstance
(
Locale
.
getDefault
());
Calendar
future
=
Calendar
.
getInstance
(
Locale
.
getDefault
());
...
...
@@ -61,21 +59,11 @@ public class MonitorUtils {
}
// 指定时间重启设备
p
rivate
static
void
stopRebootMonitor
(
Context
context
)
{
p
ublic
static
void
stopRebootMonitor
(
Context
context
)
{
WorkManager
.
getInstance
(
context
)
.
cancelUniqueWork
(
REBOOT_MONITOR_WORKER
);
}
public
static
void
startMonitors
(
Context
context
)
{
startLogFilesMonitor
(
context
);
startDatabaseMonitor
(
context
);
}
public
static
void
stopMonitors
(
Context
context
)
{
stopLogFilesMonitor
(
context
);
stopDatabaseMonitor
(
context
);
}
// 每隔一定时间检查日志文件夹并进行清理
private
static
void
startLogFilesMonitor
(
Context
context
)
{
stopLogFilesMonitor
(
context
);
...
...
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