FileDocCategorySizeDatePackage
ISms.javaAPI DocAndroid 5.1 API92211Sat Mar 14 05:48:12 GMT 2015com.android.internal.telephony

ISms

public interface ISms implements android.os.IInterface
Interface for applications to access the ICC phone book.

The following code snippet demonstrates a static method to retrieve the ISms interface from Android:

private static ISms getSmsInterface()
throws DeadObjectException {
IServiceManager sm = ServiceManagerNative.getDefault();
ISms ss;
ss = ISms.Stub.asInterface(sm.getService("isms"));
return ss;
}

Fields Summary
Constructors Summary
Methods Summary
public booleancopyMessageToIccEf(java.lang.String callingPkg, int status, byte[] pdu, byte[] smsc)
Copy a raw SMS PDU to the ICC.

param
pdu the raw PDU to store
param
status message status (STATUS_ON_ICC_READ, STATUS_ON_ICC_UNREAD, STATUS_ON_ICC_SENT, STATUS_ON_ICC_UNSENT)
return
success or not

public booleancopyMessageToIccEfForSubscriber(int subId, java.lang.String callingPkg, int status, byte[] pdu, byte[] smsc)
Copy a raw SMS PDU to the ICC.

param
pdu the raw PDU to store
param
status message status (STATUS_ON_ICC_READ, STATUS_ON_ICC_UNREAD, STATUS_ON_ICC_SENT, STATUS_ON_ICC_UNSENT)
param
subId the subId id.
return
success or not

public booleandisableCellBroadcast(int messageIdentifier, int ranType)
Disable reception of cell broadcast (SMS-CB) messages with the given message identifier and RAN type. The RAN type specify this message ID belong to 3GPP (GSM) or 3GPP2(CDMA). Note that if two different clients enable the same message identifier, they must both disable it for the device to stop receiving those messages.

param
messageIdentifier Message identifier as specified in TS 23.041 (3GPP) or C.R1001-G (3GPP2)
param
ranType as defined in class SmsManager, the value can be one of these: android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_GSM android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA
return
true if successful, false otherwise
see
#enableCellBroadcast(int, int)

public booleandisableCellBroadcastForSubscriber(int subId, int messageIdentifier, int ranType)
Disable reception of cell broadcast (SMS-CB) messages with the given message identifier and RAN type. The RAN type specify this message ID belong to 3GPP (GSM) or 3GPP2(CDMA). Note that if two different clients enable the same message identifier, they must both disable it for the device to stop receiving those messages.

param
messageIdentifier Message identifier as specified in TS 23.041 (3GPP) or C.R1001-G (3GPP2)
param
subId for which the broadcast has to be disabled
param
ranType as defined in class SmsManager, the value can be one of these: android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_GSM android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA
return
true if successful, false otherwise
see
#enableCellBroadcast(int, int)

public booleandisableCellBroadcastRange(int startMessageId, int endMessageId, int ranType)
Disable reception of cell broadcast (SMS-CB) messages with the given message identifier range and RAN type. The RAN type specify this message ID range belong to 3GPP (GSM) or 3GPP2(CDMA). Note that if two different clients enable a message identifier range, they must both disable it for the device to stop receiving those messages.

param
startMessageId first message identifier as specified in TS 23.041 (3GPP) or C.R1001-G (3GPP2)
param
endMessageId last message identifier as specified in TS 23.041 (3GPP) or C.R1001-G (3GPP2)
param
ranType as defined in class SmsManager, the value can be one of these: android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_GSM android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA
return
true if successful, false otherwise
see
#enableCellBroadcastRange(int, int, int)

public booleandisableCellBroadcastRangeForSubscriber(int subId, int startMessageId, int endMessageId, int ranType)
Disable reception of cell broadcast (SMS-CB) messages with the given message identifier range and RAN type. The RAN type specify this message ID range belong to 3GPP (GSM) or 3GPP2(CDMA). Note that if two different clients enable a message identifier range, they must both disable it for the device to stop receiving those messages.

