From 0b101d693d6b11cb02cbee081ff692f331e0bbbf Mon Sep 17 00:00:00 2001 From: kehaoyuan Date: Tue, 14 Jan 2020 15:41:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=8B=E8=BD=BD=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E5=88=B7=E6=96=B0=E6=97=B6=E9=97=AA=E7=83=81=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/gh/common/util/DownloadNotificationHelper.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/gh/common/util/DownloadNotificationHelper.kt b/app/src/main/java/com/gh/common/util/DownloadNotificationHelper.kt index 1b96193a37..d65df53a35 100644 --- a/app/src/main/java/com/gh/common/util/DownloadNotificationHelper.kt +++ b/app/src/main/java/com/gh/common/util/DownloadNotificationHelper.kt @@ -58,11 +58,13 @@ object DownloadNotificationHelper { notificationManager.createNotificationChannel(channel) } + val whenTime = 1000 * 60 * (System.currentTimeMillis() / 1000 / 60) val builder = NotificationCompat.Builder(HaloApp.getInstance().application, DOWNLOAD_CHANNEL_ID) .setContentTitle(entity.name) .setSmallIcon(R.mipmap.logo) .setContentIntent(pendingIntent) .setGroup(DOWNLOAD_GROUP_KEY) + .setWhen(whenTime) .setProgress(PROGRESS_MAX, entity.percent.toInt(), false) when (entity.status) { @@ -104,7 +106,7 @@ object DownloadNotificationHelper { } else { val time = mNotifyMap[entity.path] val curTime = System.currentTimeMillis() - if (time == null || curTime - time > 1500) { + if (time == null || curTime - time > 2000) { mNotifyMap[entity.path] = curTime notificationManager.notify(entity.path, DOWNLOAD_NOTIFICATION_ID, notification) }