summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Joseph <jnjoseph@quicinc.com>2009-12-15 15:23:23 -0800
committerWink Saville <wink@google.com>2009-12-21 09:28:54 -0800
commit83fd7b0d53f2fecb5b92cb911910e07659e246ca (patch)
tree8ded75e9e4dd80ea500ab4f8455183cb4f2941c2
parent4845ce3174c3f60e47a59b5e220c1f22e6bea730 (diff)
downloadframeworks_base-83fd7b0d53f2fecb5b92cb911910e07659e246ca.zip
frameworks_base-83fd7b0d53f2fecb5b92cb911910e07659e246ca.tar.gz
frameworks_base-83fd7b0d53f2fecb5b92cb911910e07659e246ca.tar.bz2
frameworks/base: Handle broadcast sms properly
Broadcast SMS does not have teleservice id field. Add support to identify broadcast SMS based on message type.
-rw-r--r--telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java3
-rwxr-xr-xtelephony/java/com/android/internal/telephony/cdma/SmsMessage.java13
2 files changed, 14 insertions, 2 deletions
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java b/telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java
index aee45bf..ed93aea 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java
@@ -167,7 +167,8 @@ final class CdmaSMSDispatcher extends SMSDispatcher {
// 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)) {
+ (SmsEnvelope.TELESERVICE_WEMT != teleService) &&
+ (SmsEnvelope.MESSAGE_TYPE_BROADCAST != sms.getMessageType())) {
return Intents.RESULT_SMS_UNSUPPORTED;
}
diff --git a/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java b/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java
index 3e491d1..403b7a1 100755
--- a/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java
+++ b/telephony/java/com/android/internal/telephony/cdma/SmsMessage.java
@@ -458,11 +458,22 @@ public class SmsMessage extends SmsMessageBase {
* {@link com.android.internal.telephony.cdma.sms.SmsEnvelope#TELESERVICE_VMN},
* {@link com.android.internal.telephony.cdma.sms.SmsEnvelope#TELESERVICE_WAP}
*/
- public int getTeleService() {
+ /* package */ int getTeleService() {
return mEnvelope.teleService;
}
/**
+ * Returns the message type of the message.
+ * @return the message type:
+ * {@link com.android.internal.telephony.cdma.sms.SmsEnvelope#MESSAGE_TYPE_POINT_TO_POINT},
+ * {@link com.android.internal.telephony.cdma.sms.SmsEnvelope#MESSAGE_TYPE_BROADCAST},
+ * {@link com.android.internal.telephony.cdma.sms.SmsEnvelope#MESSAGE_TYPE_ACKNOWLEDGE},
+ */
+ /* package */ int getMessageType() {
+ return mEnvelope.messageType;
+ }
+
+ /**
* Decodes pdu to an empty SMS object.
* In the CDMA case the pdu is just an internal byte stream representation
* of the SMS Java-object.