Android in the text messaging interface, SMS send failure, the tone is not complete, will be interrupted

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.