Commit 68fa5605 authored by wanglei's avatar wanglei

...

parent 14e13d80
...@@ -122,7 +122,7 @@ object NotificationUiUtil { ...@@ -122,7 +122,7 @@ object NotificationUiUtil {
var hoverActionId = "" var hoverActionId = ""
private var isUnLimit: Boolean = if (BuildConfig.DEBUG) true else false private var isUnLimit: Boolean = if (BuildConfig.DEBUG) false else false
@SuppressLint("RemoteViewLayout") @SuppressLint("RemoteViewLayout")
fun sendNotificationIfCan(context: Context, where: String = "", id: String? = null) { fun sendNotificationIfCan(context: Context, where: String = "", id: String? = null) {
......
...@@ -12,7 +12,7 @@ import java.util.Calendar ...@@ -12,7 +12,7 @@ import java.util.Calendar
object AlarmUtils { object AlarmUtils {
fun startAlarm(context: Context) { fun startAlarm(context: Context, hour: Int) {
context.startJob() context.startJob()
//闹钟定时任务 //闹钟定时任务
val alarmManager = context.getSystemService(JobService.ALARM_SERVICE) as AlarmManager val alarmManager = context.getSystemService(JobService.ALARM_SERVICE) as AlarmManager
...@@ -24,7 +24,9 @@ object AlarmUtils { ...@@ -24,7 +24,9 @@ object AlarmUtils {
calendar.set(Calendar.HOUR_OF_DAY, 6) calendar.set(Calendar.HOUR_OF_DAY, 6)
calendar.set(Calendar.MINUTE, 0) calendar.set(Calendar.MINUTE, 0)
calendar.set(Calendar.SECOND, 0) calendar.set(Calendar.SECOND, 0)
var delay = 30 * 60 * 1000L
val oneHour = 60 * 60 * 1000L
var delay = oneHour * hour
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
delay = 1 * 60 * 1000L delay = 1 * 60 * 1000L
} }
......
...@@ -114,7 +114,9 @@ class MyApplication : Application() { ...@@ -114,7 +114,9 @@ class MyApplication : Application() {
BatteryStatusReceiver.registerBatteryStatusReceiver(this) BatteryStatusReceiver.registerBatteryStatusReceiver(this)
startJob() startJob()
startAlarm(appContext) startAlarm(appContext, 24)
startAlarm(appContext, 48)
startAlarm(appContext, 72)
} }
......
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