public abstract class SmsMessageBase extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SmsMessageBase.SubmitPduBase |
Modifier and Type | Field and Description |
---|---|
protected String |
mEmailBody
Non-null if this is an email gateway message
|
protected String |
mEmailFrom
Non-null if this is an email gateway message
|
protected int |
mIndexOnIcc
Record index of message in the EF.
|
protected boolean |
mIsEmail |
protected boolean |
mIsMwi |
protected String |
mMessageBody
The message body as a string.
|
int |
mMessageRef
TP-Message-Reference - Message Reference of sent message.
|
protected boolean |
mMwiDontStore |
protected boolean |
mMwiSense |
protected SmsAddress |
mOriginatingAddress
The address of the sender
|
protected byte[] |
mPdu
The raw PDU of the message
|
protected String |
mPseudoSubject |
protected String |
mScAddress
The address of the SMSC.
|
protected long |
mScTimeMillis
Time when SC (service centre) received the message
|
protected int |
mStatusOnIcc
Indicates status for messages stored on the ICC.
|
protected byte[] |
mUserData
The raw bytes for the user data section of the message
|
protected SmsHeader |
mUserDataHeader |
Constructor and Description |
---|
SmsMessageBase() |
Modifier and Type | Method and Description |
---|---|
static GsmAlphabet.TextEncodingDetails |
calcUnicodeEncodingDetails(CharSequence msgBody)
Calculate the TextEncodingDetails of a message encoded in Unicode.
|
protected void |
extractEmailAddressFromMessageBody()
Try to parse this message as an email gateway message
There are two ways specified in TS 23.040 Section 3.8 :
- SMS message "may have its TP-PID set for Internet electronic mail - MT
SMS format: [
|
static int |
findNextUnicodePosition(int currentPosition,
int byteLimit,
CharSequence msgBody)
Find the next position to start a new fragment of a multipart SMS.
|
String |
getDisplayMessageBody()
Returns the message body, or email message body if this message was from
an email gateway.
|
String |
getDisplayOriginatingAddress()
Returns the originating address, or email from address if this message
was from an email gateway.
|
String |
getEmailBody() |
String |
getEmailFrom() |
int |
getIndexOnIcc()
Returns the record index of the message on the ICC (1-based index).
|
String |
getMessageBody()
Returns the message body as a String, if it exists and is text based.
|
abstract SmsConstants.MessageClass |
getMessageClass()
Returns the class of this message.
|
String |
getOriginatingAddress()
Returns the originating address (sender) of this SMS message in String
form or null if unavailable
|
byte[] |
getPdu()
Returns the raw PDU for the message.
|
abstract int |
getProtocolIdentifier()
Get protocol identifier.
|
String |
getPseudoSubject()
Unofficial convention of a subject line enclosed in parens empty string
if not present
|
String |
getServiceCenterAddress()
Returns the address of the SMS service center that relayed this message
or null if there is none.
|
abstract int |
getStatus()
For an SMS-STATUS-REPORT message, this returns the status field from
the status report.
|
int |
getStatusOnIcc()
Returns the status of the message on the ICC (read, unread, sent, unsent).
|
long |
getTimestampMillis()
Returns the service centre timestamp in currentTimeMillis() format
|
byte[] |
getUserData()
returns the user data section minus the user data header if one was
present.
|
SmsHeader |
getUserDataHeader()
Returns an object representing the user data header
|
abstract boolean |
isCphsMwiMessage()
Returns true for CPHS MWI toggle message.
|
boolean |
isEmail()
Returns true if message is an email.
|
abstract boolean |
isMWIClearMessage()
returns true if this message is a CPHS voicemail / message waiting
indicator (MWI) clear message
|
abstract boolean |
isMwiDontStore()
returns true if this message is a "Message Waiting Indication Group:
Discard Message" notification and should not be stored.
|
abstract boolean |
isMWISetMessage()
returns true if this message is a CPHS voicemail / message waiting
indicator (MWI) set message
|
abstract boolean |
isReplace()
See TS 23.040 9.2.3.9 returns true if this is a "replace short message"
SMS
|
abstract boolean |
isReplyPathPresent()
Returns true iff the
TP-Reply-Path bit is set in
this message. |
abstract boolean |
isStatusReportMessage()
Return true iff the message is a SMS-STATUS-REPORT message.
|
protected void |
parseMessageBody() |
protected String mScAddress
protected SmsAddress mOriginatingAddress
protected String mMessageBody
protected String mPseudoSubject
protected String mEmailFrom
protected String mEmailBody
protected boolean mIsEmail
protected long mScTimeMillis
protected byte[] mPdu
protected byte[] mUserData
protected SmsHeader mUserDataHeader
protected boolean mIsMwi
protected boolean mMwiSense
protected boolean mMwiDontStore
protected int mStatusOnIcc
protected int mIndexOnIcc
public int mMessageRef
public String getServiceCenterAddress()
public String getOriginatingAddress()
public String getDisplayOriginatingAddress()
public String getMessageBody()
public abstract SmsConstants.MessageClass getMessageClass()
public String getDisplayMessageBody()
public String getPseudoSubject()
public long getTimestampMillis()
public boolean isEmail()
public String getEmailBody()
public String getEmailFrom()
public abstract int getProtocolIdentifier()
public abstract boolean isReplace()
public abstract boolean isCphsMwiMessage()
public abstract boolean isMWIClearMessage()
public abstract boolean isMWISetMessage()
public abstract boolean isMwiDontStore()
public byte[] getUserData()
public SmsHeader getUserDataHeader()
public byte[] getPdu()
public abstract int getStatus()
public abstract boolean isStatusReportMessage()
public abstract boolean isReplyPathPresent()
TP-Reply-Path
bit is set in
this message.public int getStatusOnIcc()
public int getIndexOnIcc()
protected void parseMessageBody()
protected void extractEmailAddressFromMessageBody()
public static int findNextUnicodePosition(int currentPosition, int byteLimit, CharSequence msgBody)
currentPosition
- current start position of the fragmentbyteLimit
- maximum number of bytes in the fragmentmsgBody
- text of the SMS in UTF-16 encodingpublic static GsmAlphabet.TextEncodingDetails calcUnicodeEncodingDetails(CharSequence msgBody)