Skip to content

Commit 2703b84

Browse files
Jean-Baptiste QueruAndroid Code Review
authored andcommitted
Merge "Fix delivery report error with PENDING status in SMS" into gingerbread
2 parents 049b172 + c5996b9 commit 2703b84

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

core/java/android/provider/Telephony.java

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ public interface TextBasedSmsColumns {
114114

115115
public static final int STATUS_NONE = -1;
116116
public static final int STATUS_COMPLETE = 0;
117-
public static final int STATUS_PENDING = 64;
118-
public static final int STATUS_FAILED = 128;
117+
public static final int STATUS_PENDING = 32;
118+
public static final int STATUS_FAILED = 64;
119119

120120
/**
121121
* The subject of the message, if present

telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java

100644100755
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import android.content.Intent;
2323
import android.os.AsyncResult;
2424
import android.os.Message;
25+
import android.provider.Telephony.Sms;
2526
import android.provider.Telephony.Sms.Intents;
2627
import android.telephony.ServiceState;
2728
import android.util.Config;
@@ -60,13 +61,17 @@ protected void handleStatusReport(AsyncResult ar) {
6061
String pduString = (String) ar.result;
6162
SmsMessage sms = SmsMessage.newFromCDS(pduString);
6263

64+
int tpStatus = sms.getStatus();
65+
6366
if (sms != null) {
6467
int messageRef = sms.messageRef;
6568
for (int i = 0, count = deliveryPendingList.size(); i < count; i++) {
6669
SmsTracker tracker = deliveryPendingList.get(i);
6770
if (tracker.mMessageRef == messageRef) {
6871
// Found it. Remove from list and broadcast.
69-
deliveryPendingList.remove(i);
72+
if(tpStatus >= Sms.STATUS_FAILED || tpStatus < Sms.STATUS_PENDING ) {
73+
deliveryPendingList.remove(i);
74+
}
7075
PendingIntent intent = tracker.mDeliveryIntent;
7176
Intent fillIn = new Intent();
7277
fillIn.putExtra("pdu", IccUtils.hexStringToBytes(pduString));

0 commit comments

Comments
 (0)