On the SMS sending page of android, when the SMS fails to be sent, the prompt sound is incomplete and will be interrupted.

Source: Internet
Author: User

On the SMS sending page of android, when the SMS fails to be sent, the prompt sound is incomplete and will be interrupted.
1. When an SMS arrives, it is in the unseen status, and a Notification will pop up prompting the user
2. however, if you are in the same contact interface, the user will immediately see this SMS. At this time, this SMS will be quickly marked as seen and the Notification will be canceled, so the user will hear the bell ring and interrupt again.
3. fail's text message works in the same way. At first, the fail text message is marked as unseen, but the Fail message is displayed on the same interface, this problem also occurs.
The current situation is that the new SMS has a feature. When it is determined that it is in the same contact interface, the Notification will not pop up, instead it will ring softly, but the Notification will not pop up. if you accept this feature, we can extend this feature to the fail information.
The Mms code contains MessagingNotification. java. One of the methods is blockingUpdateNewMessageIndicator, which contains the following sentence:
Synchronized (sCurrentlyDisplayedThreadLock ){
We can copy this section to the policyfailed method,
That is, in
Boolean enabled = icationicationpreferenceactivity. getNotificationEnabled (context );
If (! Enabled ){
Return;
}
Then, add
Icationicationprofile 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 sound. threadId:" + threadId );
}
PlayInConversationNotificationSound (context, notiProf );
Return;
}
}
At the same time,
In MessagingNotification. java, because the threadId passed by policysendfailed () to policyfailed () is always 0, please check whether it has changed to the threadId method:
SmsReceiverService in Mms code. java function messageFailedToSend () and add long threadId = MessagingNotification. getSmsThreadId (this, uri); gets the correct threadId and calls yysendfailed (). You may need to modify yysendfailed () or define a new method.

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.