summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jean-Baptiste Queru <jbq@google.com> 2011-02-07 10:48:25 -0800
committer Android Git Automerger <android-git-automerger@android.com> 2011-02-07 10:48:25 -0800
commit0d4c1fe368142993d37ced49cfae251b1073c346 (patch)
tree15cf1060a36a7ae2426eec5b24babd498637b1a0
parentf04b353573c50bfe51e1c3266d599ac34f3affe7 (diff)
parentb6bf10e4bd2c17838a00091c3b8efb2f91ce3457 (diff)
am b6bf10e4: Merge 917d9ea1
* commit 'b6bf10e4bd2c17838a00091c3b8efb2f91ce3457': Fix the Multi-page SMS sending error to several receipents
-rwxr-xr-x[-rw-r--r--]telephony/java/com/android/internal/telephony/SMSDispatcher.java24
-rwxr-xr-xtelephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java4
2 files changed, 26 insertions, 2 deletions
diff --git a/telephony/java/com/android/internal/telephony/SMSDispatcher.java b/telephony/java/com/android/internal/telephony/SMSDispatcher.java
index 99123afe5a5a..02af79f7dbe2 100644..100755
--- a/telephony/java/com/android/internal/telephony/SMSDispatcher.java
+++ b/telephony/java/com/android/internal/telephony/SMSDispatcher.java
@@ -66,6 +66,7 @@ import static android.telephony.SmsManager.RESULT_ERROR_FDN_CHECK_FAILURE;
public abstract class SMSDispatcher extends Handler {
private static final String TAG = "SMS";
+ private static final String SEND_NEXT_MSG_EXTRA = "SendNextMsg";
/** Default checking period for SMS sent without user permit */
private static final int DEFAULT_SMS_CHECK_PERIOD = 3600000;
@@ -162,6 +163,8 @@ public abstract class SMSDispatcher extends Handler {
protected boolean mSmsReceiveDisabled;
protected boolean mSmsSendDisabled;
+ protected static int mRemainingMessages = -1;
+
protected static int getNextConcatenatedRef() {
sConcatenatedRef += 1;
return sConcatenatedRef;
@@ -486,7 +489,17 @@ public abstract class SMSDispatcher extends Handler {
if (sentIntent != null) {
try {
- sentIntent.send(Activity.RESULT_OK);
+ if (mRemainingMessages > -1) {
+ mRemainingMessages--;
+ }
+
+ if (mRemainingMessages == 0) {
+ Intent sendNext = new Intent();
+ sendNext.putExtra(SEND_NEXT_MSG_EXTRA, true);
+ sentIntent.send(mContext, Activity.RESULT_OK, sendNext);
+ } else {
+ sentIntent.send(Activity.RESULT_OK);
+ }
} catch (CanceledException ex) {}
}
} else {
@@ -525,8 +538,15 @@ public abstract class SMSDispatcher extends Handler {
if (ar.result != null) {
fillIn.putExtra("errorCode", ((SmsResponse)ar.result).errorCode);
}
- tracker.mSentIntent.send(mContext, error, fillIn);
+ if (mRemainingMessages > -1) {
+ mRemainingMessages--;
+ }
+
+ if (mRemainingMessages == 0) {
+ fillIn.putExtra(SEND_NEXT_MSG_EXTRA, true);
+ }
+ tracker.mSentIntent.send(mContext, error, fillIn);
} catch (CanceledException ex) {}
}
}
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java b/telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java
index 21ae98e30f6c..f576b4edf707 100755
--- a/telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java
@@ -200,6 +200,8 @@ final class GsmSMSDispatcher extends SMSDispatcher {
int msgCount = parts.size();
int encoding = android.telephony.SmsMessage.ENCODING_UNKNOWN;
+ mRemainingMessages = msgCount;
+
for (int i = 0; i < msgCount; i++) {
TextEncodingDetails details = SmsMessage.calculateLength(parts.get(i), false);
if (encoding != details.codeUnitSize
@@ -289,6 +291,8 @@ final class GsmSMSDispatcher extends SMSDispatcher {
int msgCount = parts.size();
int encoding = android.telephony.SmsMessage.ENCODING_UNKNOWN;
+ mRemainingMessages = msgCount;
+
for (int i = 0; i < msgCount; i++) {
TextEncodingDetails details = SmsMessage.calculateLength(parts.get(i), false);
if (encoding != details.codeUnitSize