Cheuksan Wang | f9c50c4 | 2014-10-21 15:58:23 -0700 | [diff] [blame^] | 1 | /** |
| 2 | * Copyright (c) 2014, The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.service.carriermessaging; |
| 18 | |
| 19 | import android.net.Uri; |
| 20 | import android.service.carriermessaging.ICarrierMessagingCallback; |
| 21 | import android.service.carriermessaging.MessagePdu; |
| 22 | |
| 23 | /** |
| 24 | * <p class="note"><strong>Note:</strong> |
| 25 | * This service can only be implemented by a carrier privileged app. |
| 26 | */ |
| 27 | oneway interface ICarrierMessagingService { |
| 28 | /** |
| 29 | * Request filtering an incoming SMS message. |
| 30 | * The service will call callback.onFilterComplete with the filtering result. |
| 31 | * |
| 32 | * @param pdu the PDUs of the message |
| 33 | * @param format the format of the PDUs, typically "3gpp" or "3gpp2" |
| 34 | * @param destPort the destination port of a data SMS. It will be -1 for text SMS |
| 35 | * @param callback the callback to notify upon completion |
| 36 | */ |
| 37 | void filterSms( |
| 38 | in MessagePdu pdu, String format, int destPort, in ICarrierMessagingCallback callback); |
| 39 | |
| 40 | /** |
| 41 | * Request sending a new text SMS from the device. |
| 42 | * The service will call {@link ICarrierMessagingCallback#onSendSmsComplete} with the send |
| 43 | * status. |
| 44 | * |
| 45 | * @param text the text to send |
| 46 | * @param format the format of the response PDU, typically "3gpp" or "3gpp2" |
| 47 | * @param destAddress phone number of the recipient of the message |
| 48 | * @param callback the callback to notify upon completion |
| 49 | */ |
| 50 | void sendTextSms(String text, String format, String destAddress, |
| 51 | in ICarrierMessagingCallback callback); |
| 52 | |
| 53 | /** |
| 54 | * Request sending a new data SMS from the device. |
| 55 | * The service will call {@link ICarrierMessagingCallback#onSendSmsComplete} with the send |
| 56 | * status. |
| 57 | * |
| 58 | * @param data the data to send |
| 59 | * @param format the format of the response PDU, typically "3gpp" or "3gpp2" |
| 60 | * @param destAddress phone number of the recipient of the message |
| 61 | * @param destPort port number of the recipient of the message |
| 62 | * @param callback the callback to notify upon completion |
| 63 | */ |
| 64 | void sendDataSms(in byte[] data, String format, String destAddress, int destPort, |
| 65 | in ICarrierMessagingCallback callback); |
| 66 | |
| 67 | /** |
| 68 | * Request sending a new multi-part text SMS from the device. |
| 69 | * The service will call {@link ICarrierMessagingCallback#onSendMultipartSmsComplete} |
| 70 | * with the send status. |
| 71 | * |
| 72 | * @param parts the parts of the multi-part text SMS to send |
| 73 | * @param format the format of the response PDU, typically "3gpp" or "3gpp2" |
| 74 | * @param destAddress phone number of the recipient of the message |
| 75 | * @param callback the callback to notify upon completion |
| 76 | */ |
| 77 | void sendMultipartTextSms(in List<String> parts, String format, String destAddress, |
| 78 | in ICarrierMessagingCallback callback); |
| 79 | |
| 80 | /** |
| 81 | * Request sending a new MMS PDU from the device. |
| 82 | * The service will call {@link ICarrierMessagingCallback#onSendMmsComplete} with the send |
| 83 | * status. |
| 84 | * |
| 85 | * @param pduUri the content provider URI of the PDU to send |
| 86 | * @param locationUrl the optional url to send this MMS PDU. |
| 87 | * If this is not specified, PDU should be sent to the default MMSC url. |
| 88 | * @param callback the callback to notify upon completion |
| 89 | */ |
| 90 | void sendMms(in Uri pduUri, String locationUrl, in ICarrierMessagingCallback callback); |
| 91 | |
| 92 | /** |
| 93 | * Request downloading a new MMS. |
| 94 | * The service will call {@link ICarrierMessagingCallback#onDownloadMmsComplete} with the |
| 95 | * download status. |
| 96 | * |
| 97 | * @param pduUri the content provider URI of the PDU to be downloaded. |
| 98 | * @param locationUrl the URL of the message to be downloaded. |
| 99 | * @param callback the callback to notify upon completion |
| 100 | */ |
| 101 | void downloadMms(in Uri pduUri, String locationUrl, in ICarrierMessagingCallback callback); |
| 102 | } |
| 103 | |