mirror of
https://github.com/pppscn/SmsForwarder
synced 2025-08-02 17:07:41 +08:00
优化:自动消除全部通知(临时方案)
This commit is contained in:
parent
fefa4b0ab3
commit
abb514df8c
@ -105,6 +105,14 @@ class NotifyService : NotificationListenerService()/*, LifecycleOwner*/ {
|
||||
}
|
||||
}
|
||||
}*/
|
||||
//自动消除全部通知(临时方案)
|
||||
if (SettingUtils.enableCancelAppNotify) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
cancelNotification(sbn.key)
|
||||
} else {
|
||||
cancelNotification(sbn.packageName, sbn.tag, sbn.id)
|
||||
}
|
||||
}
|
||||
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Parsing Notification failed: " + e.message.toString())
|
||||
|
@ -30,7 +30,7 @@ class SendWorker(
|
||||
val msgInfoJson = inputData.getString(Worker.sendMsgInfo)
|
||||
val msgInfo = Gson().fromJson(msgInfoJson, MsgInfo::class.java)
|
||||
|
||||
//TODO:过滤重复消息机制
|
||||
// 过滤重复消息机制
|
||||
if (SettingUtils.duplicateMessagesLimits > 0) {
|
||||
val key = CipherUtils.md5(msgInfo.type + msgInfo.from + msgInfo.content)
|
||||
val timestamp: Long = System.currentTimeMillis() / 1000L
|
||||
|
Loading…
x
Reference in New Issue
Block a user