mirror of
https://github.com/pppscn/SmsForwarder
synced 2025-08-03 17:37:40 +08:00
优化:部分手机通知栏异常显示两条常驻通知 #392
This commit is contained in:
parent
a27da6b1d3
commit
eed99b5baf
@ -122,7 +122,7 @@ class ForegroundService : Service() {
|
|||||||
isRunning = true
|
isRunning = true
|
||||||
|
|
||||||
val notification = createNotification(SettingUtils.notifyContent)
|
val notification = createNotification(SettingUtils.notifyContent)
|
||||||
startForeground(NOTIFICATION_ID, notification)
|
startForeground(FRONT_NOTIFY_ID, notification)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
//开关通知监听服务
|
//开关通知监听服务
|
||||||
@ -211,7 +211,7 @@ class ForegroundService : Service() {
|
|||||||
private fun updateNotification(updatedContent: String) {
|
private fun updateNotification(updatedContent: String) {
|
||||||
try {
|
try {
|
||||||
val notification = createNotification(updatedContent)
|
val notification = createNotification(updatedContent)
|
||||||
notificationManager?.notify(NOTIFICATION_ID, notification)
|
notificationManager?.notify(FRONT_NOTIFY_ID, notification)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
handleException(e, "updateNotification")
|
handleException(e, "updateNotification")
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,6 @@ const val TYPE_SOCKET = 15
|
|||||||
|
|
||||||
//前台服务
|
//前台服务
|
||||||
const val FRONT_NOTIFY_ID = 0x1010
|
const val FRONT_NOTIFY_ID = 0x1010
|
||||||
const val NOTIFICATION_ID = 101
|
|
||||||
const val FRONT_CHANNEL_ID = "com.idormy.sms.forwarder"
|
const val FRONT_CHANNEL_ID = "com.idormy.sms.forwarder"
|
||||||
const val FRONT_CHANNEL_NAME = "SmsForwarder Foreground Service"
|
const val FRONT_CHANNEL_NAME = "SmsForwarder Foreground Service"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user