param
startMessageId first message identifier as specified in TS 23.041 (3GPP) or C.R1001-G (3GPP2)
param
endMessageId last message identifier as specified in TS 23.041 (3GPP) or C.R1001-G (3GPP2)
param
subId for which the broadcast has to be disabled
param
ranType as defined in class SmsManager, the value can be one of these: android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_GSM android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA
return
true if successful, false otherwise
see
#enableCellBroadcastRange(int, int, int, int)

public booleanenableCellBroadcast(int messageIdentifier, int ranType)
Enable reception of cell broadcast (SMS-CB) messages with the given message identifier and RAN type. The RAN type specify this message ID belong to 3GPP (GSM) or 3GPP2(CDMA). Note that if two different clients enable the same message identifier, they must both disable it for the device to stop receiving those messages.

param
messageIdentifier Message identifier as specified in TS 23.041 (3GPP) or C.R1001-G (3GPP2)
param
ranType as defined in class SmsManager, the value can be one of these: android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_GSM android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA
return
true if successful, false otherwise
see
#disableCellBroadcast(int, int)

public booleanenableCellBroadcastForSubscriber(int subId, int messageIdentifier, int ranType)
Enable reception of cell broadcast (SMS-CB) messages with the given message identifier and RAN type. The RAN type specify this message ID belong to 3GPP (GSM) or 3GPP2(CDMA). Note that if two different clients enable the same message identifier, they must both disable it for the device to stop receiving those messages.

param
messageIdentifier Message identifier as specified in TS 23.041 (3GPP) or C.R1001-G (3GPP2)
param
subId for which the broadcast has to be enabled
param
ranType as defined in class SmsManager, the value can be one of these: android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_GSM android.telephony.SmsMessage.CELL_BROADCAST_RAN_TYPE_CDMA
return
true if successful, false otherwise
see
#disableCellBroadcast(int, int)

public booleanenableCellBroadcastRange(int startMessageId, int endMessageId, int ranType)

public booleanenableCellBroadcastRangeForSubscriber(int subId, int startMessageId, int endMessageId, int ranType)

public java.util.ListgetAllMessagesFromIccEf(java.lang.String callingPkg)
Retrieves all messages currently stored on ICC.

return
list of SmsRawData of all sms on ICC

public java.util.ListgetAllMessagesFromIccEfForSubscriber(int subId, java.lang.String callingPkg)
Retrieves all messages currently stored on ICC.

param
subId the subId id.
return
list of SmsRawData of all sms on ICC

public java.lang.StringgetImsSmsFormat()
Gets SMS format supported on IMS. SMS over IMS format is either 3GPP or 3GPP2.

return
android.telephony.SmsMessage.FORMAT_3GPP, android.telephony.SmsMessage.FORMAT_3GPP2 or android.telephony.SmsMessage.FORMAT_UNKNOWN
see
#isImsSmsSupported()

public java.lang.StringgetImsSmsFormatForSubscriber(int subId)
Gets SMS format supported on IMS. SMS over IMS format is either 3GPP or 3GPP2.

param
subId for subId which getImsSmsFormat is queried
return
android.telephony.SmsMessage.FORMAT_3GPP, android.telephony.SmsMessage.FORMAT_3GPP2 or android.telephony.SmsMessage.FORMAT_UNKNOWN
see
#isImsSmsSupported()

public intgetPreferredSmsSubscription()

public intgetPremiumSmsPermission(java.lang.String packageName)
Returns the premium SMS send permission for the specified package. Requires system permission.

public intgetPremiumSmsPermissionForSubscriber(int subId, java.lang.String packageName)
Returns the premium SMS send permission for the specified package. Requires system permission.

public voidinjectSmsPdu(byte[] pdu, java.lang.String format, android.app.PendingIntent receivedIntent)
Inject an SMS PDU into the android platform.

