Merge ee4c17ee from gingerbread

Change-Id: Ide109e517fb7610d60f31ba6aa99fe665b59d690
This commit is contained in:
Jean-Baptiste Queru
2011-02-03 13:03:36 -08:00
2 changed files with 8 additions and 3 deletions

4
core/java/android/provider/Telephony.java Normal file → Executable file
View File

@@ -115,8 +115,8 @@ public final class Telephony {
public static final int STATUS_NONE = -1;
public static final int STATUS_COMPLETE = 0;
public static final int STATUS_PENDING = 64;
public static final int STATUS_FAILED = 128;
public static final int STATUS_PENDING = 32;
public static final int STATUS_FAILED = 64;
/**
* The subject of the message, if present

View File

@@ -23,6 +23,7 @@ import android.content.Intent;
import android.os.AsyncResult;
import android.os.Message;
import android.os.SystemProperties;
import android.provider.Telephony.Sms;
import android.provider.Telephony.Sms.Intents;
import android.telephony.ServiceState;
import android.telephony.SmsCbMessage;
@@ -68,13 +69,17 @@ final class GsmSMSDispatcher extends SMSDispatcher {
String pduString = (String) ar.result;
SmsMessage sms = SmsMessage.newFromCDS(pduString);
int tpStatus = sms.getStatus();
if (sms != null) {
int messageRef = sms.messageRef;
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);
if(tpStatus >= Sms.STATUS_FAILED || tpStatus < Sms.STATUS_PENDING ) {
deliveryPendingList.remove(i);
}
PendingIntent intent = tracker.mDeliveryIntent;
Intent fillIn = new Intent();
fillIn.putExtra("pdu", IccUtils.hexStringToBytes(pduString));