Methods Summary |
---|
public static int[] | calculateLength(java.lang.CharSequence messageBody, boolean use7bitOnly)Calculates the number of SMS's required to encode the message body and
the number of characters remaining until the next message, given the
current encoding.
GsmAlphabet.TextEncodingDetails ted =
com.android.internal.telephony.gsm.SmsMessage
.calculateLength(messageBody, use7bitOnly);
int ret[] = new int[4];
ret[0] = ted.msgCount;
ret[1] = ted.codeUnitCount;
ret[2] = ted.codeUnitsRemaining;
ret[3] = ted.codeUnitSize;
return ret;
|
public static int[] | calculateLength(java.lang.String messageBody, boolean use7bitOnly)Calculates the number of SMS's required to encode the message body and
the number of characters remaining until the next message, given the
current encoding.
return calculateLength((CharSequence)messageBody, use7bitOnly);
|
public static android.telephony.gsm.SmsMessage | createFromPdu(byte[] pdu)Create an SmsMessage from a raw PDU.
SmsMessageBase wrappedMessage;
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
wrappedMessage = com.android.internal.telephony.cdma.SmsMessage.createFromPdu(pdu);
} else {
wrappedMessage = com.android.internal.telephony.gsm.SmsMessage.createFromPdu(pdu);
}
return new SmsMessage(wrappedMessage);
|
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.
return mWrappedSmsMessage.getDisplayMessageBody();
|
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.
return mWrappedSmsMessage.getDisplayOriginatingAddress();
|
public java.lang.String | getEmailBody()
return mWrappedSmsMessage.getEmailBody();
|
public java.lang.String | getEmailFrom()
return mWrappedSmsMessage.getEmailFrom();
|
public int | getIndexOnIcc()Returns the record index of the message on the ICC (1-based index).
return mWrappedSmsMessage.getIndexOnIcc();
|
public int | getIndexOnSim()Returns the record index of the message on the SIM (1-based index).
return mWrappedSmsMessage.getIndexOnIcc();
|
public java.lang.String | getMessageBody()Returns the message body as a String, if it exists and is text based.
return mWrappedSmsMessage.getMessageBody();
|
public android.telephony.gsm.SmsMessage$MessageClass | getMessageClass()Returns the class of this message.
int index = mWrappedSmsMessage.getMessageClass().ordinal();
return MessageClass.values()[index];
|
public java.lang.String | getOriginatingAddress()Returns the originating address (sender) of this SMS message in String
form or null if unavailable
return mWrappedSmsMessage.getOriginatingAddress();
|
public byte[] | getPdu()Returns the raw PDU for the message.
return mWrappedSmsMessage.getPdu();
|
public int | getProtocolIdentifier()Get protocol identifier.
return mWrappedSmsMessage.getProtocolIdentifier();
|
public java.lang.String | getPseudoSubject()Unofficial convention of a subject line enclosed in parens empty string
if not present
return mWrappedSmsMessage.getPseudoSubject();
|
public java.lang.String | getServiceCenterAddress()Returns the address of the SMS service center that relayed this message
or null if there is none.
return mWrappedSmsMessage.getServiceCenterAddress();
|
private static final com.android.internal.telephony.SmsMessageBase | getSmsFacility()This method returns the reference to a specific
SmsMessage object, which is used for accessing its static methods.
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
return new com.android.internal.telephony.cdma.SmsMessage();
} else {
return new com.android.internal.telephony.gsm.SmsMessage();
}
|
public int | getStatus()GSM:
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.
CDMA:
For not interfering with status codes from GSM, the value is
shifted to the bits 31-16.
The value is composed of an error class (bits 25-24) and a status code (bits 23-16).
Possible codes are described in C.S0015-B, v2.0, 4.5.21.
return mWrappedSmsMessage.getStatus();
|
public int | getStatusOnIcc()Returns the status of the message on the ICC (read, unread, sent, unsent).
return mWrappedSmsMessage.getStatusOnIcc();
|
public int | getStatusOnSim()Returns the status of the message on the SIM (read, unread, sent, unsent).
return mWrappedSmsMessage.getStatusOnIcc();
|
public static android.telephony.gsm.SmsMessage$SubmitPdu | getSubmitPdu(java.lang.String scAddress, java.lang.String destinationAddress, java.lang.String message, boolean statusReportRequested, byte[] header)Get an SMS-SUBMIT PDU for a destination address and a message
SubmitPduBase spb;
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
spb = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddress,
destinationAddress, message, statusReportRequested,
SmsHeader.fromByteArray(header));
} else {
spb = com.android.internal.telephony.gsm.SmsMessage.getSubmitPdu(scAddress,
destinationAddress, message, statusReportRequested, header);
}
return new SubmitPdu(spb);
|
public static android.telephony.gsm.SmsMessage$SubmitPdu | getSubmitPdu(java.lang.String scAddress, java.lang.String destinationAddress, java.lang.String message, boolean statusReportRequested)Get an SMS-SUBMIT PDU for a destination address and a message
SubmitPduBase spb;
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
spb = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddress,
destinationAddress, message, statusReportRequested, null);
} else {
spb = com.android.internal.telephony.gsm.SmsMessage.getSubmitPdu(scAddress,
destinationAddress, message, statusReportRequested);
}
return new SubmitPdu(spb);
|
public static android.telephony.gsm.SmsMessage$SubmitPdu | getSubmitPdu(java.lang.String scAddress, java.lang.String destinationAddress, short destinationPort, byte[] data, boolean statusReportRequested)Get an SMS-SUBMIT PDU for a data message to a destination address & port
SubmitPduBase spb;
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
spb = com.android.internal.telephony.cdma.SmsMessage.getSubmitPdu(scAddress,
destinationAddress, destinationPort, data, statusReportRequested);
} else {
spb = com.android.internal.telephony.gsm.SmsMessage.getSubmitPdu(scAddress,
destinationAddress, destinationPort, data, statusReportRequested);
}
return new SubmitPdu(spb);
|
public static int | getTPLayerLengthForPDU(java.lang.String pdu)Get the TP-Layer-Length for the given SMS-SUBMIT PDU Basically, the
length in bytes (not hex chars) less the SMSC header
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType();
if (PHONE_TYPE_CDMA == activePhone) {
return com.android.internal.telephony.cdma.SmsMessage.getTPLayerLengthForPDU(pdu);
} else {
return com.android.internal.telephony.gsm.SmsMessage.getTPLayerLengthForPDU(pdu);
}
|
public long | getTimestampMillis()Returns the service centre timestamp in currentTimeMillis() format
return mWrappedSmsMessage.getTimestampMillis();
|
public byte[] | getUserData()returns the user data section minus the user data header if one was present.
return mWrappedSmsMessage.getUserData();
|
public boolean | isCphsMwiMessage()Returns true for CPHS MWI toggle message.
return mWrappedSmsMessage.isCphsMwiMessage();
|
public boolean | isEmail()Returns true if message is an email.
return mWrappedSmsMessage.isEmail();
|
public boolean | isMWIClearMessage()returns true if this message is a CPHS voicemail / message waiting
indicator (MWI) clear message
return mWrappedSmsMessage.isMWIClearMessage();
|
public boolean | isMWISetMessage()returns true if this message is a CPHS voicemail / message waiting
indicator (MWI) set message
return mWrappedSmsMessage.isMWISetMessage();
|
public boolean | isMwiDontStore()returns true if this message is a "Message Waiting Indication Group:
Discard Message" notification and should not be stored.
return mWrappedSmsMessage.isMwiDontStore();
|
public boolean | isReplace()See TS 23.040 9.2.3.9 returns true if this is a "replace short message" SMS
return mWrappedSmsMessage.isReplace();
|
public boolean | isReplyPathPresent()Returns true iff the TP-Reply-Path bit is set in
this message.
return mWrappedSmsMessage.isReplyPathPresent();
|
public boolean | isStatusReportMessage()Return true iff the message is a SMS-STATUS-REPORT message.
return mWrappedSmsMessage.isStatusReportMessage();
|