param
pdu is the byte array of pdu to be injected into android application framework
param
format is the format of SMS pdu (android.telephony.SmsMessage.FORMAT_3GPP or android.telephony.SmsMessage.FORMAT_3GPP2)
param
receivedIntent if not NULL this PendingIntent is broadcast when the message is successfully received by the android application framework. This intent is broadcasted at the same time an SMS received from radio is acknowledged back.

public booleanisImsSmsSupported()
SMS over IMS is supported if IMS is registered and SMS is supported on IMS.

return
true if SMS over IMS is supported, false otherwise
see
#getImsSmsFormat()

public booleanisImsSmsSupportedForSubscriber(int subId)
SMS over IMS is supported if IMS is registered and SMS is supported on IMS.

param
subId for subId which isImsSmsSupported is queried
return
true if SMS over IMS is supported, false otherwise
see
#getImsSmsFormat()

public booleanisSMSPromptEnabled()

public booleanisSmsSimPickActivityNeeded(int subId)
User needs to pick SIM for SMS if multiple SIMs present and if current subId passed in is not active/valid.

param
subId current subId for sending SMS
return
true if SIM for SMS sending needs to be chosen

public voidsendData(java.lang.String callingPkg, java.lang.String destAddr, java.lang.String scAddr, int destPort, byte[] data, android.app.PendingIntent sentIntent, android.app.PendingIntent deliveryIntent)
Send a data SMS.

param
smsc the SMSC to send the message through, or NULL for the default SMSC
param
data the body of the message to send
param
sentIntent if not NULL this PendingIntent is broadcast when the message is sucessfully sent, or failed. The result code will be Activity.RESULT_OK for success, or one of these errors:
RESULT_ERROR_GENERIC_FAILURE
RESULT_ERROR_RADIO_OFF
RESULT_ERROR_NULL_PDU
For RESULT_ERROR_GENERIC_FAILURE the sentIntent may include the extra "errorCode" containing a radio technology specific value, generally only useful for troubleshooting.
The per-application based SMS control checks sentIntent. If sentIntent is NULL the caller will be checked against all unknown applicaitons, which cause smaller number of SMS to be sent in checking period.
param
deliveryIntent if not NULL this PendingIntent is broadcast when the message is delivered to the recipient. The raw pdu of the status report is in the extended data ("pdu").

public voidsendDataForSubscriber(int subId, java.lang.String callingPkg, java.lang.String destAddr, java.lang.String scAddr, int destPort, byte[] data, android.app.PendingIntent sentIntent, android.app.PendingIntent deliveryIntent)
Send a data SMS.

param
smsc the SMSC to send the message through, or NULL for the default SMSC
param
data the body of the message to send
param
sentIntent if not NULL this PendingIntent is broadcast when the message is sucessfully sent, or failed. The result code will be Activity.RESULT_OK for success, or one of these errors:
RESULT_ERROR_GENERIC_FAILURE
RESULT_ERROR_RADIO_OFF
RESULT_ERROR_NULL_PDU
For RESULT_ERROR_GENERIC_FAILURE the sentIntent may include the extra "errorCode" containing a radio technology specific value, generally only useful for troubleshooting.
The per-application based SMS control checks sentIntent. If sentIntent is NULL the caller will be checked against all unknown applicaitons, which cause smaller number of SMS to be sent in checking period.
param
deliveryIntent if not NULL this PendingIntent is broadcast when the message is delivered to the recipient. The raw pdu of the status report is in the extended data ("pdu").
param
subId the subId id.

public voidsendMultipartText(java.lang.String callingPkg, java.lang.String destinationAddress, java.lang.String scAddress, java.util.List parts, java.util.List sentIntents, java.util.List deliveryIntents)
Send a multi-part text based SMS.

