Commit 519449b0 authored by leichao.gao's avatar leichao.gao

update

parent aab0ce8c
...@@ -199,7 +199,6 @@ object NotificationUtil { ...@@ -199,7 +199,6 @@ object NotificationUtil {
} else { } else {
notificationManager.notify(actionId, builder.build()) notificationManager.notify(actionId, builder.build())
} }
incrementNotification()
AppPreferences.getInstance().put("last_notification_time", System.currentTimeMillis()) AppPreferences.getInstance().put("last_notification_time", System.currentTimeMillis())
} }
...@@ -241,6 +240,7 @@ object NotificationUtil { ...@@ -241,6 +240,7 @@ object NotificationUtil {
} }
sendNotification(context, actionId) sendNotification(context, actionId)
incrementNotification()
val open: Int = AppPreferences.getInstance().getString("open", "0").toIntOrNull() ?: 0 val open: Int = AppPreferences.getInstance().getString("open", "0").toIntOrNull() ?: 0
...@@ -249,10 +249,10 @@ object NotificationUtil { ...@@ -249,10 +249,10 @@ object NotificationUtil {
val delay: Long = val delay: Long =
AppPreferences.getInstance().getString("delay", "0").toLongOrNull() ?: 0L AppPreferences.getInstance().getString("delay", "0").toLongOrNull() ?: 0L
handlerThread = HandlerThread("NotificationHandlerThread") handlerThread = HandlerThread("NotificationHandlerThread")
handlerThread!!.start() handlerThread?.start()
// 创建 Handler // 创建 Handler
handler = Handler(handlerThread!!.looper) handler = handlerThread?.looper?.let { Handler(it) }
for (i in 1..num) { for (i in 1..num) {
val time = i * delay val time = i * delay
handler?.postDelayed(Runnable { handler?.postDelayed(Runnable {
......
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