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:
committed by
Wink Saville
parent
4845ce3174
commit
83fd7b0d53
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user