/**@class android.service.carrier.CarrierMessagingService @extends android.app.Service A service that receives calls from the system when new SMS and MMS are sent or received. <p>To extend this class, you must declare the service in your manifest file with the {@link android.Manifest.permission#BIND_CARRIER_SERVICES} permission and include an intent filter with the {@link #SERVICE_INTERFACE} action. For example:</p> <pre> <service android:name=".MyMessagingService" android:label="@string/service_name" android:permission="android.permission.BIND_CARRIER_SERVICES"> <intent-filter> <action android:name="android.service.carrier.CarrierMessagingService" /> </intent-filter> </service></pre> */ var CarrierMessagingService = { /** The {@link android.content.Intent} that must be declared as handled by the service. */ SERVICE_INTERFACE : "android.service.carrier.CarrierMessagingService", /** The default bitmask value passed to the callback of {@link #onReceiveTextSms} with all {@code RECEIVE_OPTIONS_x} flags cleared to indicate that the message should be kept and a new message notification should be shown. @see #RECEIVE_OPTIONS_DROP @see #RECEIVE_OPTIONS_SKIP_NOTIFY_WHEN_CREDENTIAL_PROTECTED_STORAGE_UNAVAILABLE */ RECEIVE_OPTIONS_DEFAULT : "0", /** Used to set the flag in the bitmask passed to the callback of {@link #onReceiveTextSms} to indicate that the inbound SMS should be dropped. */ RECEIVE_OPTIONS_DROP : "1", /** Used to set the flag in the bitmask passed to the callback of {@link #onReceiveTextSms} to indicate that a new message notification should not be shown to the user when the credential-encrypted storage of the device is not available before the user unlocks the phone. It is only applicable to devices that support file-based encryption. */ RECEIVE_OPTIONS_SKIP_NOTIFY_WHEN_CREDENTIAL_PROTECTED_STORAGE_UNAVAILABLE : "2", /** Indicates that an SMS or MMS message was successfully sent. */ SEND_STATUS_OK : "0", /** SMS/MMS sending failed. We should retry via the carrier network. */ SEND_STATUS_RETRY_ON_CARRIER_NETWORK : "1", /** SMS/MMS sending failed. We should not retry via the carrier network. */ SEND_STATUS_ERROR : "2", /** Successfully downloaded an MMS message. */ DOWNLOAD_STATUS_OK : "0", /** MMS downloading failed. We should retry via the carrier network. */ DOWNLOAD_STATUS_RETRY_ON_CARRIER_NETWORK : "1", /** MMS downloading failed. We should not retry via the carrier network. */ DOWNLOAD_STATUS_ERROR : "2", /** Flag to request SMS delivery status report. */ SEND_FLAG_REQUEST_DELIVERY_STATUS : "1", /**Override this method to filter inbound SMS messages. @param {Object {MessagePdu}} pdu the PDUs of the message @param {String} format the format of the PDUs, typically "3gpp" or "3gpp2" @param {Number} destPort the destination port of a binary SMS, this will be -1 for text SMS @param {Number} subId SMS subscription ID of the SIM @param {Object {android.service.carrier.CarrierMessagingService.ResultCallback}} callback result callback. Call with {@code true} to keep an inbound SMS message and deliver to SMS apps, and {@code false} to drop the message. @deprecated Use {@link #onReceiveTextSms} instead. */ onFilterSms : function( ) {}, /**Override this method to filter inbound SMS messages. <p>This method will be called once for every incoming text SMS. You can invoke the callback with a bitmask to tell the platform how to handle the SMS. For a SMS received on a file-based encryption capable device while the credential-encrypted storage is not available, this method will be called for the second time when the credential-encrypted storage becomes available after the user unlocks the phone, if the bit {@link #RECEIVE_OPTIONS_DROP} is not set when invoking the callback. @param {Object {MessagePdu}} pdu the PDUs of the message @param {String} format the format of the PDUs, typically "3gpp" or "3gpp2" @param {Number} destPort the destination port of a binary SMS, this will be -1 for text SMS @param {Number} subId SMS subscription ID of the SIM @param {Object {android.service.carrier.CarrierMessagingService.ResultCallback}} callback result callback. Call with a bitmask integer to indicate how the incoming text SMS should be handled by the platform. Use {@link #RECEIVE_OPTIONS_DROP} and {@link #RECEIVE_OPTIONS_SKIP_NOTIFY_WHEN_CREDENTIAL_PROTECTED_STORAGE_UNAVAILABLE} to set the flags in the bitmask. */ onReceiveTextSms : function( ) {}, /**Override this method to intercept text SMSs sent from the device. @param {String} text the text to send @param {Number} subId SMS subscription ID of the SIM @param {String} destAddress phone number of the recipient of the message @param {Object {android.service.carrier.CarrierMessagingService.ResultCallback}} callback result callback. Call with a {@link SendSmsResult}. @param callback result callback. Call with a {@link SendSmsResult}. */ onSendTextSms : function( ) {}, /**Override this method to intercept text SMSs sent from the device. @param {String} text the text to send @param {Number} subId SMS subscription ID of the SIM @param {String} destAddress phone number of the recipient of the message @param {Number} sendSmsFlag Flag for sending SMS. Acceptable values are 0 and {@link #SEND_FLAG_REQUEST_DELIVERY_STATUS}. @param {Object {android.service.carrier.CarrierMessagingService.ResultCallback}} callback result callback. Call with a {@link SendSmsResult}. */ onSendTextSms : function( ) {}, /**Override this method to intercept binary SMSs sent from the device. @param {Object {byte[]}} data the binary content @param {Number} subId SMS subscription ID of the SIM @param {String} destAddress phone number of the recipient of the message @param {Number} destPort the destination port @param {Object {android.service.carrier.CarrierMessagingService.ResultCallback}} callback result callback. Call with a {@link SendSmsResult}. @param callback result callback. Call with a {@link SendSmsResult}. */ onSendDataSms : function( ) {}, /**Override this method to intercept binary SMSs sent from the device. @param {Object {byte[]}} data the binary content @param {Number} subId SMS subscription ID of the SIM @param {String} destAddress phone number of the recipient of the message @param {Number} destPort the destination port @param {Number} sendSmsFlag Flag for sending SMS. Acceptable values are 0 and {@link #SEND_FLAG_REQUEST_DELIVERY_STATUS}. @param {Object {android.service.carrier.CarrierMessagingService.ResultCallback}} callback result callback. Call with a {@link SendSmsResult}. */ onSendDataSms : function( ) {}, /**Override this method to intercept long SMSs sent from the device. @param {Object {java.util.List}} parts a {@link List} of the message parts @param {Number} subId SMS subscription ID of the SIM @param {String} destAddress phone number of the recipient of the message @param {Object {android.service.carrier.CarrierMessagingService.ResultCallback}} callback result callback. Call with a {@link SendMultipartSmsResult}. @param callback result callback. Call with a {@link SendMultipartSmsResult}. */ onSendMultipartTextSms : function( ) {}, /**Override this method to intercept long SMSs sent from the device. @param {Object {java.util.List}} parts a {@link List} of the message parts @param {Number} subId SMS subscription ID of the SIM @param {String} destAddress phone number of the recipient of the message @param {Number} sendSmsFlag Flag for sending SMS. Acceptable values are 0 and {@link #SEND_FLAG_REQUEST_DELIVERY_STATUS}. @param {Object {android.service.carrier.CarrierMessagingService.ResultCallback}} callback result callback. Call with a {@link SendMultipartSmsResult}. */ onSendMultipartTextSms : function( ) {}, /**Override this method to intercept MMSs sent from the device. @param {Object {Uri}} pduUri the content provider URI of the PDU to send @param {Number} subId SMS subscription ID of the SIM @param {Object {Uri}} location the optional URI to send this MMS PDU. If this is {code null}, the PDU should be sent to the default MMSC URL. @param {Object {android.service.carrier.CarrierMessagingService.ResultCallback}} callback result callback. Call with a {@link SendMmsResult}. */ onSendMms : function( ) {}, /**Override this method to download MMSs received. @param {Object {Uri}} contentUri the content provider URI of the PDU to be downloaded. @param {Number} subId SMS subscription ID of the SIM @param {Object {Uri}} location the URI of the message to be downloaded. @param {Object {android.service.carrier.CarrierMessagingService.ResultCallback}} callback result callback. Call with a status code which is one of {@link #DOWNLOAD_STATUS_OK}, {@link #DOWNLOAD_STATUS_RETRY_ON_CARRIER_NETWORK}, or {@link #DOWNLOAD_STATUS_ERROR}. */ onDownloadMms : function( ) {}, /** */ onBind : function( ) {}, };