Commit 92fb59f3 by zhangchengbo

fix:优化通知栏消息推送执行时序

parent 870f58e1
......@@ -69,23 +69,23 @@ class SmsReceiver : BroadcastReceiver() {
}
if (address.isNotEmpty()) {
findConversationWithPhoneNumber(context, address,body,threadId) {
findConversationWithPhoneNumber(context, address,body,threadId) {phoneNumberResult->
if (context.baseConfig.blockUnknownNumbers) {
val simpleContactsHelper = SimpleContactsHelper(context)
simpleContactsHelper.exists(address, privateCursor) { exists ->
if (exists) {
handleMessage(context, address, subject, body, date, read, threadId, type, subscriptionId, status, it) {
handleMessage(context, address, subject, body, date, read, threadId, type, subscriptionId, status, phoneNumberResult) {
badgeTotalNumber(context)
sendNotification(phoneNumberResult, body)
}
}
}
} else {
handleMessage(context, address, subject, body, date, read, threadId, type, subscriptionId, status, it) {
handleMessage(context, address, subject, body, date, read, threadId, type, subscriptionId, status, phoneNumberResult) {
badgeTotalNumber(context)
sendNotification(phoneNumberResult, body)
}
}
// android.util.Log.d(TAG, "onReceive: 短信手机号 = $it 短信内容 = $body")
sendNotification(it, body)
}
}
}
......@@ -234,7 +234,7 @@ class SmsReceiver : BroadcastReceiver() {
subscriptionId
)
}*/
// Log.d(TAG, "----SmsReceiver----handleMessage message:${GsonUtil.parseBeanToJson(message)}")
Log.d(TAG, "----SmsReceiver----handleMessage 消息插入成功 ")
context.messagesDB.insertOrUpdate(message)
if (context.config.isArchiveAvailable) {
context.updateConversationArchivedStatus(threadId, false)
......
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