Fields Summary |
---|
protected String | mScAddress{@hide} The address of the SMSC. May be null |
protected SmsAddress | mOriginatingAddress{@hide} The address of the sender |
protected String | mMessageBody{@hide} The message body as a string. May be null if the message isn't text |
protected String | mPseudoSubject{@hide} |
protected String | mEmailFrom{@hide} Non-null if this is an email gateway message |
protected String | mEmailBody{@hide} Non-null if this is an email gateway message |
protected boolean | mIsEmail{@hide} |
protected long | mScTimeMillis{@hide} |
protected byte[] | mPdu{@hide} The raw PDU of the message |
protected byte[] | mUserData{@hide} The raw bytes for the user data section of the message |
protected com.android.internal.telephony.SmsHeader | mUserDataHeader{@hide} |
protected boolean | mIsMwi{@hide} |
protected boolean | mMwiSense{@hide} |
protected boolean | mMwiDontStore{@hide} |
protected int | mStatusOnIccIndicates status for messages stored on the ICC. |
protected int | mIndexOnIccRecord index of message in the EF. |
public int | mMessageRefTP-Message-Reference - Message Reference of sent message. @hide |
Methods Summary |
---|
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: [] - "Depending on the
nature of the gateway, the destination/origination address is either
derived from the content of the SMS TP-OA or TP-DA field, or the
TP-OA/TP-DA field contains a generic gateway address and the to/from
address is added at the beginning as shown above." (which is supported here)
- Multiple addresses separated by commas, no spaces, Subject field delimited
by '()' or '##' and '#' Section 9.2.3.24.11 (which are NOT supported here)
/* Some carriers may use " /" delimiter as below
*
* 1. [x@y][ ]/[subject][ ]/[body]
* -or-
* 2. [x@y][ ]/[body]
*/
String[] parts = mMessageBody.split("( /)|( )", 2);
if (parts.length < 2) return;
mEmailFrom = parts[0];
mEmailBody = parts[1];
mIsEmail = Telephony.Mms.isEmailAddress(mEmailFrom);
|
public java.lang.String | getDisplayMessageBody()Returns the message body, or email message body if this message was from
an email gateway. Returns null if message body unavailable.
if (mIsEmail) {
return mEmailBody;
} else {
return getMessageBody();
}
|
public java.lang.String | getDisplayOriginatingAddress()Returns the originating address, or email from address if this message
was from an email gateway. Returns null if originating address
unavailable.
if (mIsEmail) {
return mEmailFrom;
} else {
return getOriginatingAddress();
}
|
public java.lang.String | getEmailBody()
return mEmailBody;
|
public java.lang.String | getEmailFrom()
return mEmailFrom;
|
public int | getIndexOnIcc()Returns the record index of the message on the ICC (1-based index).
return mIndexOnIcc;
|
public java.lang.String | getMessageBody()Returns the message body as a String, if it exists and is text based.
return mMessageBody;
|
public abstract SmsConstants.MessageClass | getMessageClass()Returns the class of this message.
|
public java.lang.String | getOriginatingAddress()Returns the originating address (sender) of this SMS message in String
form or null if unavailable
if (mOriginatingAddress == null) {
return null;
}
return mOriginatingAddress.getAddressString();
|
public byte[] | getPdu()Returns the raw PDU for the message.
return mPdu;
|
public abstract int | getProtocolIdentifier()Get protocol identifier.
|
public java.lang.String | getPseudoSubject()Unofficial convention of a subject line enclosed in parens empty string
if not present
return mPseudoSubject == null ? "" : mPseudoSubject;
|
public java.lang.String | getServiceCenterAddress()Returns the address of the SMS service center that relayed this message
or null if there is none.
return mScAddress;
|
public abstract int | getStatus()For an SMS-STATUS-REPORT message, this returns the status field from
the status report. This field indicates the status of a previously
submitted SMS, if requested. See TS 23.040, 9.2.3.15 TP-Status for a
description of values.
|
public int | getStatusOnIcc()Returns the status of the message on the ICC (read, unread, sent, unsent).
return mStatusOnIcc;
|
public long | getTimestampMillis()Returns the service centre timestamp in currentTimeMillis() format
return mScTimeMillis;
|
public byte[] | getUserData()returns the user data section minus the user data header if one was
present.
return mUserData;
|
public com.android.internal.telephony.SmsHeader | getUserDataHeader()Returns an object representing the user data header
{@hide}
return mUserDataHeader;
|
public abstract boolean | isCphsMwiMessage()Returns true for CPHS MWI toggle message.
|
public boolean | isEmail()Returns true if message is an email.
return mIsEmail;
|
public abstract boolean | isMWIClearMessage()returns true if this message is a CPHS voicemail / message waiting
indicator (MWI) clear message
|
public abstract boolean | isMWISetMessage()returns true if this message is a CPHS voicemail / message waiting
indicator (MWI) set message
|
public abstract boolean | isMwiDontStore()returns true if this message is a "Message Waiting Indication Group:
Discard Message" notification and should not be stored.
|
public abstract boolean | isReplace()See TS 23.040 9.2.3.9 returns true if this is a "replace short message"
SMS
|
public abstract boolean | isReplyPathPresent()Returns true iff the TP-Reply-Path bit is set in
this message.
|
public abstract boolean | isStatusReportMessage()Return true iff the message is a SMS-STATUS-REPORT message.
|
protected void | parseMessageBody()
// originatingAddress could be null if this message is from a status
// report.
if (mOriginatingAddress != null && mOriginatingAddress.couldBeEmailGateway()) {
extractEmailAddressFromMessageBody();
}
|