diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2011-02-03 14:05:14 -0800 |
---|---|---|
committer | Jean-Baptiste Queru <jbq@google.com> | 2011-02-03 14:05:23 -0800 |
commit | 8444023f351b22816f6827d3314ff81b3533e3d9 (patch) | |
tree | 6d110757b7315e9f804d075fffb5cb5dde8a6a6a /telephony/java | |
parent | ee4c17eec30b270f9a91cc92b40fc56435a59027 (diff) | |
parent | 4ddd99090e37edd3e6b7c57ddd065fa4e7007bf2 (diff) | |
download | frameworks_base-8444023f351b22816f6827d3314ff81b3533e3d9.zip frameworks_base-8444023f351b22816f6827d3314ff81b3533e3d9.tar.gz frameworks_base-8444023f351b22816f6827d3314ff81b3533e3d9.tar.bz2 |
Merge from open-source gingerbread
Change-Id: I19c4ba36cf4f2ef518b55768360b0bff1a92a5ab
Diffstat (limited to 'telephony/java')
-rwxr-xr-x[-rw-r--r--] | telephony/java/com/android/internal/telephony/SMSDispatcher.java | 24 | ||||
-rwxr-xr-x | telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java | 4 |
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 917e1d8..0b12b34 100644..100755 --- a/telephony/java/com/android/internal/telephony/SMSDispatcher.java +++ b/telephony/java/com/android/internal/telephony/SMSDispatcher.java @@ -65,6 +65,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; @@ -153,6 +154,8 @@ public abstract class SMSDispatcher extends Handler { protected boolean mStorageAvailable = true; protected boolean mReportMemoryStatusPending = false; + protected static int mRemainingMessages = -1; + protected static int getNextConcatenatedRef() { sConcatenatedRef += 1; return sConcatenatedRef; @@ -463,7 +466,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 { @@ -502,8 +515,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 49fa5da..e7b6c37 100755 --- a/telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java +++ b/telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java @@ -180,6 +180,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 @@ -269,6 +271,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 |