diff options
| author | Android (Google) Code Review <android-gerrit@google.com> | 2009-09-02 20:29:09 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-09-02 20:29:09 -0700 |
| commit | fb16e5ccdb230a11cbbbfd17d323db7b88395c2f (patch) | |
| tree | 130efcee59c77268b1889f4db9340cf1b8484540 /telephony | |
| parent | 8f99b52484369a3a9221733c9817f6c09ba1ec85 (diff) | |
| parent | 7e207afd497f8822ca34babe1d9cd1f6d5402fad (diff) | |
| download | frameworks_base-fb16e5ccdb230a11cbbbfd17d323db7b88395c2f.zip frameworks_base-fb16e5ccdb230a11cbbbfd17d323db7b88395c2f.tar.gz frameworks_base-fb16e5ccdb230a11cbbbfd17d323db7b88395c2f.tar.bz2 | |
Merge change 23607 into eclair
* changes:
Reject (NAK) CDMA SMS with unknown teleservice ids.
Diffstat (limited to 'telephony')
| -rw-r--r-- | telephony/java/com/android/internal/telephony/CommandsInterface.java | 3 | ||||
| -rw-r--r-- | telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java | 33 |
2 files changed, 24 insertions, 12 deletions
diff --git a/telephony/java/com/android/internal/telephony/CommandsInterface.java b/telephony/java/com/android/internal/telephony/CommandsInterface.java index ed8bc1e..63bdc2c 100644 --- a/telephony/java/com/android/internal/telephony/CommandsInterface.java +++ b/telephony/java/com/android/internal/telephony/CommandsInterface.java @@ -144,7 +144,8 @@ public interface CommandsInterface { static final int GSM_SMS_FAIL_CAUSE_MEMORY_CAPACITY_EXCEEDED = 0xD3; static final int GSM_SMS_FAIL_CAUSE_UNSPECIFIED_ERROR = 0xFF; - // CDMA SMS fail cause for acknowledgeLastIncomingCdmaSms. From TS N.S00005, 6.5.2.125. + // CDMA SMS fail cause for acknowledgeLastIncomingCdmaSms. From TS N.S0005, 6.5.2.125. + static final int CDMA_SMS_FAIL_CAUSE_INVALID_TELESERVICE_ID = 4; static final int CDMA_SMS_FAIL_CAUSE_RESOURCE_SHORTAGE = 35; static final int CDMA_SMS_FAIL_CAUSE_OTHER_TERMINAL_PROBLEM = 39; diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java b/telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java index 1e3a2e1..bf42257 100644 --- a/telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java +++ b/telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java @@ -128,7 +128,15 @@ final class CdmaSMSDispatcher extends SMSDispatcher { sms.getOriginatingAddress()); } - /** + // Reject (NAK) any messages with teleservice ids that have + // not yet been handled and also do not correspond to the two + // kinds that are processed below. + if ((SmsEnvelope.TELESERVICE_WMT != teleService) && + (SmsEnvelope.TELESERVICE_WEMT != teleService)) { + return Intents.RESULT_SMS_UNSUPPORTED; + } + + /* * TODO(cleanup): Why are we using a getter method for this * (and for so many other sms fields)? Trivial getters and * setters like this are direct violations of the style guide. @@ -141,11 +149,12 @@ final class CdmaSMSDispatcher extends SMSDispatcher { */ SmsHeader smsHeader = sms.getUserDataHeader(); - /** + /* * TODO(cleanup): Since both CDMA and GSM use the same header * format, this dispatch processing is naturally identical, * and code should probably not be replicated explicitly. */ + // See if message is partial or port addressed. if ((smsHeader == null) || (smsHeader.concatRef == null)) { // Message is not partial (not part of concatenated sequence). @@ -416,15 +425,17 @@ final class CdmaSMSDispatcher extends SMSDispatcher { private int resultToCause(int rc) { switch (rc) { - case Activity.RESULT_OK: - case Intents.RESULT_SMS_HANDLED: - // Cause code is ignored on success. - return 0; - case Intents.RESULT_SMS_OUT_OF_MEMORY: - return CommandsInterface.CDMA_SMS_FAIL_CAUSE_RESOURCE_SHORTAGE; - case Intents.RESULT_SMS_GENERIC_ERROR: - default: - return CommandsInterface.CDMA_SMS_FAIL_CAUSE_OTHER_TERMINAL_PROBLEM; + case Activity.RESULT_OK: + case Intents.RESULT_SMS_HANDLED: + // Cause code is ignored on success. + return 0; + case Intents.RESULT_SMS_OUT_OF_MEMORY: + return CommandsInterface.CDMA_SMS_FAIL_CAUSE_RESOURCE_SHORTAGE; + case Intents.RESULT_SMS_UNSUPPORTED: + return CommandsInterface.CDMA_SMS_FAIL_CAUSE_INVALID_TELESERVICE_ID; + case Intents.RESULT_SMS_GENERIC_ERROR: + default: + return CommandsInterface.CDMA_SMS_FAIL_CAUSE_OTHER_TERMINAL_PROBLEM; } } } |