param
destinationAddress the address to send the message to
param
scAddress is the service center address or null to use the current default SMSC
param
parts an ArrayList of strings that, in order, comprise the original message
param
sentIntents if not null, an ArrayList of PendingIntents (one for each message part) that is broadcast when the corresponding message part has been sent. The result code will be Activity.RESULT_OK for success, or one of these errors: RESULT_ERROR_GENERIC_FAILURE RESULT_ERROR_RADIO_OFF RESULT_ERROR_NULL_PDU.
param
deliveryIntents if not null, an ArrayList of PendingIntents (one for each message part) that is broadcast when the corresponding message part has been delivered to the recipient. The raw pdu of the status report is in the extended data ("pdu").

public voidsendMultipartTextForSubscriber(int subId, java.lang.String callingPkg, java.lang.String destinationAddress, java.lang.String scAddress, java.util.List parts, java.util.List sentIntents, java.util.List deliveryIntents)
Send a multi-part text based SMS.

param
destinationAddress the address to send the message to
param
scAddress is the service center address or null to use the current default SMSC
param
parts an ArrayList of strings that, in order, comprise the original message
param
sentIntents if not null, an ArrayList of PendingIntents (one for each message part) that is broadcast when the corresponding message part has been sent. The result code will be Activity.RESULT_OK for success, or one of these errors: RESULT_ERROR_GENERIC_FAILURE RESULT_ERROR_RADIO_OFF RESULT_ERROR_NULL_PDU.
param
deliveryIntents if not null, an ArrayList of PendingIntents (one for each message part) that is broadcast when the corresponding message part has been delivered to the recipient. The raw pdu of the status report is in the extended data ("pdu").
param
subId the subId on which the SMS has to be sent.

public voidsendStoredMultipartText(int subId, java.lang.String callingPkg, android.net.Uri messageUri, java.lang.String scAddress, java.util.List sentIntents, java.util.List deliveryIntents)
Send a system stored multi-part text message. This is used for sending a previously sent, but failed-to-send, message or for sending a text message that has been stored as a draft. The provided PendingIntent lists should match the part number of the divided text of the stored message by using divideMessage

param
subId the SIM id.
param
callingPkg the package name of the calling app
param
messageUri the URI of the stored message
param
scAddress is the service center address or null to use the current default SMSC
param
sentIntents if not null, an ArrayList of PendingIntents (one for each message part) that is broadcast when the corresponding message part has been sent. The result code will be Activity.RESULT_OK for success, or one of these errors:
RESULT_ERROR_GENERIC_FAILURE
RESULT_ERROR_RADIO_OFF
RESULT_ERROR_NULL_PDU
For RESULT_ERROR_GENERIC_FAILURE each sentIntent may include the extra "errorCode" containing a radio technology specific value, generally only useful for troubleshooting.
The per-application based SMS control checks sentIntent. If sentIntent is NULL the caller will be checked against all unknown applications, which cause smaller number of SMS to be sent in checking period.
param
deliveryIntents if not null, an ArrayList of PendingIntents (one for each message part) that is broadcast when the corresponding message part has been delivered to the recipient. The raw pdu of the status report is in the extended data ("pdu").

public voidsendStoredText(int subId, java.lang.String callingPkg, android.net.Uri messageUri, java.lang.String scAddress, android.app.PendingIntent sentIntent, android.app.PendingIntent deliveryIntent)
Send a system stored text message. This is used for sending a previously sent, but failed-to-send, message or for sending a text message that has been stored as a draft.

param
subId the SIM id.
param
callingPkg the package name of the calling app
param
messageUri the URI of the stored message
param
scAddress is the service center address or null to use the current default SMSC
param
sentIntent if not NULL this PendingIntent is broadcast when the message is successfully sent, or failed. The result code will be Activity.RESULT_OK for success, or one of these errors:
RESULT_ERROR_GENERIC_FAILURE
RESULT_ERROR_RADIO_OFF
RESULT_ERROR_NULL_PDU
For RESULT_ERROR_GENERIC_FAILURE the sentIntent may include the extra "errorCode" containing a radio technology specific value, generally only useful for troubleshooting.
The per-application based SMS control checks sentIntent. If sentIntent is NULL the caller will be checked against all unknown applications, which cause smaller number of SMS to be sent in checking period.
param
deliveryIntent if not NULL this PendingIntent is broadcast when the message is delivered to the recipient. The raw pdu of the status report is in the extended data ("pdu").

