frameworks/base: Handle broadcast sms properly

Broadcast SMS does not have teleservice id field. Add
support to identify broadcast SMS based on message type.
This commit is contained in:
John Joseph
2009-12-15 15:23:23 -08:00
committed by Wink Saville
parent 4845ce3174
commit 83fd7b0d53
2 changed files with 14 additions and 2 deletions

View File

@@ -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;
}

View File

@@ -458,10 +458,21 @@ 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