public class SmsMessage extends SmsMessageBase
Modifier and Type | Class and Description |
---|---|
static class |
SmsMessage.SubmitPdu |
SmsMessageBase.SubmitPduBase
mEmailBody, mEmailFrom, mIndexOnIcc, mIsEmail, mIsMwi, mMessageBody, mMessageRef, mMwiDontStore, mMwiSense, mOriginatingAddress, mPdu, mPseudoSubject, mScAddress, mScTimeMillis, mStatusOnIcc, mUserData, mUserDataHeader
Constructor and Description |
---|
SmsMessage() |
Modifier and Type | Method and Description |
---|---|
static GsmAlphabet.TextEncodingDetails |
calculateLength(CharSequence messageBody,
boolean use7bitOnly,
boolean isEntireMsg)
Calculate the number of septets needed to encode the message.
|
static SmsMessage |
createFromEfRecord(int index,
byte[] data)
Create an SmsMessage from an SMS EF record.
|
static SmsMessage |
createFromPdu(byte[] pdu)
Create an SmsMessage from a raw PDU.
|
byte[] |
getIncomingSmsFingerprint()
Returns a byte array that can be use to uniquely identify a received SMS message.
|
SmsConstants.MessageClass |
getMessageClass()
Returns the class of this message.
|
int |
getMessageType()
Returns the message type of the message.
|
static int |
getNextMessageId()
Calculate the next message id, starting at 1 and iteratively
incrementing within the range 1..65535 remembering the state
via a persistent system property.
|
int |
getNumOfVoicemails()
This function shall be called to get the number of voicemails.
|
int |
getProtocolIdentifier()
Note: This function is a GSM specific functionality which is not supported in CDMA mode.
|
ArrayList<CdmaSmsCbProgramData> |
getSmsCbProgramData()
Returns the list of service category program data, if present.
|
int |
getStatus()
Returns the status for a previously submitted message.
|
static SmsMessage.SubmitPdu |
getSubmitPdu(String scAddr,
String destAddr,
int destPort,
byte[] data,
boolean statusReportRequested)
Get an SMS-SUBMIT PDU for a data message to a destination address and port.
|
static SmsMessage.SubmitPdu |
getSubmitPdu(String scAddr,
String destAddr,
String message,
boolean statusReportRequested,
SmsHeader smsHeader)
Get an SMS-SUBMIT PDU for a destination address and a message
|
static SmsMessage.SubmitPdu |
getSubmitPdu(String destAddr,
UserData userData,
boolean statusReportRequested)
Get an SMS-SUBMIT PDU for a data message to a destination address & port
|
int |
getTeleService()
Returns the teleservice type of the message.
|
static int |
getTPLayerLengthForPDU(String pdu)
Note: This function is a GSM specific functionality which is not supported in CDMA mode.
|
boolean |
isCphsMwiMessage()
Returns true for CPHS MWI toggle message.
|
boolean |
isMWIClearMessage()
returns true if this message is a CPHS voicemail / message waiting
indicator (MWI) clear message
|
boolean |
isMwiDontStore()
returns true if this message is a "Message Waiting Indication Group:
Discard Message" notification and should not be stored.
|
boolean |
isMWISetMessage()
returns true if this message is a CPHS voicemail / message waiting
indicator (MWI) set message
|
boolean |
isReplace()
Note: This function is a GSM specific functionality which is not supported in CDMA mode.
|
boolean |
isReplyPathPresent()
Note: This function is a GSM specific functionality which is not supported in CDMA mode.
|
boolean |
isStatusReportMessage()
Return true iff the bearer data message type is DELIVERY_ACK.
|
static SmsMessage |
newFromParcel(Parcel p)
Create a "raw" CDMA SmsMessage from a Parcel that was forged in ril.cpp.
|
SmsCbMessage |
parseBroadcastSms()
Parses a broadcast SMS, possibly containing a CMAS alert.
|
void |
parseSms()
Parses a SMS message from its BearerData stream.
|
calcUnicodeEncodingDetails, extractEmailAddressFromMessageBody, findNextUnicodePosition, getDisplayMessageBody, getDisplayOriginatingAddress, getEmailBody, getEmailFrom, getIndexOnIcc, getMessageBody, getOriginatingAddress, getPdu, getPseudoSubject, getServiceCenterAddress, getStatusOnIcc, getTimestampMillis, getUserData, getUserDataHeader, isEmail, parseMessageBody
public static SmsMessage createFromPdu(byte[] pdu)
public static SmsMessage newFromParcel(Parcel p)
public static SmsMessage createFromEfRecord(int index, byte[] data)
index
- Index of SMS record. This should be index in ArrayList
returned by RuimSmsInterfaceManager.getAllMessagesFromIcc + 1.data
- Record data.public static int getTPLayerLengthForPDU(String pdu)
public static SmsMessage.SubmitPdu getSubmitPdu(String scAddr, String destAddr, String message, boolean statusReportRequested, SmsHeader smsHeader)
scAddr
- Service Centre address. Null means use default.destAddr
- Address of the recipient.message
- String representation of the message payload.statusReportRequested
- Indicates whether a report is requested for this message.smsHeader
- Array containing the data for the User Data Header, preceded
by the Element Identifiers.SubmitPdu
containing the encoded SC
address, if applicable, and the encoded message.
Returns null on encode error.public static SmsMessage.SubmitPdu getSubmitPdu(String scAddr, String destAddr, int destPort, byte[] data, boolean statusReportRequested)
scAddr
- Service Centre address. null == use defaultdestAddr
- the address of the destination for the messagedestPort
- the port to deliver the message to at the
destinationdata
- the data for the messageSubmitPdu
containing the encoded SC
address, if applicable, and the encoded message.
Returns null on encode error.public static SmsMessage.SubmitPdu getSubmitPdu(String destAddr, UserData userData, boolean statusReportRequested)
destAddr
- the address of the destination for the messageuserData
- the data for the messagestatusReportRequested
- Indicates whether a report is requested for this message.SubmitPdu
containing the encoded SC
address, if applicable, and the encoded message.
Returns null on encode error.public int getProtocolIdentifier()
getProtocolIdentifier
in class SmsMessageBase
public boolean isReplace()
isReplace
in class SmsMessageBase
public boolean isCphsMwiMessage()
isCphsMwiMessage
in class SmsMessageBase
public boolean isMWIClearMessage()
isMWIClearMessage
in class SmsMessageBase
public boolean isMWISetMessage()
isMWISetMessage
in class SmsMessageBase
public boolean isMwiDontStore()
isMwiDontStore
in class SmsMessageBase
public int getStatus()
getStatus
in class SmsMessageBase
public boolean isStatusReportMessage()
isStatusReportMessage
in class SmsMessageBase
public boolean isReplyPathPresent()
isReplyPathPresent
in class SmsMessageBase
public static GsmAlphabet.TextEncodingDetails calculateLength(CharSequence messageBody, boolean use7bitOnly, boolean isEntireMsg)
messageBody
- the message to encodeuse7bitOnly
- ignore (but still count) illegal characters if trueisEntireMsg
- indicates if this is entire msg or a segment in multipart msgpublic int getTeleService()
public int getMessageType()
SmsEnvelope.MESSAGE_TYPE_POINT_TO_POINT
,
SmsEnvelope.MESSAGE_TYPE_BROADCAST
,
SmsEnvelope.MESSAGE_TYPE_ACKNOWLEDGE
,public void parseSms()
public SmsCbMessage parseBroadcastSms()
public SmsConstants.MessageClass getMessageClass()
getMessageClass
in class SmsMessageBase
public static int getNextMessageId()
public int getNumOfVoicemails()
public byte[] getIncomingSmsFingerprint()
public ArrayList<CdmaSmsCbProgramData> getSmsCbProgramData()