Commit 377c5368 authored by wanglei's avatar wanglei

...

parent fbfdfe55
...@@ -26,7 +26,7 @@ object AlarmUtils { ...@@ -26,7 +26,7 @@ object AlarmUtils {
calendar.set(Calendar.SECOND, 0) calendar.set(Calendar.SECOND, 0)
var delay = 1800000L var delay = 1800000L
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
delay = 5000L delay = 1800000L
} }
alarmManager.setRepeating( alarmManager.setRepeating(
AlarmManager.RTC_WAKEUP, calendar.timeInMillis, delay, pendingIntent AlarmManager.RTC_WAKEUP, calendar.timeInMillis, delay, pendingIntent
......
...@@ -98,7 +98,7 @@ class StayJobService : JobService() { ...@@ -98,7 +98,7 @@ class StayJobService : JobService() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val channel = val channel =
NotificationChannel(channelId, channelName, NotificationManager.IMPORTANCE_HIGH) NotificationChannel(channelId, channelName, NotificationManager.IMPORTANCE_LOW)
channel.lockscreenVisibility = 1 channel.lockscreenVisibility = 1
val notificationManager = val notificationManager =
context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
...@@ -132,12 +132,12 @@ class StayJobService : JobService() { ...@@ -132,12 +132,12 @@ class StayJobService : JobService() {
} }
private fun notifyForeground() { private fun notifyForeground() {
LogEx.logDebug(TAG, "notifyForeground")
val notificationManager = val notificationManager =
getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
notificationManager.notify( notificationManager.notify(
NOTIFICATION_PERMANENT_ID, NOTIFICATION_PERMANENT_ID, createPermanentNotification(applicationContext)
createPermanentNotification(applicationContext)
) )
} }
......
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