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.