From eed99b5baf25e8cd28740f57a601a4dfe19c78f5 Mon Sep 17 00:00:00 2001 From: pppscn <35696959@qq.com> Date: Thu, 15 Feb 2024 22:41:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=89=8B=E6=9C=BA=E9=80=9A=E7=9F=A5=E6=A0=8F=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=A4=E6=9D=A1=E5=B8=B8=E9=A9=BB=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=20#392?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/idormy/sms/forwarder/service/ForegroundService.kt | 4 ++-- app/src/main/java/com/idormy/sms/forwarder/utils/Constants.kt | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/idormy/sms/forwarder/service/ForegroundService.kt b/app/src/main/java/com/idormy/sms/forwarder/service/ForegroundService.kt index 4ed5439b..f2682677 100644 --- a/app/src/main/java/com/idormy/sms/forwarder/service/ForegroundService.kt +++ b/app/src/main/java/com/idormy/sms/forwarder/service/ForegroundService.kt @@ -122,7 +122,7 @@ class ForegroundService : Service() { isRunning = true val notification = createNotification(SettingUtils.notifyContent) - startForeground(NOTIFICATION_ID, notification) + startForeground(FRONT_NOTIFY_ID, notification) try { //开关通知监听服务 @@ -211,7 +211,7 @@ class ForegroundService : Service() { private fun updateNotification(updatedContent: String) { try { val notification = createNotification(updatedContent) - notificationManager?.notify(NOTIFICATION_ID, notification) + notificationManager?.notify(FRONT_NOTIFY_ID, notification) } catch (e: Exception) { handleException(e, "updateNotification") } diff --git a/app/src/main/java/com/idormy/sms/forwarder/utils/Constants.kt b/app/src/main/java/com/idormy/sms/forwarder/utils/Constants.kt index 37851c5b..2d05c300 100644 --- a/app/src/main/java/com/idormy/sms/forwarder/utils/Constants.kt +++ b/app/src/main/java/com/idormy/sms/forwarder/utils/Constants.kt @@ -137,7 +137,6 @@ const val TYPE_SOCKET = 15 //前台服务 const val FRONT_NOTIFY_ID = 0x1010 -const val NOTIFICATION_ID = 101 const val FRONT_CHANNEL_ID = "com.idormy.sms.forwarder" const val FRONT_CHANNEL_NAME = "SmsForwarder Foreground Service"