1. When an SMS arrives, the SMS is unseen status, it will pop up notification prompt user
2. However, assuming that the user is in the same contact interface, users will immediately see this SMS, the SMS will be marked as seen at a high speed, and cancel the notification, so the user will hear the bell rang and interrupted
3. Fail text message is the same principle, the beginning of this fail text message will be marked as unseen, but at the same time because in the same interface, have seen the message of this fail, so this problem will also occur.
Now the situation is that the new SMS has a feature, inference is currently in the same contact interface, no longer pops up notification, instead of a light ring, but does not pop notification. Assuming you recognize this feature, we can extend this feature to the fail message.
You see the code of MMS, there is a messagingnotification.java, one of the methods is Blockingupdatenewmessageindicator, it has a sentence:
Synchronized (Scurrentlydisplayedthreadlock) {
We can copy this phrase into Notifyfailed's method,
is in
Boolean enabled = notificationpreferenceactivity.getnotificationenabled (context);
if (!enabled) {
Return
}
After that, add
Notificationprofile notiprof = Getnotificationprofilebythreadid (context, threadId);
Synchronized (Scurrentlydisplayedthreadlock) {
LOG.D (TAG, "newmsgthreadid =" + threadId + "Scurrentlydisplayedthreadid =" + Scurrentlydisplayedthreadid);
if (threadId > 0 && threadId = = Scurrentlydisplayedthreadid) {
if (DEBUG) {
LOG.D (TAG, "blockingupdatenewmessageindicator:newmsgthreadid = =" +
"Scurrentlydisplayedthreadid so not showing notification," +
But playing soft the sound. ThreadId: "+ threadId);
}
Playinconversationnotificationsound (context, notiprof);
Return
}
}
At the same time,
In Messagingnotification.java, the ThreadID that notifysendfailed () is passed to notifyfailed () is always 0. So please check to see if this has changed to a way to get ThreadID:
The function messagefailedtosend () Smsreceiverservice.java in MMS code is added long threadId = Messagingnotification.getsmsthreadid ( this, URI); get the right threadid. Then call notifysendfailed (), you may need to modify notifysendfailed () This method or a new definition of a method.
Android in the text messaging interface, SMS send failure, the tone is not complete, will be interrupted