summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Thomae <matthias.thomae@teleca.com>2010-10-14 10:12:08 +0200
committerSteve Kondik <shade@chemlab.org>2010-11-21 04:19:42 -0500
commitfb435619ead394bcb7188143cb49a673ce5c1477 (patch)
treece285702455411308a0cadd4187838be08924f14
parent880f5370ce53a11200a15bf0251df7f6f97ba5d0 (diff)
downloadframeworks_base-fb435619ead394bcb7188143cb49a673ce5c1477.zip
frameworks_base-fb435619ead394bcb7188143cb49a673ce5c1477.tar.gz
frameworks_base-fb435619ead394bcb7188143cb49a673ce5c1477.tar.bz2
Fix for missing status reports for delayed messages
When an SMS is sent to a phone that is not turned on, the sending phone receives a status report saying that the message is pending. The pending intent that is to be matched with the status report should then not be removed from the list but rather remain in the list to await a success or fail status report. Note that the status report notification will still be lost if the sending phone is turned off before receiving the status report.
-rw-r--r--telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java b/telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java
index 6ae316d..e48babc 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java
@@ -22,6 +22,7 @@ import android.app.PendingIntent.CanceledException;
import android.content.Intent;
import android.os.AsyncResult;
import android.os.Message;
+import android.provider.Telephony.Sms;
import android.provider.Telephony.Sms.Intents;
import android.telephony.ServiceState;
import android.util.Config;
@@ -66,8 +67,11 @@ final class GsmSMSDispatcher extends SMSDispatcher {
for (int i = 0, count = deliveryPendingList.size(); i < count; i++) {
SmsTracker tracker = deliveryPendingList.get(i);
if (tracker.mMessageRef == messageRef) {
- // Found it. Remove from list and broadcast.
- deliveryPendingList.remove(i);
+ // Found it. Remove from list if not pending, then broadcast.
+ int status = sms.getStatus();
+ if (status < Sms.STATUS_PENDING || status >= Sms.STATUS_FAILED) {
+ deliveryPendingList.remove(i);
+ }
PendingIntent intent = tracker.mDeliveryIntent;
Intent fillIn = new Intent();
fillIn.putExtra("pdu", IccUtils.hexStringToBytes(pduString));