public voidsendText(java.lang.String callingPkg, java.lang.String destAddr, java.lang.String scAddr, java.lang.String text, android.app.PendingIntent sentIntent, android.app.PendingIntent deliveryIntent)
Send an SMS.

param
smsc the SMSC to send the message through, or NULL for the default SMSC
param
text the body of the message to send
param
sentIntent if not NULL this PendingIntent is broadcast when the message is sucessfully sent, or failed. The result code will be Activity.RESULT_OK for success, or one of these errors:
RESULT_ERROR_GENERIC_FAILURE
RESULT_ERROR_RADIO_OFF
RESULT_ERROR_NULL_PDU
For RESULT_ERROR_GENERIC_FAILURE the sentIntent may include the extra "errorCode" containing a radio technology specific value, generally only useful for troubleshooting.
The per-application based SMS control checks sentIntent. If sentIntent is NULL the caller will be checked against all unknown applications, which cause smaller number of SMS to be sent in checking period.
param
deliveryIntent if not NULL this PendingIntent is broadcast when the message is delivered to the recipient. The raw pdu of the status report is in the extended data ("pdu").

public voidsendTextForSubscriber(int subId, java.lang.String callingPkg, java.lang.String destAddr, java.lang.String scAddr, java.lang.String text, android.app.PendingIntent sentIntent, android.app.PendingIntent deliveryIntent)
Send an SMS.

param
smsc the SMSC to send the message through, or NULL for the default SMSC
param
text the body of the message to send
param
sentIntent if not NULL this PendingIntent is broadcast when the message is sucessfully sent, or failed. The result code will be Activity.RESULT_OK for success, or one of these errors:
RESULT_ERROR_GENERIC_FAILURE
RESULT_ERROR_RADIO_OFF
RESULT_ERROR_NULL_PDU
For RESULT_ERROR_GENERIC_FAILURE the sentIntent may include the extra "errorCode" containing a radio technology specific value, generally only useful for troubleshooting.
The per-application based SMS control checks sentIntent. If sentIntent is NULL the caller will be checked against all unknown applications, which cause smaller number of SMS to be sent in checking period.
param
deliveryIntent if not NULL this PendingIntent is broadcast when the message is delivered to the recipient. The raw pdu of the status report is in the extended data ("pdu").
param
subId the subId on which the SMS has to be sent.

public voidsetPremiumSmsPermission(java.lang.String packageName, int permission)
Set the SMS send permission for the specified package. Requires system permission.

public voidsetPremiumSmsPermissionForSubscriber(int subId, java.lang.String packageName, int permission)
Set the SMS send permission for the specified package. Requires system permission.

public booleanupdateMessageOnIccEf(java.lang.String callingPkg, int messageIndex, int newStatus, byte[] pdu)
Update the specified message on the ICC.

param
messageIndex record index of message to update
param
newStatus new message status (STATUS_ON_ICC_READ, STATUS_ON_ICC_UNREAD, STATUS_ON_ICC_SENT, STATUS_ON_ICC_UNSENT, STATUS_ON_ICC_FREE)
param
pdu the raw PDU to store
return
success or not

public booleanupdateMessageOnIccEfForSubscriber(int subId, java.lang.String callingPkg, int messageIndex, int newStatus, byte[] pdu)
Update the specified message on the ICC.

param
messageIndex record index of message to update
param
newStatus new message status (STATUS_ON_ICC_READ, STATUS_ON_ICC_UNREAD, STATUS_ON_ICC_SENT, STATUS_ON_ICC_UNSENT, STATUS_ON_ICC_FREE)
param
pdu the raw PDU to store
param
subId the subId id.
return
success or not